mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] Assume polling-delay(-passive) = 0 when absent
@ 2024-01-25 12:11 Konrad Dybcio
  2024-01-25 12:11 ` [PATCH 1/2] dt-bindings: thermal-zones: Don't require polling-delay(-passive) Konrad Dybcio
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Konrad Dybcio @ 2024-01-25 12:11 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson
  Cc: linux-pm, devicetree, linux-kernel, Konrad Dybcio

As it stands, setting 0 explicitly feels like spam inside the DTs.
This series simplifies it.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
Konrad Dybcio (2):
      dt-bindings: thermal-zones: Don't require polling-delay(-passive)
      thermal/of: Assume polling-delay(-passive) 0 when absent

 Documentation/devicetree/bindings/thermal/thermal-zones.yaml |  2 --
 drivers/thermal/thermal_of.c                                 | 12 ++++++++----
 2 files changed, 8 insertions(+), 6 deletions(-)
---
base-commit: 01af33cc9894b4489fb68fa35c40e9fe85df63dc
change-id: 20240125-topic-thermal-f954cf83fc50

Best regards,
-- 
Konrad Dybcio <konrad.dybcio@linaro.org>


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

* [PATCH 1/2] dt-bindings: thermal-zones: Don't require polling-delay(-passive)
  2024-01-25 12:11 [PATCH 0/2] Assume polling-delay(-passive) = 0 when absent Konrad Dybcio
@ 2024-01-25 12:11 ` Konrad Dybcio
  2024-01-25 16:51   ` Conor Dooley
  2024-02-02  4:19   ` Bjorn Andersson
  2024-01-25 12:11 ` [PATCH 2/2] thermal/of: Assume polling-delay(-passive) 0 when absent Konrad Dybcio
  2024-03-07  9:36 ` [PATCH 0/2] Assume polling-delay(-passive) = " Daniel Lezcano
  2 siblings, 2 replies; 8+ messages in thread
From: Konrad Dybcio @ 2024-01-25 12:11 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson
  Cc: linux-pm, devicetree, linux-kernel, Konrad Dybcio

Currently, thermal zones associated with providers that have interrupts
for signaling hot/critical trips are required to set a polling-delay
of 0 to indicate no polling. This feels a bit backwards.

Assume 0 (no polling) when these properties are not defined.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 Documentation/devicetree/bindings/thermal/thermal-zones.yaml | 2 --
 1 file changed, 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
index dbd52620d293..68398e7e8655 100644
--- a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
+++ b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
@@ -228,8 +228,6 @@ patternProperties:
             additionalProperties: false
 
     required:
-      - polling-delay
-      - polling-delay-passive
       - thermal-sensors
       - trips
 

-- 
2.40.1


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

* [PATCH 2/2] thermal/of: Assume polling-delay(-passive) 0 when absent
  2024-01-25 12:11 [PATCH 0/2] Assume polling-delay(-passive) = 0 when absent Konrad Dybcio
  2024-01-25 12:11 ` [PATCH 1/2] dt-bindings: thermal-zones: Don't require polling-delay(-passive) Konrad Dybcio
@ 2024-01-25 12:11 ` Konrad Dybcio
  2024-02-02  4:19   ` Bjorn Andersson
  2024-03-07  8:04   ` Dmitry Baryshkov
  2024-03-07  9:36 ` [PATCH 0/2] Assume polling-delay(-passive) = " Daniel Lezcano
  2 siblings, 2 replies; 8+ messages in thread
From: Konrad Dybcio @ 2024-01-25 12:11 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson
  Cc: linux-pm, devicetree, linux-kernel, Konrad Dybcio

Currently, thermal zones associated with providers that have interrupts
for signaling hot/critical trips are required to set a polling-delay
of 0 to indicate no polling. This feels a bit backwards.

Change the code such that "no polling delay" also means "no polling".

Suggested-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/thermal/thermal_of.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
index 4d6c22e0ed85..61bbd42aa2cb 100644
--- a/drivers/thermal/thermal_of.c
+++ b/drivers/thermal/thermal_of.c
@@ -225,14 +225,18 @@ static int thermal_of_monitor_init(struct device_node *np, int *delay, int *pdel
 	int ret;
 
 	ret = of_property_read_u32(np, "polling-delay-passive", pdelay);
-	if (ret < 0) {
-		pr_err("%pOFn: missing polling-delay-passive property\n", np);
+	if (ret == -EINVAL) {
+		*pdelay = 0;
+	} else if (ret < 0) {
+		pr_err("%pOFn: Couldn't get polling-delay-passive: %d\n", np, ret);
 		return ret;
 	}
 
 	ret = of_property_read_u32(np, "polling-delay", delay);
-	if (ret < 0) {
-		pr_err("%pOFn: missing polling-delay property\n", np);
+	if (ret == -EINVAL) {
+		*delay = 0;
+	} else if (ret < 0) {
+		pr_err("%pOFn: Couldn't get polling-delay: %d\n", np, ret);
 		return ret;
 	}
 

-- 
2.40.1


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

* Re: [PATCH 1/2] dt-bindings: thermal-zones: Don't require polling-delay(-passive)
  2024-01-25 12:11 ` [PATCH 1/2] dt-bindings: thermal-zones: Don't require polling-delay(-passive) Konrad Dybcio
