mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yaohan Li <shunsheng1218@gmail.com>
To: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	"Daniel Lezcano" <daniel.lezcano@kernel.org>
Cc: Zhang Rui <rui.zhang@intel.com>,
	Lukasz Luba <lukasz.luba@arm.com>,
	Magnus Damm <magnus.damm@gmail.com>,
	linux-renesas-soc@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v4 0/3] thermal: rcar_gen3: fix the interrupt handler lifetimes
Date: Wed, 25 Nov 2026 11:03:24 +0800	[thread overview]
Message-ID: <20261125030327.953450-1-shunsheng1218@gmail.com> (raw)
In-Reply-To: <20261124095110.131258-1-shunsheng1218@gmail.com>

This series fixes the order in which rcar_gen3_thermal_probe() and
->remove() create and release the interrupt handlers and the thermal
zones.

Patch 1 moves an existing check; it stands alone.

Patch 2 releases the handlers from ->remove(), before the runtime PM
reference is dropped and before devres unregisters the zones, and
undoes a partial interrupt request instead of leaving the first handler
behind.

Patch 3 requests the interrupts with IRQF_NO_AUTOEN, initialises every
sensor before the request, and enables the interrupts and their sources
only once all the thermal zones are registered.

The driver keeps its ->remove() callback and the existing polling
fallback when an interrupt cannot be requested.

Changes in v4:
 - Split into three patches.
 - Keep ->remove() and release the handlers explicitly instead of
   handing the teardown to devres.
 - Request the interrupts with IRQF_NO_AUTOEN and enable them after the
   zones are registered.

Compile tested only: arm64, aarch64-linux-gnu-gcc 11.4,
CONFIG_ARCH_RENESAS and CONFIG_RCAR_GEN3_THERMAL.  No R-Car board was
available, so probe, the polling fallback, resume and teardown were not
exercised on hardware.

AI assistance: prepared with Claude (Anthropic) as a coding assistant; the
author reviewed the reasoning and takes responsibility for the content.

Yaohan Li (3):
  thermal: rcar_gen3: check for sensors before reading the fuses
  thermal: rcar_gen3: release the interrupt handlers from ->remove()
  thermal: rcar_gen3: do not enable the interrupts before the zones
    exist

 drivers/thermal/renesas/rcar_gen3_thermal.c | 96 +++++++++++++++------
 1 file changed, 72 insertions(+), 24 deletions(-)

-- 
2.34.1


  parent reply	other threads:[~2026-11-25  3:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 14:53 [PATCH] thermal: rcar_gen3: quiesce the interrupt source before releasing it Yaohan Li
2026-11-18  9:31 ` Niklas Söderlund
2026-11-19  2:29 ` [PATCH v2] thermal: rcar_gen3: release the IRQ handlers before the zones are freed Yaohan Li
2026-11-22 14:48   ` Niklas Söderlund
2026-11-23  2:21     ` Yaohan Li
2026-11-23  6:47       ` Niklas Söderlund
2026-11-24  2:22         ` Yaohan Li
2026-11-24  6:40           ` Niklas Söderlund
2026-11-24  9:51   ` [PATCH v3] thermal: rcar_gen3: register the interrupt handlers after the zones Yaohan Li
2026-11-24 13:15     ` Niklas Söderlund
2026-11-25  3:03     ` Yaohan Li [this message]
2026-11-25  3:03       ` [PATCH v4 1/3] thermal: rcar_gen3: check for sensors before reading the fuses Yaohan Li
2026-11-25  3:03       ` [PATCH v4 2/3] thermal: rcar_gen3: release the interrupt handlers from ->remove() Yaohan Li
2026-11-25  3:03       ` [PATCH v4 3/3] thermal: rcar_gen3: do not enable the interrupts before the zones exist Yaohan Li

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=20261125030327.953450-1-shunsheng1218@gmail.com \
    --to=shunsheng1218@gmail.com \
    --cc=daniel.lezcano@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=magnus.damm@gmail.com \
    --cc=niklas.soderlund@ragnatech.se \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.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®