From: Matthias Kaehlcke <mka@chromium.org>
To: Yi Zeng <yizeng@asrmicro.com>
Cc: rui.zhang@intel.com, edubezval@gmail.com,
daniel.lezcano@linaro.org, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] thermal: of-thermal: support to select governor in dts for thermal zone
Date: Tue, 29 Jan 2019 11:14:24 -0800 [thread overview]
Message-ID: <20190129191424.GL81583@google.com> (raw)
In-Reply-To: <1546873479-20415-1-git-send-email-yizeng@asrmicro.com>
On Mon, Jan 07, 2019 at 11:04:39PM +0800, Yi Zeng wrote:
> Add the governor property parsing that defined in thermal zone node
> in dts. If define the governor property for one thermal zone, for
> example, governor = "step_wise", then parse and register the thermal
> zone will find and set the right governor, except the only choice
> of default governor.
>
> Signed-off-by: Yi Zeng <yizeng@asrmicro.com>
> ---
> drivers/thermal/of-thermal.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
> index 4bfdb4a..f9368f4 100644
> --- a/drivers/thermal/of-thermal.c
> +++ b/drivers/thermal/of-thermal.c
> @@ -1024,6 +1024,7 @@ int __init of_parse_thermal_zones(void)
> struct thermal_zone_params *tzp;
> int i, mask = 0;
> u32 prop;
> + const char *name;
>
> tz = thermal_of_build_thermal_zone(child);
> if (IS_ERR(tz)) {
> @@ -1049,6 +1050,10 @@ int __init of_parse_thermal_zones(void)
> if (!of_property_read_u32(child, "sustainable-power", &prop))
> tzp->sustainable_power = prop;
>
> + if (!of_property_read_string(child, "governor", &name))
> + strncpy(tzp->governor_name, name,
> + THERMAL_NAME_LENGTH);
> +
> for (i = 0; i < tz->ntrips; i++)
> mask |= 1 << i;
For reference, the discussion of a similar patch about a year ago:
https://patchwork.kernel.org/patch/10259487/
>From a board developer POV I can see why you would want this, but
maintainers seem(ed) to think that it could cause more problems
than it solves.
Some arguments that were brought up against configuring the governor
in the DT:
- the DT should describe the hardware, not policy
- the specified governor might not exist / be enabled
- sysfs is more flexible than the DT
Cheers
Matthias
prev parent reply other threads:[~2019-01-29 19:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-07 15:04 [PATCH] thermal: of-thermal: support to select governor in dts for thermal zone Yi Zeng
2019-01-29 19:14 ` Matthias Kaehlcke [this message]
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=20190129191424.GL81583@google.com \
--to=mka@chromium.org \
--cc=daniel.lezcano@linaro.org \
--cc=edubezval@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rui.zhang@intel.com \
--cc=yizeng@asrmicro.com \
/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).