[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240717013046.72047bae@mir>
Date: Wed, 17 Jul 2024 01:30:46 +0200
From: Stefan Lippers-Hollmann <s.l-h@....de>
To: "Rafael J. Wysocki" <rafael@...nel.org>
Cc: Daniel Lezcano <daniel.lezcano@...aro.org>, Eric Biggers
<ebiggers@...nel.org>, "Rafael J. Wysocki" <rjw@...ysocki.net>, Linux PM
<linux-pm@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>, Lukasz
Luba <lukasz.luba@....com>, Srinivas Pandruvada
<srinivas.pandruvada@...ux.intel.com>, Zhang Rui <rui.zhang@...el.com>,
Neil Armstrong <neil.armstrong@...aro.org>
Subject: Re: [PATCH v3] thermal: core: Call monitor_thermal_zone() if zone
temperature is invalid
Hi
On 2024-07-16, Rafael J. Wysocki wrote:
> On Tue, Jul 16, 2024 at 3:20 PM Stefan Lippers-Hollmann <s.l-h@....de> wrote:
> > On 2024-07-16, Rafael J. Wysocki wrote:
> > > On Tue, Jul 16, 2024 at 1:36 PM Rafael J. Wysocki <rafael@...nel.org> wrote:
> > > > On Tue, Jul 16, 2024 at 1:15 PM Stefan Lippers-Hollmann <s.l-h@....de> wrote:
> > > > > On 2024-07-16, Stefan Lippers-Hollmann wrote:
> > > > > > On 2024-07-16, Rafael J. Wysocki wrote:
> > > > > > > On Tue, Jul 16, 2024 at 1:48 AM Stefan Lippers-Hollmann <s.l-h@....de> wrote:
> > > > > > > > On 2024-07-15, Rafael J. Wysocki wrote:
> > > > > > > > > On Mon, Jul 15, 2024 at 2:54 PM Stefan Lippers-Hollmann <s.l-h@....de> wrote:
> > > > > > > > > > On 2024-07-15, Rafael J. Wysocki wrote:
> > > > > > > > > > > On Mon, Jul 15, 2024 at 11:09 AM Daniel Lezcano
> > > > > > > > > > > <daniel.lezcano@...aro.org> wrote:
> > > > > > > > > > > > On 15/07/2024 06:45, Eric Biggers wrote:
> > > > > > > > > > > > > On Thu, Jul 04, 2024 at 01:46:26PM +0200, Rafael J. Wysocki wrote:
> > > > > > > > > > > > >> From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
> > > > > > > > [...]
> > > > > > > > > > Silencing the warnings is already a big improvement - and that patch
> > > > > > > > > > works to this extent for me with an ax200, thanks.
> > > > > > > > >
> > > > > > > > > So attached is a patch that should avoid enabling the thermal zone
> > > > > > > > > when it is not ready for use in the first place, so it should address
> > > > > > > > > both the message and the useless polling.
> > > > > > > > >
> > > > > > > > > I would appreciate giving it a go (please note that it hasn't received
> > > > > > > > > much testing so far, though).
> > > > > > > >
> > > > > > > > Sadly this patch doesn't seem to help:
> > > > > > >
> > > > > > > This is likely because it is missing checks for firmware image type.
> > > > > > > I've added them to the attached new version. Please try it.
> > > > > > >
> > > > > > > I've also added two pr_info() messages to get a better idea of what's
> > > > > > > going on, so please grep dmesg for "Thermal zone not ready" and
> > > > > > > "Enabling thermal zone".
> > > > > >
> > > > > > This is the output with the patch applied:
> > > > >
> > > > > The ax200 wlan interface is currently not up/ configured (system
> > > > > using its wired ethernet cards instead), the thermal_zone1 stops
> > > > > if I manually enable the interface (ip link set dev wlp4s0 up)
> > > > > after booting up:
> > > >
> > > > This explains it, thanks!
> > > >
> > > > The enabling of the thermal zone in iwl_mvm_load_ucode_wait_alive() is
> > > > premature or it should get disabled in the other two places that clear
> > > > the IWL_MVM_STATUS_FIRMWARE_RUNNING bit.
> > > >
> > > > I'm not sure why the thermal zone depends on whether or not this bit
> > > > is set, though. Is it really a good idea to return errors from it if
> > > > the interface is not up?
> > [...]
> > > > > [ 22.033468] thermal thermal_zone1: failed to read out thermal zone (-61)
> > > > > [ 22.213120] thermal thermal_zone1: Enabling thermal zone
> > > > > [ 22.283954] iwlwifi 0000:04:00.0: Registered PHC clock: iwlwifi-PTP, with index: 0
> > > >
> > > > Thanks for this data point!
> > > >
> > > > AFAICS the thermal zone in iwlwifi is always enabled, but only valid
> > > > if the interface is up. It looks to me like the thermal core needs a
> > > > special "don't poll me" error code to be returned in such cases.
> > >
> > > Attached is a thermal core patch with an iwlwifi piece along the lines
> > > above (tested lightly). It adds a way for a driver to indicate that
> > > temperature cannot be provided at the moment, but that's OK and the
> > > core need not worry about that.
> > >
> > > Please give it a go.
> >
> > This seems to fail to build on top of v6.10, should I test Linus' HEAD
> > or some staging tree instead?
>
> No, it's missing one hunk, sorry about that.
>
> > [ I will be offline for the next few hours now, but will test it as soon
> > as possible, probably in ~9-10 hours ]
>
> No worries and thanks for your persistence!
>
[...]
>
> Attached is a new version that builds for me on top of plain 6.10.
I can confirm that this patch is working for me :)
$ dmesg | grep -i -e iwlwifi -e thermal
[ 0.080716] CPU0: Thermal monitoring enabled (TM1)
[ 0.113503] thermal_sys: Registered thermal governor 'fair_share'
[ 0.113503] thermal_sys: Registered thermal governor 'bang_bang'
[ 0.113503] thermal_sys: Registered thermal governor 'step_wise'
[ 0.113503] thermal_sys: Registered thermal governor 'user_space'
[ 0.113503] thermal_sys: Registered thermal governor 'power_allocator'
[ 3.847104] iwlwifi 0000:04:00.0: enabling device (0140 -> 0142)
[ 3.856638] iwlwifi 0000:04:00.0: Detected crf-id 0x3617, cnv-id 0x100530 wfpm id 0x80000000
[ 3.856649] iwlwifi 0000:04:00.0: PCI dev 2723/0084, rev=0x340, rfid=0x10a100
[ 3.861774] iwlwifi 0000:04:00.0: TLV_FW_FSEQ_VERSION: FSEQ Version: 89.3.35.37
[ 3.957860] iwlwifi 0000:04:00.0: loaded firmware version 77.a20fb07d.0 cc-a0-77.ucode op_mode iwlmvm
[ 4.356978] iwlwifi 0000:04:00.0: Detected Intel(R) Wi-Fi 6 AX200 160MHz, REV=0x340
[ 4.483791] iwlwifi 0000:04:00.0: Detected RF HR B3, rfid=0x10a100
[ 4.549338] iwlwifi 0000:04:00.0: base HW address: 94:e6:f7:XX:XX:XX
[ 4.571969] iwlwifi 0000:04:00.0 wlp4s0: renamed from wlan0
dmesg remains clean and everything seems to be fine, thanks a lot!
Regards
Stefan Lippers-Hollmann
Powered by blists - more mailing lists