devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: qcom: sc8280xp: Introduce additional tsens instances
@ 2024-01-18 23:00 Bjorn Andersson
  2024-01-18 23:31 ` Konrad Dybcio
  0 siblings, 1 reply; 7+ messages in thread
From: Bjorn Andersson @ 2024-01-18 23:00 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: linux-arm-msm, devicetree, linux-kernel, Bjorn Andersson

The SC8280XP contains two additional tsens instances, providing among
other things thermal measurements for the GPU.

Add these and a GPU thermal-zone.

Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
---
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 37 ++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
index febf28356ff8..68b5ac0339a0 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
@@ -4033,6 +4033,28 @@ tsens1: thermal-sensor@c265000 {
 			#thermal-sensor-cells = <1>;
 		};
 
+		tsens2: thermal-sensor@c251000 {
+			compatible = "qcom,sc8280xp-tsens", "qcom,tsens-v2";
+			reg = <0 0x0c251000 0 0x1ff>, /* TM */
+			      <0 0x0c224000 0 0x8>; /* SROT */
+			#qcom,sensors = <11>;
+			interrupts-extended = <&pdc 122 IRQ_TYPE_LEVEL_HIGH>,
+					      <&pdc 124 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "uplow", "critical";
+			#thermal-sensor-cells = <1>;
+		};
+
+		tsens3: thermal-sensor@c252000 {
+			compatible = "qcom,sc8280xp-tsens", "qcom,tsens-v2";
+			reg = <0 0x0c252000 0 0x1ff>, /* TM */
+			      <0 0x0c225000 0 0x8>; /* SROT */
+			#qcom,sensors = <5>;
+			interrupts-extended = <&pdc 123 IRQ_TYPE_LEVEL_HIGH>,
+					      <&pdc 125 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "uplow", "critical";
+			#thermal-sensor-cells = <1>;
+		};
+
 		aoss_qmp: power-management@c300000 {
 			compatible = "qcom,sc8280xp-aoss-qmp", "qcom,aoss-qmp";
 			reg = <0 0x0c300000 0 0x400>;
@@ -5212,6 +5234,21 @@ cpu-crit {
 			};
 		};
 
+		gpu-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+
+			thermal-sensors = <&tsens2 2>;
+
+			trips {
+				cpu-crit {
+					temperature = <110000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
 		mem-thermal {
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;

---
base-commit: 943b9f0ab2cfbaea148dd6ac279957eb08b96904
change-id: 20240118-sc8280xp-tsens2_3-a5fd9a48d655

Best regards,
-- 
Bjorn Andersson <quic_bjorande@quicinc.com>


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

* Re: [PATCH] arm64: dts: qcom: sc8280xp: Introduce additional tsens instances
  2024-01-18 23:00 [PATCH] arm64: dts: qcom: sc8280xp: Introduce additional tsens instances Bjorn Andersson
@ 2024-01-18 23:31 ` Konrad Dybcio
  2024-01-19 19:00   ` Bjorn Andersson
  2024-01-26 10:00   ` Johan Hovold
  0 siblings, 2 replies; 7+ messages in thread
From: Konrad Dybcio @ 2024-01-18 23:31 UTC (permalink / raw)
  To: Bjorn Andersson, Bjorn Andersson, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-arm-msm, devicetree, linux-kernel



