* [PATCH] thermal: of: use the default governor when registering thermal zones from DT
@ 2014-02-24 17:45 Javi Merino
2014-02-27 6:43 ` Zhang Rui
0 siblings, 1 reply; 2+ messages in thread
From: Javi Merino @ 2014-02-24 17:45 UTC (permalink / raw)
To: linux-pm
Cc: sudeep.holla, punit.agrawal, Javi Merino, Zhang Rui,
Eduardo Valentin
Thermal zones specified in the DT get no governor because the
thermal_zone_parameters they pass to thermal_zone_device_register()
has an empty governor_name entry. As there is no way to set the
governor from the DT at the moment, make them register the default
governor.
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Javi Merino <javi.merino@arm.com>
---
Another alternative would be to set governor_name to the default in
thermal_zone_device_register() if it receives the empty string.
There are no other users of thermal_zone_parameters in the kernel and
there is no user of the governor_name. I was tempted to kill
governor_name, but I guess it's there to be used by external modules.
drivers/thermal/of-thermal.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
index 04b1be7..3f850f2 100644
--- a/drivers/thermal/of-thermal.c
+++ b/drivers/thermal/of-thermal.c
@@ -791,6 +791,13 @@ int __init of_parse_thermal_zones(void)
/* No hwmon because there might be hwmon drivers registering */
tzp->no_hwmon = true;
+ /*
+ * We can't specify the governor in the DT, so use the
+ * default one
+ */
+ strncpy(tzp->governor_name, DEFAULT_THERMAL_GOVERNOR,
+ ARRAY_SIZE(tzp->governor_name));
+
zone = thermal_zone_device_register(child->name, tz->ntrips,
0, tz,
ops, tzp,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] thermal: of: use the default governor when registering thermal zones from DT
2014-02-24 17:45 [PATCH] thermal: of: use the default governor when registering thermal zones from DT Javi Merino
@ 2014-02-27 6:43 ` Zhang Rui
0 siblings, 0 replies; 2+ messages in thread
From: Zhang Rui @ 2014-02-27 6:43 UTC (permalink / raw)
To: Javi Merino; +Cc: linux-pm, sudeep.holla, punit.agrawal, Eduardo Valentin
Hi,
On Mon, 2014-02-24 at 17:45 +0000, Javi Merino wrote:
> Thermal zones specified in the DT get no governor because the
> thermal_zone_parameters they pass to thermal_zone_device_register()
> has an empty governor_name entry. As there is no way to set the
> governor from the DT at the moment, make them register the default
> governor.
>
> Cc: Zhang Rui <rui.zhang@intel.com>
> Cc: Eduardo Valentin <eduardo.valentin@ti.com>
> Signed-off-by: Javi Merino <javi.merino@arm.com>
> ---
>
> Another alternative would be to set governor_name to the default in
> thermal_zone_device_register() if it receives the empty string.
>
agreed.
please check if the patch at https://patchwork.kernel.org/patch/3730391/
fixes the problem for you or not.
thanks,
rui
> There are no other users of thermal_zone_parameters in the kernel and
> there is no user of the governor_name. I was tempted to kill
> governor_name, but I guess it's there to be used by external modules.
>
> drivers/thermal/of-thermal.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
> index 04b1be7..3f850f2 100644
> --- a/drivers/thermal/of-thermal.c
> +++ b/drivers/thermal/of-thermal.c
> @@ -791,6 +791,13 @@ int __init of_parse_thermal_zones(void)
> /* No hwmon because there might be hwmon drivers registering */
> tzp->no_hwmon = true;
>
> + /*
> + * We can't specify the governor in the DT, so use the
> + * default one
> + */
> + strncpy(tzp->governor_name, DEFAULT_THERMAL_GOVERNOR,
> + ARRAY_SIZE(tzp->governor_name));
> +
> zone = thermal_zone_device_register(child->name, tz->ntrips,
> 0, tz,
> ops, tzp,
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-02-27 6:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-24 17:45 [PATCH] thermal: of: use the default governor when registering thermal zones from DT Javi Merino
2014-02-27 6:43 ` Zhang Rui
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).