From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Luca Weiss <luca.weiss@fairphone.com>,
Luca Weiss <luca@z3ntu.xyz>, Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
~postmarketos/upstreaming@lists.sr.ht
Cc: phone-devel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org, linux-iio@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH 4/4] arm64: dts: qcom: qcm6490-fairphone-fp5: Add PM7325 thermals
Date: Sat, 21 Oct 2023 18:22:22 +0200 [thread overview]
Message-ID: <9a37d4a4-dcdf-4c39-8059-b640969f242a@linaro.org> (raw)
In-Reply-To: <CWD8E95B0W8L.1UMMGJXJF47D@fairphone.com>
On 10/20/23 13:31, Luca Weiss wrote:
> On Wed Oct 18, 2023 at 10:28 PM CEST, Konrad Dybcio wrote:
>>
>>
>> On 10/14/23 19:52, Luca Weiss wrote:
>>> On Samstag, 14. Oktober 2023 01:13:29 CEST Konrad Dybcio wrote:
>>>> On 13.10.2023 10:09, Luca Weiss wrote:
>>>>> Configure the thermals for the QUIET_THERM, CAM_FLASH_THERM, MSM_THERM
>>>>> and RFC_CAM_THERM thermistors connected to PM7325.
>>>>>
>>>>> With this PMIC the software communication to the ADC is going through
>>>>> PMK7325 (= PMK8350).
>>>>>
>>>>> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
>>>>> ---
>>>>>
>>>>> arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 117
>>>>> +++++++++++++++++++++ 1 file changed, 117 insertions(+)
>>>>>
>>>>> diff --git a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
>>>>> b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts index
>>>>> 2c01f799a6b2..d0b1e4e507ff 100644
>>>>> --- a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
>>>>> +++ b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
>>>>> @@ -9,6 +9,7 @@
>>>>>
>>>>> #define PM7250B_SID 8
>>>>> #define PM7250B_SID1 9
>>>>>
>>>>> +#include <dt-bindings/iio/qcom,spmi-adc7-pm7325.h>
>>>>>
>>>>> #include <dt-bindings/iio/qcom,spmi-adc7-pmk8350.h>
>>>>> #include <dt-bindings/leds/common.h>
>>>>> #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
>>>>>
>>>>> @@ -137,6 +138,20 @@ afvdd_2p8: regulator-afvdd-2p8 {
>>>>>
>>>>> };
>>>>>
>>>>> thermal-zones {
>>>>>
>>>>> + camera-thermal {
>>>>> + polling-delay-passive = <0>;
>>>>> + polling-delay = <0>;
>>>>> + thermal-sensors = <&pmk8350_adc_tm 2>;
>>>>> +
>>>>> + trips {
>>>>> + active-config0 {
>>>>> + temperature = <125000>;
>>>>
>>>> are
>>>>
>>>>> + rear-cam-thermal {
>>>>>
>>>>> + temperature = <125000>;
>>>>
>>>> you
>>>>
>>>>> + sdm-skin-thermal {
>>>>>
>>>>> + temperature = <125000>;
>>>>
>>>> sure
>>>>
>>>> about these temps?
>>>
>>> (email from my other address, quicker right now)
>>>
>>> Well yes and no.
>>>
>>> Yes as in those are the temps specified in downstream dtb.
>>> No as in I'm 99% sure there's user space with definitely lower threshold that
>>> actually does something in response to the temps.
>>>
>>> I didn't look too much into this but does the kernel even do something when it
>>> hits one of these trip points? I assume when there's a cooling device thing
>>> specified then it can actually tell the driver to do something, but without
>>> (and most drivers don't support this?) I'm assuming the kernel can't do much
>>> anyways?
>>>
>>> So e.g. when the temperature for the flash led is reached I'm assuming
>>> downstream (+Android) either dims the led or turns it off? But I'd have to dig
>>> quite a bit into the thermal setup there to check what it's really doing.
>> I think reaching "critical" shuts down the platform, unless something
>> registering the thermal zone explicitly overrides the behavior.
>
> Should probably be easy to test, especially the camera flash thermal
> zone heats up *very* quickly when the flash is on, so should be trivial
> to set the trip point down from 125degC to e.g. 45degC and see what
> happens.
>
> So I did this and... nothing happened.
> I watched /sys/class/thermal/thermal_zone34/temp climb above 45degC and
> nothing happened.
>
> I guess trip type being "passive" and no cooling-device makes it not do
> anything.
>
> ==> /sys/class/thermal/thermal_zone34/trip_point_0_hyst <==
> 1000
> ==> /sys/class/thermal/thermal_zone34/trip_point_0_temp <==
> 45000
> ==> /sys/class/thermal/thermal_zone34/trip_point_0_type <==
> passive
>
> From Documentation/devicetree/bindings/thermal/thermal-zones.yaml:
>
> - active # enable active cooling e.g. fans
> - passive # enable passive cooling e.g. throttling cpu
> - hot # send notification to driver
> - critical # send notification to driver, trigger shutdown
>
> So unless we want to just shut down the system (with "critical"), I
> don't think thermal can't really do anything else right now, since e.g.
> leds-qcom-flash.c driver doesn't have any cooling support to lower the
> brightness or turn off the LED.
>
> So.. in essence not much we can do right now.
Yeah.. crashing the phone because the LED is too hot is sorta
suboptimal! Though I mainly had the skin temp in mind..
>
> But seems we also cannot remove this (kinda useless) trip since we need
> at least one trip point in the dts if I read the bindings yaml
> correctly.
Right
>
>>
>>>
>>> But for now I think it's okay to put this current thermal config into dts and
>>> we'll improve it later when 1. I understand more and 2. maybe some useful
>>> drivers support the cooling bits?
>> Yeah it's better than nothing, but ultimately we should probably move
>> the values that userspace daemon operates on here in the dt..
>
> For sure.. I spent a bit of time looking into the proprietary Qualcomm
> thermal-daemon sources but didn't really see much interesting things
> there for this platform, maybe some of this thermal handling is
> somewhere else - or half of these thermal zones aren't even used with
> Android.
>
> So.. good to get the current patch upstream or not? :)
Yep, just having the ability to read out thing is always good ;)
Konrad
next prev parent reply other threads:[~2023-10-21 16:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-13 8:09 [PATCH 0/4] Add Fairphone 5 thermals (PMK7325, PM7250B, PM7325) Luca Weiss
2023-10-13 8:09 ` [PATCH 1/4] iio: adc: Add PM7325 PMIC7 ADC bindings Luca Weiss
2023-10-13 8:38 ` Krzysztof Kozlowski
2023-10-13 8:54 ` Luca Weiss
2023-10-13 9:09 ` Krzysztof Kozlowski
2023-10-14 16:16 ` Jonathan Cameron
2023-10-13 8:09 ` [PATCH 2/4] arm64: dts: qcom: qcm6490-fairphone-fp5: Add PM7250B thermals Luca Weiss
2023-10-13 23:11 ` Konrad Dybcio
2023-10-18 20:30 ` Konrad Dybcio
2023-10-13 8:09 ` [PATCH 3/4] arm64: dts: qcom: qcm6490-fairphone-fp5: Add PMK7325 thermals Luca Weiss
2023-10-13 8:09 ` [PATCH 4/4] arm64: dts: qcom: qcm6490-fairphone-fp5: Add PM7325 thermals Luca Weiss
2023-10-13 23:13 ` Konrad Dybcio
2023-10-14 17:52 ` Luca Weiss
2023-10-18 20:28 ` Konrad Dybcio
2023-10-20 11:31 ` Luca Weiss
2023-10-21 16:22 ` Konrad Dybcio [this message]
2023-12-03 4:54 ` [PATCH 0/4] Add Fairphone 5 thermals (PMK7325, PM7250B, PM7325) Bjorn Andersson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9a37d4a4-dcdf-4c39-8059-b640969f242a@linaro.org \
--to=konrad.dybcio@linaro.org \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luca.weiss@fairphone.com \
--cc=luca@z3ntu.xyz \
--cc=phone-devel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=~postmarketos/upstreaming@lists.sr.ht \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®