Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: lee@kernel.org, "Rafael J. Wysocki" <rafael@kernel.org>,
	Daniel Lezcano <daniel.lezcano@kernel.org>,
	Zhang Rui <rui.zhang@intel.com>,
	Lukasz Luba <lukasz.luba@arm.com>, Frank Li <Frank.Li@nxp.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>, Peng Fan <peng.fan@nxp.com>,
	Pengfei Li <pengfei.li_1@nxp.com>,
	linux-pm@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH 10/10] thermal/drivers/imx91: Use pm_runtime_resume_and_get() in imx91_tmu_change_mode()
Date: Thu,  3 Dec 2026 19:54:21 +0000	[thread overview]
Message-ID: <20261203195529.3063246-11-lee@kernel.org> (raw)
In-Reply-To: <20261203195529.3063246-1-lee@kernel.org>

When enabling the thermal zone, imx91_tmu_change_mode() calls
asynchronous pm_runtime_get() and immediately writes TMU control
registers before the device has resumed and enabled its clock.  On
error, it also returns without dropping the incremented runtime PM
usage count.

Use synchronous pm_runtime_resume_and_get() instead.

Fixes: c411d8bf0699 ("thermal/drivers/imx91: Add support for i.MX91 thermal monitoring unit")
Closes: https://sashiko.dev/#/bug/linux-c0418783-a24c-4ee1-a794-72b47eb4dfce
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
 drivers/thermal/imx91_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/imx91_thermal.c b/drivers/thermal/imx91_thermal.c
index c3a72df665a8..dbd45a1910f5 100644
--- a/drivers/thermal/imx91_thermal.c
+++ b/drivers/thermal/imx91_thermal.c
@@ -213,7 +213,7 @@ static int imx91_tmu_change_mode(struct thermal_zone_device *tz, enum thermal_de
 	int ret;
 
 	if (mode == THERMAL_DEVICE_ENABLED) {
-		ret = pm_runtime_get(tmu->dev);
+		ret = pm_runtime_resume_and_get(tmu->dev);
 		if (ret < 0)
 			return ret;
 
-- 
2.56.1.911.g883d8bcb20-goog


  parent reply	other threads:[~2026-12-03 19:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 19:54 [PATCH 00/10] thermal: Fix Critical and High issues reported by Sashiko Lee Jones
2026-12-03 19:54 ` [PATCH 07/10] thermal/drivers/imx91: Acquire runtime PM reference in imx91_tmu_get_temp() Lee Jones
2026-12-03 20:11   ` sashiko-bot
2026-12-03 20:34     ` Frank Li
2026-12-03 19:54 ` Lee Jones [this message]
2026-12-03 20:21   ` [PATCH 10/10] thermal/drivers/imx91: Use pm_runtime_resume_and_get() in imx91_tmu_change_mode() Frank 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=20261203195529.3063246-11-lee@kernel.org \
    --to=lee@kernel.org \
    --cc=Frank.Li@nxp.com \
    --cc=daniel.lezcano@kernel.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=peng.fan@nxp.com \
    --cc=pengfei.li_1@nxp.com \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=s.hauer@pengutronix.de \
    --cc=stable@vger.kernel.org \
    /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