@ 2024-01-25 16:51   ` Conor Dooley
  2024-02-02  4:19   ` Bjorn Andersson
  1 sibling, 0 replies; 8+ messages in thread
From: Conor Dooley @ 2024-01-25 16:51 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson,
	linux-pm, devicetree, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1194 bytes --]

On Thu, Jan 25, 2024 at 01:11:15PM +0100, Konrad Dybcio wrote:
> Currently, thermal zones associated with providers that have interrupts
> for signaling hot/critical trips are required to set a polling-delay
> of 0 to indicate no polling. This feels a bit backwards.
> 
> Assume 0 (no polling) when these properties are not defined.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>

I think that makes sense.
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Cheers,
Conor.

> ---
>  Documentation/devicetree/bindings/thermal/thermal-zones.yaml | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
> index dbd52620d293..68398e7e8655 100644
> --- a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
> +++ b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
> @@ -228,8 +228,6 @@ patternProperties:
>              additionalProperties: false
>  
>      required:
> -      - polling-delay
> -      - polling-delay-passive
>        - thermal-sensors
>        - trips
>  
> 
> -- 
> 2.40.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH 2/2] thermal/of: Assume polling-delay(-passive) 0 when absent
  2024-01-25 12:11 ` [PATCH 2/2] thermal/of: Assume polling-delay(-passive) 0 when absent Konrad Dybcio
@ 2024-02-02  4:19   ` Bjorn Andersson
  2024-03-07  8:04   ` Dmitry Baryshkov
  1 sibling, 0 replies; 8+ messages in thread
From: Bjorn Andersson @ 2024-02-02  4:19 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-pm,
	devicetree, linux-kernel

On Thu, Jan 25, 2024 at 01:11:16PM +0100, Konrad Dybcio wrote:
> Currently, thermal zones associated with providers that have interrupts
> for signaling hot/critical trips are required to set a polling-delay
> of 0 to indicate no polling. This feels a bit backwards.
> 
> Change the code such that "no polling delay" also means "no polling".
> 
> Suggested-by: Bjorn Andersson <andersson@kernel.org>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Reviewed-by: Bjorn Andersson <andersson@kernel.org>

Regards,
Bjorn

> ---
>  drivers/thermal/thermal_of.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
> index 4d6c22e0ed85..61bbd42aa2cb 100644
> --- a/drivers/thermal/thermal_of.c
> +++ b/drivers/thermal/thermal_of.c
> @@ -225,14 +225,18 @@ static int thermal_of_monitor_init(struct device_node *np, int *delay, int *pdel
>  	int ret;
>  
>  	ret = of_property_read_u32(np, "polling-delay-passive", pdelay);
> -	if (ret < 0) {
> -		pr_err("%pOFn: missing polling-delay-passive property\n", np);
> +	if (ret == -EINVAL) {
> +		*pdelay = 0;
> +	} else if (ret < 0) {
> +		pr_err("%pOFn: Couldn't get polling-delay-passive: %d\n", np, ret);
>  		return ret;
>  	}
>  
>  	ret = of_property_read_u32(np, "polling-delay", delay);
> -	if (ret < 0) {
> -		pr_err("%pOFn: missing polling-delay property\n", np);
> +	if (ret == -EINVAL) {
> +		*delay = 0;
> +	} else if (ret < 0) {
> +		pr_err("%pOFn: Couldn't get polling-delay: %d\n", np, ret);
>  		return ret;
>  	}
>  
> 
> -- 
> 2.40.1
> 

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

* Re: [PATCH 1/2] dt-bindings: thermal-zones: Don't require polling-delay(-passive)
  2024-01-25 12:11 ` [PATCH 1/2] dt-bindings: thermal-zones: Don't require polling-delay(-passive) Konrad Dybcio
  2024-01-25 16:51   ` Conor Dooley
@ 2024-02-02  4:19   ` Bjorn Andersson
  1 sibling, 0 replies; 8+ messages in thread
