All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] thermal: of-thermal: support to select governor in dts for thermal zone
@ 2019-01-07 15:04 ` Yi Zeng
  0 siblings, 0 replies; 4+ messages in thread
From: Yi Zeng @ 2019-01-07 15:04 UTC (permalink / raw)
  To: rui.zhang, edubezval, daniel.lezcano, linux-pm, linux-kernel; +Cc: Yi Zeng

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;
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] thermal: of-thermal: support to select governor in dts for thermal zone
@ 2019-01-07 15:04 ` Yi Zeng
  0 siblings, 0 replies; 4+ messages in thread
From: Yi Zeng @ 2019-01-07 15:04 UTC (permalink / raw)
  To: rui.zhang, edubezval, daniel.lezcano, linux-pm, linux-kernel; +Cc: Yi Zeng

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;
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] thermal: of-thermal: support to select governor in dts for thermal zone
  2019-01-07 15:04 ` Yi Zeng
@ 2019-01-29 19:14   ` Matthias Kaehlcke
  -1 siblings, 0 replies; 4+ messages in thread
From: Matthias Kaehlcke @ 2019-01-29 19:14 UTC (permalink / raw)
  To: Yi Zeng; +Cc: rui.zhang, edubezval, daniel.lezcano, linux-pm, linux-kernel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] thermal: of-thermal: support to select governor in dts for thermal zone
@ 2019-01-29 19:14   ` Matthias Kaehlcke
  0 siblings, 0 replies; 4+ messages in thread
From: Matthias Kaehlcke @ 2019-01-29 19:14 UTC (permalink / raw)
  To: Yi Zeng; +Cc: rui.zhang, edubezval, daniel.lezcano, linux-pm, linux-kernel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-01-29 19:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-07 15:04 [PATCH] thermal: of-thermal: support to select governor in dts for thermal zone Yi Zeng
2019-01-07 15:04 ` Yi Zeng
2019-01-29 19:14 ` Matthias Kaehlcke
2019-01-29 19:14   ` Matthias Kaehlcke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.