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] [day] [month] [year] [list]
Message-ID: <22c4fc5a-2634-4e14-a659-1a2a6329c7b3@notapiano>
Date: Thu, 16 Jan 2025 10:45:01 -0300
From: Nícolas F. R. A. Prado <nfraprado@...labora.com>
To: Daniel Lezcano <daniel.lezcano@...aro.org>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>,
	Zhang Rui <rui.zhang@...el.com>, Lukasz Luba <lukasz.luba@....com>,
	Matthias Brugger <matthias.bgg@...il.com>,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
	Alexandre Mergnat <amergnat@...libre.com>,
	Balsam CHIHI <bchihi@...libre.com>, kernel@...labora.com,
	linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	linux-mediatek@...ts.infradead.org,
	Hsin-Te Yuan <yuanhsinte@...omium.org>,
	Chen-Yu Tsai <wenst@...omium.org>,
	Bernhard Rosenkränzer <bero@...libre.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
	stable@...r.kernel.org
Subject: Re: [PATCH RESEND v2 3/5] thermal/drivers/mediatek/lvts: Disable low
 offset IRQ for minimum threshold

On Tue, Jan 14, 2025 at 07:30:31PM +0100, Daniel Lezcano wrote:
> On 13/01/2025 14:27, Nícolas F. R. A. Prado wrote:
> > In order to get working interrupts, a low offset value needs to be
> > configured. The minimum value for it is 20 Celsius, which is what is
> > configured when there's no lower thermal trip (ie the thermal core
> > passes -INT_MAX as low trip temperature). However, when the temperature
> > gets that low and fluctuates around that value it causes an interrupt
> > storm.
> 
> Is it really about an irq storm or about having a temperature threshold set
> close to the ambiant temperature. So leading to unnecessary wakeups as there
> is need for mitigation ?

Yes, that's what I mean. The irq threshold gets configured to 20C, so whenever
the temperature drops below that value, the IRQ gets triggered. But this usually
does not happen just once, because from the thermal frameworks' perspective,
there's no thermal threshold configured for 20C, since that's done from the
driver, the framework thinks it's -INT_MAX, so the threshold doesn't get moved
after the trigger and it just ends up triggering hundreds or thousands of times
in a short span of time, hence why I say it's an interrupt storm.

> 
> > Prevent that interrupt storm by not enabling the low offset interrupt if
> > the low threshold is the minimum one.
> 
> The case where the high threshold is the INT_MAX should be handled too. The
> system may have configured a thermal zone without critical trip points, so
> setting the next upper threshold will program the register with INT_MAX. I
> guess it is an undefined behavior in this case, right ?

Ah, yes, I don't think I've tested that before... I'll test it and send a fix if
needed.

Thanks,
Nícolas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