From: Bjorn Andersson @ 2024-02-02  4:19 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-pm,
	devicetree, linux-kernel

On Thu, Jan 25, 2024 at 01:11:15PM +0100, Konrad Dybcio wrote:
> Currently, thermal zones associated with providers that have interrupts
> for signaling hot/critical trips are required to set a polling-delay
> of 0 to indicate no polling. This feels a bit backwards.
> 
> Assume 0 (no polling) when these properties are not defined.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Reviewed-by: Bjorn Andersson <andersson@kernel.org>

> ---
>  Documentation/devicetree/bindings/thermal/thermal-zones.yaml | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
> index dbd52620d293..68398e7e8655 100644
> --- a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
> +++ b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml
> @@ -228,8 +228,6 @@ patternProperties:
>              additionalProperties: false
>  
>      required:
> -      - polling-delay
> -      - polling-delay-passive
>        - thermal-sensors
>        - trips
>  
> 
> -- 
> 2.40.1
> 

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

* Re: [PATCH 2/2] thermal/of: Assume polling-delay(-passive) 0 when absent
  2024-01-25 12:11 ` [PATCH 2/2] thermal/of: Assume polling-delay(-passive) 0 when absent Konrad Dybcio
  2024-02-02  4:19   ` Bjorn Andersson
@ 2024-03-07  8:04   ` Dmitry Baryshkov
  1 sibling, 0 replies; 8+ messages in thread
From: Dmitry Baryshkov @ 2024-03-07  8:04 UTC (permalink / raw)
  To: Konrad Dybcio, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
	Lukasz Luba, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Bjorn Andersson
  Cc: linux-pm, devicetree, linux-kernel

On 25/01/2024 14:11, Konrad Dybcio wrote:
> Currently, thermal zones associated with providers that have interrupts
> for signaling hot/critical trips are required to set a polling-delay
> of 0 to indicate no polling. This feels a bit backwards.
> 
> Change the code such that "no polling delay" also means "no polling".
> 
> Suggested-by: Bjorn Andersson <andersson@kernel.org>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
>   drivers/thermal/thermal_of.c | 12 ++++++++----
>   1 file changed, 8 insertions(+), 4 deletions(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry


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

* Re: [PATCH 0/2] Assume polling-delay(-passive) = 0 when absent
  2024-01-25 12:11 [PATCH 0/2] Assume polling-delay(-passive) = 0 when absent Konrad Dybcio
  2024-01-25 12:11 ` [PATCH 1/2] dt-bindings: thermal-zones: Don't require polling-delay(-passive) Konrad Dybcio
  2024-01-25 12:11 ` [PATCH 2/2] thermal/of: Assume polling-delay(-passive) 0 when absent Konrad Dybcio
@ 2024-03-07  9:36 ` Daniel Lezcano
  2 siblings, 0 replies; 8+ messages in thread
From: Daniel Lezcano @ 2024-03-07  9:36 UTC (permalink / raw)
  To: Konrad Dybcio, Rafael J. Wysocki, Zhang Rui, Lukasz Luba,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson
  Cc: linux-pm, devicetree, linux-kernel

On 25/01/2024 13:11, Konrad Dybcio wrote:
> As it stands, setting 0 explicitly feels like spam inside the DTs.
> This series simplifies it.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---

Applied, thanks


-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


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

end of thread, other threads:[~2024-03-07  9:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-25 12:11 [PATCH 0/2] Assume polling-delay(-passive) = 0 when absent Konrad Dybcio
2024-01-25 12:11 ` [PATCH 1/2] dt-bindings: thermal-zones: Don't require polling-delay(-passive) Konrad Dybcio
2024-01-25 16:51   ` Conor Dooley
2024-02-02  4:19   ` Bjorn Andersson
2024-01-25 12:11 ` [PATCH 2/2] thermal/of: Assume polling-delay(-passive) 0 when absent Konrad Dybcio
2024-02-02  4:19   ` Bjorn Andersson
2024-03-07  8:04   ` Dmitry Baryshkov
2024-03-07  9:36 ` [PATCH 0/2] Assume polling-delay(-passive) = " Daniel Lezcano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®