On 1/19/24 00:00, Bjorn Andersson wrote:
> The SC8280XP contains two additional tsens instances, providing among
> other things thermal measurements for the GPU.
> 
> Add these and a GPU thermal-zone.
> 
> Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
> ---
>   arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 37 ++++++++++++++++++++++++++++++++++
>   1 file changed, 37 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
> index febf28356ff8..68b5ac0339a0 100644
> --- a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
> @@ -4033,6 +4033,28 @@ tsens1: thermal-sensor@c265000 {
>   			#thermal-sensor-cells = <1>;
>   		};
>   
> +		tsens2: thermal-sensor@c251000 {
> +			compatible = "qcom,sc8280xp-tsens", "qcom,tsens-v2";
> +			reg = <0 0x0c251000 0 0x1ff>, /* TM */
> +			      <0 0x0c224000 0 0x8>; /* SROT */

I've previously called for removing these comments that we've been
copypasting around for years and years, and I'm gonna stand by that :P

[...]

>   
> +		gpu-thermal {
> +			polling-delay-passive = <250>;
> +			polling-delay = <1000>;

Hm, did tsens only gain support of non-polled reporting with 8450?

If not, we should definitely update all the relevant SoCs.

Konrad

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

* Re: [PATCH] arm64: dts: qcom: sc8280xp: Introduce additional tsens instances
  2024-01-18 23:31 ` Konrad Dybcio
@ 2024-01-19 19:00   ` Bjorn Andersson
  2024-01-20 13:34     ` Konrad Dybcio
  2024-01-26 10:00   ` Johan Hovold
  1 sibling, 1 reply; 7+ messages in thread
From: Bjorn Andersson @ 2024-01-19 19:00 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Bjorn Andersson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-arm-msm, devicetree, linux-kernel

On Fri, Jan 19, 2024 at 12:31:06AM +0100, Konrad Dybcio wrote:
> 
> 
> On 1/19/24 00:00, Bjorn Andersson wrote:
> > The SC8280XP contains two additional tsens instances, providing among
> > other things thermal measurements for the GPU.
> > 
> > Add these and a GPU thermal-zone.
> > 
> > Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
> > ---
> >   arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 37 ++++++++++++++++++++++++++++++++++
> >   1 file changed, 37 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
> > index febf28356ff8..68b5ac0339a0 100644
> > --- a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
> > @@ -4033,6 +4033,28 @@ tsens1: thermal-sensor@c265000 {
> >   			#thermal-sensor-cells = <1>;
> >   		};
> > +		tsens2: thermal-sensor@c251000 {
> > +			compatible = "qcom,sc8280xp-tsens", "qcom,tsens-v2";
> > +			reg = <0 0x0c251000 0 0x1ff>, /* TM */
> > +			      <0 0x0c224000 0 0x8>; /* SROT */
> 
> I've previously called for removing these comments that we've been
> copypasting around for years and years, and I'm gonna stand by that :P
> 

I'm not against that idea, but are you requesting that I update the
patch, removing the comments as well. Or that I send another patch
removing all of them?

> [...]
> 
> > +		gpu-thermal {
> > +			polling-delay-passive = <250>;
> > +			polling-delay = <1000>;
> 
> Hm, did tsens only gain support of non-polled reporting with 8450?
> 
> If not, we should definitely update all the relevant SoCs.
> 

Are you referring to the fact that 8450 seems to set most*
polling-delays to 0, which are "valid" delays but would cause
thermal_zone_device_set_polling() to just cancel the timeout every time?

We should be able to do that on all platforms with working interrupts,
no?

[*] Some of the zones has a passive timeout of 10?


That said, as above. Would you like me to fix that now?

Regards,
Bjorn

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

* Re: [PATCH] arm64: dts: qcom: sc8280xp: Introduce additional tsens instances
  2024-01-19 19:00   ` Bjorn Andersson
@ 2024-01-20 13:34     ` Konrad Dybcio
  0 siblings, 0 replies; 7+ messages in thread
From: Konrad Dybcio @ 2024-01-20 13:34 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Bjorn Andersson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-arm-msm, devicetree, linux-kernel

On 19.01.2024 20:00, Bjorn Andersson wrote:
> On Fri, Jan 19, 2024 at 12:31:06AM +0100, Konrad Dybcio wrote:
>>
>>
>> On 1/19/24 00:00, Bjorn Andersson wrote:
>>> The SC8280XP contains two additional tsens instances, providing among
>>> other things thermal measurements for the GPU.
>>>
>>> Add these and a GPU thermal-zone.
>>>
>>> Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>
>>> ---
>>>   arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 37 ++++++++++++++++++++++++++++++++++
>>>   1 file changed, 37 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
>>> index febf28356ff8..68b5ac0339a0 100644
>>> --- a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
>>> +++ b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
>>> @@ -4033,6 +4033,28 @@ tsens1: thermal-sensor@c265000 {
>>>   			#thermal-sensor-cells = <1>;
>>>   		};
>>> +		tsens2: thermal-sensor@c251000 {
>>> +			compatible = "qcom,sc8280xp-tsens", "qcom,tsens-v2";
>>> +			reg = <0 0x0c251000 0 0x1ff>, /* TM */
>>> +			      <0 0x0c224000 0 0x8>; /* SROT */
>>
>> I've previously called for removing these comments that we've been
>> copypasting around for years and years, and I'm gonna stand by that :P
>>
> 
> I'm not against that idea, but are you requesting that I update the
> patch, removing the comments as well. Or that I send another patch
> removing all of them?

Sending a patch that you immediately fix up is a little besides
the point. But the latter would also be nice, if you could.

> 
>> [...]
>>
>>> +		gpu-thermal {
>>> +			polling-delay-passive = <250>;
>>> +			polling-delay = <1000>;
>>
>> Hm, did tsens only gain support of non-polled reporting with 8450?
>>
>> If not, we should definitely update all the relevant SoCs.
>>
> 
> Are you referring to the fact that 8450 seems to set most*
> polling-delays to 0, which are "valid" delays but would cause
> thermal_zone_device_set_polling() to just cancel the timeout every time?
> 
> We should be able to do that on all platforms with working interrupts,
> no?

That's why I'm asking!

> 
> [*] Some of the zones has a passive timeout of 10?
> 
> 
> That said, as above. Would you like me to fix that now?

Yes, please!

Konrad

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

* Re: [PATCH] arm64: dts: qcom: sc8280xp: Introduce additional tsens instances
  2024-01-18 23:31 ` Konrad Dybcio
  2024-01-19 19:00   ` Bjorn Andersson
@ 2024-01-26 10:00   ` Johan Hovold
  2024-01-26 10:48     ` Konrad Dybcio
  1 sibling, 1 reply; 7+ messages in thread
From: Johan Hovold @ 2024-01-26 10:00 UTC (permalink / raw)
  To: Konrad Dybcio, Bjorn Andersson
  Cc: Bjorn Andersson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-arm-msm, devicetree, linux-kernel

On Fri, Jan 19, 2024 at 12:31:06AM +0100, Konrad Dybcio wrote:
> On 1/19/24 00:00, Bjorn Andersson wrote:

> > +		gpu-thermal {
> > +			polling-delay-passive = <250>;
> > +			polling-delay = <1000>;
> 
> Hm, did tsens only gain support of non-polled reporting with 8450?
> 
> If not, we should definitely update all the relevant SoCs.

Did you determine whether the interrupts work as expected?

We don't want to be polling here unless we have to (i.e. polling-delay
should be 0 as per the binding).

Johan

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

* Re: [PATCH] arm64: dts: qcom: sc8280xp: Introduce additional tsens instances
  2024-01-26 10:00   ` Johan Hovold
@ 2024-01-26 10:48     ` Konrad Dybcio
  2024-01-26 12:09       ` Johan Hovold
  0 siblings, 1 reply; 7+ messages in thread
From: Konrad Dybcio @ 2024-01-26 10:48 UTC (permalink / raw)
  To: Johan Hovold, Bjorn Andersson
  Cc: Bjorn Andersson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-arm-msm, devicetree, linux-kernel



On 1/26/24 11:00, Johan Hovold wrote:
> On Fri, Jan 19, 2024 at 12:31:06AM +0100, Konrad Dybcio wrote:
>> On 1/19/24 00:00, Bjorn Andersson wrote:
> 
>>> +		gpu-thermal {
>>> +			polling-delay-passive = <250>;
>>> +			polling-delay = <1000>;
>>
>> Hm, did tsens only gain support of non-polled reporting with 8450?
>>
>> If not, we should definitely update all the relevant SoCs.
> 
> Did you determine whether the interrupts work as expected?

Yes, they seem to!

> 
> We don't want to be polling here unless we have to (i.e. polling-delay
> should be 0 as per the binding).

Even better:

https://lore.kernel.org/lkml/20240125-topic-thermal-v1-0-3c9d4dced138@linaro.org/

Believe me, I'm not omitting you from Cc on purpose.. I usually
realize I forgot right after pressing enter on "do you really
wanna send"..

Konrad

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

* Re: [PATCH] arm64: dts: qcom: sc8280xp: Introduce additional tsens instances
  2024-01-26 10:48     ` Konrad Dybcio
@ 2024-01-26 12:09       ` Johan Hovold
  0 siblings, 0 replies; 7+ messages in thread
From: Johan Hovold @ 2024-01-26 12:09 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Bjorn Andersson, Bjorn Andersson, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, linux-arm-msm, devicetree,
	linux-kernel

On Fri, Jan 26, 2024 at 11:48:03AM +0100, Konrad Dybcio wrote:
> On 1/26/24 11:00, Johan Hovold wrote:
> > On Fri, Jan 19, 2024 at 12:31:06AM +0100, Konrad Dybcio wrote:
> >> On 1/19/24 00:00, Bjorn Andersson wrote:
> > 
> >>> +		gpu-thermal {
> >>> +			polling-delay-passive = <250>;
> >>> +			polling-delay = <1000>;
> >>
> >> Hm, did tsens only gain support of non-polled reporting with 8450?
> >>
> >> If not, we should definitely update all the relevant SoCs.
> > 
> > Did you determine whether the interrupts work as expected?
> 
> Yes, they seem to!

Excellent.

> > We don't want to be polling here unless we have to (i.e. polling-delay
> > should be 0 as per the binding).
> 
> Even better:
> 
> https://lore.kernel.org/lkml/20240125-topic-thermal-v1-0-3c9d4dced138@linaro.org/

I'm not sure that's better, but either way we want to set
'polling-delay' to zero here as we don't want to have to wait for that
binding and driver update to hit mainline in 6.9-rc1 before merging this
patch.
 
> Believe me, I'm not omitting you from Cc on purpose.. I usually
> realize I forgot right after pressing enter on "do you really
> wanna send"..

Heh. No worries.

Johan

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

end of thread, other threads:[~2024-01-26 12:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-18 23:00 [PATCH] arm64: dts: qcom: sc8280xp: Introduce additional tsens instances Bjorn Andersson
2024-01-18 23:31 ` Konrad Dybcio
2024-01-19 19:00   ` Bjorn Andersson
2024-01-20 13:34     ` Konrad Dybcio
2024-01-26 10:00   ` Johan Hovold
2024-01-26 10:48     ` Konrad Dybcio
2024-01-26 12:09       ` Johan Hovold

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).