From: Amit Kucheria <amit.kucheria@verdurent.com>
To: Thara Gopinath <thara.gopinath@linaro.org>
Cc: Eduardo Valentin <edubezval@gmail.com>,
Zhang Rui <rui.zhang@intel.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Andy Gross <agross@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Linux PM list <linux-pm@vger.kernel.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>,
linux-arm-msm <linux-arm-msm@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 3/7] thermal: core: Add late init hook to cooling device ops
Date: Tue, 3 Dec 2019 22:34:37 +0530 [thread overview]
Message-ID: <CAHLCerOCt9VBizAHu+y+CmzFmz-ktqCJgcB_NeC3WC4W9YBvAQ@mail.gmail.com> (raw)
In-Reply-To: <1571254641-13626-4-git-send-email-thara.gopinath@linaro.org>
On Thu, Oct 17, 2019 at 1:07 AM Thara Gopinath
<thara.gopinath@linaro.org> wrote:
>
> Add a hook in thermal_cooling_device_ops to be called after
> the cooling device has been initialized and registered
> but before binding it to a thermal zone.
>
> In this patch series it is used to hook up a power domain
> to the device pointer of cooling device.
>
> It can be used for any other relevant late initializations
> of a cooling device as well.
Please describe WHY this hook is needed.
> Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
> ---
> drivers/thermal/thermal_core.c | 13 +++++++++++++
> include/linux/thermal.h | 1 +
> 2 files changed, 14 insertions(+)
>
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index 886e8fa..c2ecb73 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -994,6 +994,19 @@ __thermal_cooling_device_register(struct device_node *np,
> list_add(&cdev->node, &thermal_cdev_list);
> mutex_unlock(&thermal_list_lock);
>
> + /* Call into cdev late initialization if defined */
> + if (cdev->ops->late_init) {
> + result = cdev->ops->late_init(cdev);
> + if (result) {
> + ida_simple_remove(&thermal_cdev_ida, cdev->id);
> + put_device(&cdev->device);
> + mutex_lock(&thermal_list_lock);
> + list_del(&cdev->node);
> + mutex_unlock(&thermal_list_lock);
> + return ERR_PTR(result);
> + }
> + }
> +
> /* Update binding information for 'this' new cdev */
> bind_cdev(cdev);
>
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index e45659c..e94b3de 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -125,6 +125,7 @@ struct thermal_cooling_device_ops {
> struct thermal_zone_device *, unsigned long, u32 *);
> int (*power2state)(struct thermal_cooling_device *,
> struct thermal_zone_device *, u32, unsigned long *);
> + int (*late_init)(struct thermal_cooling_device *);
> };
>
> struct thermal_cooling_device {
> --
> 2.1.4
>
next prev parent reply other threads:[~2019-12-03 17:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1571254641-13626-1-git-send-email-thara.gopinath@linaro.org>
[not found] ` <1571254641-13626-8-git-send-email-thara.gopinath@linaro.org>
2019-10-29 1:31 ` [PATCH v3 7/7] arm64: dts: qcom: Add mx power domain as thermal warming device Rob Herring
2019-10-30 14:23 ` Thara Gopinath
[not found] ` <1571254641-13626-7-git-send-email-thara.gopinath@linaro.org>
[not found] ` <CAPDyKFqcKfmnNJ7j4Jb+JH739FBcHg5NBD6aR4H_N=zWGwm1ww@mail.gmail.com>
[not found] ` <5DA88892.5000408@linaro.org>
[not found] ` <CAPDyKFpYG7YADb6Xmm=8ug5=5X3d1y+JdkRvrnvtroeV3Yj62Q@mail.gmail.com>
[not found] ` <5DA89267.30806@linaro.org>
2019-10-29 1:36 ` [PATCH v3 6/7] dt-bindings: soc: qcom: Extend RPMh power controller binding to describe " Rob Herring
2019-10-29 10:06 ` Ulf Hansson
2019-10-29 20:16 ` Rob Herring
2019-10-30 9:27 ` Ulf Hansson
2019-10-30 14:27 ` Thara Gopinath
[not found] ` <1571254641-13626-4-git-send-email-thara.gopinath@linaro.org>
2019-12-03 17:04 ` Amit Kucheria [this message]
2019-12-03 17:09 ` [PATCH v3 3/7] thermal: core: Add late init hook to cooling device ops Thara Gopinath
2019-12-03 17:11 ` Amit Kucheria
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHLCerOCt9VBizAHu+y+CmzFmz-ktqCJgcB_NeC3WC4W9YBvAQ@mail.gmail.com \
--to=amit.kucheria@verdurent.com \
--cc=agross@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=daniel.lezcano@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=edubezval@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=rjw@rjwysocki.net \
--cc=rui.zhang@intel.com \
--cc=thara.gopinath@linaro.org \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).