2024-01-18 23:04:10

by Bjorn Andersson

[permalink] [raw]
Subject: [PATCH] arm64: dts: qcom: sc8280xp: Introduce additional tsens instances

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 <[email protected]>
---
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 <[email protected]>



2024-01-18 23:31:23

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH] arm64: dts: qcom: sc8280xp: Introduce additional tsens instances



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 <[email protected]>
> ---
> 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

2024-01-19 19:00:57

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH] arm64: dts: qcom: sc8280xp: Introduce additional tsens instances

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 <[email protected]>
> > ---
> > 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

2024-01-20 13:34:43

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH] arm64: dts: qcom: sc8280xp: Introduce additional tsens instances

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 <[email protected]>
>>> ---
>>> 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

2024-01-26 10:48:26

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH] arm64: dts: qcom: sc8280xp: Introduce additional tsens instances



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/[email protected]/

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

2024-01-26 11:38:48

by Johan Hovold

[permalink] [raw]
Subject: Re: [PATCH] arm64: dts: qcom: sc8280xp: Introduce additional tsens instances

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

2024-01-26 12:41:54

by Johan Hovold

[permalink] [raw]
Subject: Re: [PATCH] arm64: dts: qcom: sc8280xp: Introduce additional tsens instances

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/[email protected]/

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