mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Yaohan Li <shunsheng1218@gmail.com>
Cc: "Rafael J . Wysocki" <rafael@kernel.org>,
	 Daniel Lezcano <daniel.lezcano@kernel.org>,
	 Zhang Rui <rui.zhang@intel.com>,
	 Lukasz Luba <lukasz.luba@arm.com>,
	 Eduardo Valentin <edubezval@gmail.com>,
	linux-pm@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] thermal/drivers/armada: request the overheat IRQ before enabling the source
Date: Fri, 20 Nov 2026 09:27:46 +0100	[thread overview]
Message-ID: <87o6bjc3gd.fsf@bootlin.com> (raw)
In-Reply-To: <20261120042728.420697-1-shunsheng1218@gmail.com> (Yaohan Li's message of "Fri, 20 Nov 2026 12:27:28 +0800")

On 20/11/2026 at 12:27:28 +08, Yaohan Li <shunsheng1218@gmail.com> wrote:

> armada_thermal_probe() requests the overheat interrupt before it registers
> the thermal zones.  Devres releases resources in the reverse order, so the
> zones are unregistered first and the interrupt is freed afterwards: a
> handler that is still running, or that fires in the window between the
> two, passes a zone that has already been destroyed to
> thermal_zone_device_update().
>
> Request the interrupt after the zone loop instead.  The handler is then
> freed before the zones it updates, and the interrupt is only requested
> when a critical trip point was found, which is the only case in which the
> driver has an overheat source to enable.
>
> The interrupt stays optional, as before: apart from -EPROBE_DEFER, an
> unavailable or invalid IRQ number does not fail the probe, it only leaves
> the device without overheat interrupt handling.
>
> The source has to be enabled after the handler is registered, so
> armada_configure_overheat_int() only programs the thresholds now and
> armada_thermal_probe() enables the source once the request has succeeded.
> A failed request then cannot leave an interrupt enabled that nobody
> handles.
>
> The zones are now registered while the source is still masked, so the
> driver masks it at probe time on the variants that describe the overheat
> interrupt as a DFX cause: a firmware that left it enabled would otherwise
> raise an interrupt that nobody handles until the request below.  The mask
> is released when the request succeeds.
>
> ->remove() masks the source and sets a shutdown flag so that the poll loop
> gives up instead of keeping the removal blocked until the sensor cools
> down.
>
> Fixes: 879d7362d1d0 ("thermal: armada: add overheat interrupt support")
> Signed-off-by: Yaohan Li <shunsheng1218@gmail.com>

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

      reply	other threads:[~2026-11-20  8:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18  7:23 [PATCH] thermal/drivers/armada: free the overheat IRQ before the zones are gone Yaohan Li
2026-11-18  9:29 ` Miquel Raynal
2026-11-19  2:29 ` [PATCH v2] thermal/drivers/armada: request the overheat IRQ before enabling the source Yaohan Li
2026-11-19 11:11   ` Miquel Raynal
2026-11-20  4:27     ` [PATCH v3] " Yaohan Li
2026-11-20  8:27       ` Miquel Raynal [this message]

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=87o6bjc3gd.fsf@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=daniel.lezcano@kernel.org \
    --cc=edubezval@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=shunsheng1218@gmail.com \
    /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®