lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAH5Ym4hqkMMBsT7XEz_f+TCng+0X2m0nV_Kdr-LAPBqgENgr5A@mail.gmail.com>
Date: Thu, 20 Mar 2025 18:20:20 -0700
From: Sam Edwards <cfsworks@...il.com>
To: Dragan Simic <dsimic@...jaro.org>
Cc: Heiko Stuebner <heiko@...ech.de>, linux-rockchip@...ts.infradead.org, 
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org, 
	Daniel Kukieła <daniel@...iela.pl>, 
	Sven Rademakers <sven.rademakers@...il.com>, Joshua Riek <jjriek@...izon.net>
Subject: Re: [PATCH] arm64: dts: rockchip: Allow Turing RK1 cooling fan to
 spin down

On Thu, Mar 20, 2025 at 5:38 PM Dragan Simic <dsimic@...jaro.org> wrote:
>
> Hello Sam,
>
> On 2025-03-15 21:48, Sam Edwards wrote:
> > The RK3588 thermal sensor driver only receives interrupts when a
> > higher-temperature threshold is crossed; it cannot notify when the
> > sensor cools back off. As a result, the driver must poll for
> > temperature
> > changes to detect when the conditions for a thermal trip are no longer
> > met. However, it only does so if the DT enables polling.
> >
> > Before this patch, the RK1 DT did not enable polling, causing the fan
> > to
> > continue running at the speed corresponding to the highest temperature
> > reached.
> >
> > Follow suit with similar RK3588 boards by setting a polling-delay of
> > 1000ms, enabling the driver to detect when the sensor cools back off,
> > allowing the fan speed to decrease as appropriate.
> >
> > Fixes: 7c8ec5e6b9d6 ("arm64: dts: rockchip: Enable automatic fan
> > control on Turing RK1")
> > Signed-off-by: Sam Edwards <CFSworks@...il.com>
> > ---
> >  arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi
> > b/arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi
> > index 6bc46734cc14..0270bffce195 100644
> > --- a/arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi
> > +++ b/arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi
> > @@ -214,6 +214,8 @@ rgmii_phy: ethernet-phy@1 {
> >  };
> >
> >  &package_thermal {
> > +     polling-delay = <1000>;
> > +
> >       trips {
> >               package_active1: trip-active1 {
> >                       temperature = <45000>;
>
> Thanks for the patch, it's looking good to me, with some related
> thoughts below.  Please, feel free to include:
>
> Reviewed-by: Dragan Simic <dsimic@...jaro.org>
>
> After a quick look at the RK3588 TRM Part 1, it seems possible
> to actually generate additional interrupts when the TSADC channel
> temperature readouts reach predefined low thresholds.  Moreover,

Hi Dragan,

Ooh, I see that now!

It seems to be as simple as adding a `.set_cooloff_temp = ...` that
writes the lower thresholds to TSADC_COMP#_LOW_INT and sets the
necessary bits in TSADC_LT_EN+TSADC_LT_INT_EN. Since the driver
already rescans all temperatures on any interrupt and acknowledges all
interrupt status bits indiscriminately, I don't anticipate any other
necessary changes.

I can easily take care of that this weekend or next if that plan
sounds good to you. However, since *this* patch is a Fixes:, I'd
rather land it as-is first and handle the above separately. :)

> avoiding the polling would actually help the SoC cool down a tiny
> bit faster, which makes it worth detailed investigation in my book,
> despite not being used by the downstream kernel code.

Do you mean "spin down the fan a tiny bit faster" (since it would
detect the cool-off without needing to poll for it), or are you
emphasizing saving CPU cycles that would otherwise be spent polling?

Thanks for the tip,
Sam

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