From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796328678; b=zXtyjlT09c+Uf+spD6QKDoD78/BAuc4AMc2C6ze7L9819Pr9wRLIYQIGuDufpJeFNLt0 d+dRGeVxVtjn/kd8vTT+aIgsarRpwImYcIJGPY5448ZfP/EQSsHMXmtY4hN/XVQozWlFu BWKIenbXCUp+JT0lGV0Z+k5ta1XyTKq5hZXkj+zCuZQNeqsgt6CivS7mTnMx7DwdN+e4Q zu7oKLslYPkFelqbQslO1VhWol4rFp+r7/1/gNaf3g3Vm2nP/0+RAMSu4XHNEYA2ycYmV ZTF5j4eKgIzmmubMyAzj/yvG6O2xo8oDMIzXKI5G+9Ve6UfKFbeLQEO6tzz/QcHeruA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796328678; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=olZ4XQ69pb+dHaDmM1dgdVZMftPDc1H/zqOrLJObJ/A=; b=nKIxtMPtBsaKxfxC3okDxZWvG9C8eppe8SFGP5ki4IbLM96sa+ijCyCKhEgPYfKv5c10 eb8hG8rR0f+lX06Az3brhB1zGGsMAN8XUKyYYjabFi46BO+5nVKPe/667H/UgabiMdM4J VPV+SuoXVkv3qm4iEnePloYrdfWgFWNn/CDXLv2bQvfYaemvi+i/yxNmt7EEK8axPXIGy 1YMDvpiOdkGyI5A8ZGI2IripRroSiZumh+iLbAhnacukVmBWptmcV0/HezAhkzM/1nG98 VhbrfDNxfP7oFLmUCkcDRnqgfX7Djg2BMdFUVdzO/aLcYXJaRbamPFGrNFYfLZ7eSFQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dt4zFTWM; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86F12606A322 for ; Thu, 3 Dec 2026 20:11:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dt4zFTWM Received: by smtp.kernel.org (Postfix) with ESMTPSA id DEA4B1F00A0D; Thu, 3 Dec 2026 20:11:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796328678; bh=olZ4XQ69pb+dHaDmM1dgdVZMftPDc1H/zqOrLJObJ/A=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=dt4zFTWMvuWrHCcutPIZ7S5SZHeJmRCLOHo8kHuOGahpF/KFZ5DQ4FtyDLtdCLDDf SIkJqVvFoWkPiTVWlPyUvRoZBs7ikWIIvAr3nesfFKW6x5zfQG9L308F7mfINlVB4F z2Ad+zh2Z+KMZUvoumtTaagXQ8MtmwRsBuirSgmLFNv8E7eD1nTC0HYaTHsU1E57ho NLbND/JvPbQ+5waG1IzajaLPt8DcZTG7PWr7JMslb8JCGx19Rgp6V1Z9OvE820XzXm jlYA3NS63WbNKK98pq0R6V9jpsy/SI8q2fC+mys68ZMWHO4HAnJqTXXepzVnB/QtNu YgEZc088pfcIQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 07/10] thermal/drivers/imx91: Acquire runtime PM reference in imx91_tmu_get_temp() Reply-To: sashiko-reviews@lists.linux.dev To: "Lee Jones" , imx@lists.linux.dev Cc: Frank.Li@kernel.org In-Reply-To: <20261203195529.3063246-8-lee@kernel.org> References: <20261203195529.3063246-1-lee@kernel.org> <20261203195529.3063246-8-lee@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 20:11:17 +0000 X-Mailing-List: imx@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] thermal/imx91: imx91_tmu_get_temp() reads stale DATA0 when zone is disabled -- commit 6c2200e167fb50e996061c6b352e037ffc580431 Author: Lee Jones thermal/drivers/imx91: Acquire runtime PM reference in imx91_tmu_get_temp() This commit wraps the IMX91_TMU_DATA0 register read in imx91_tmu_get_temp() with pm_runtime_resume_and_get() and pm_runtime_put() to avoid unclocked register access when the thermal zone is disabled. > diff --git a/drivers/thermal/imx91_thermal.c b/drivers/thermal/imx91_ther= mal.c > index 6d0aba992244b..c3a72df665a81 100644 > --- a/drivers/thermal/imx91_thermal.c > +++ b/drivers/thermal/imx91_thermal.c > @@ -110,11 +110,18 @@ static int imx91_tmu_get_temp(struct thermal_zone_d= evice *tz, int *temp) > { > struct imx91_tmu *tmu =3D thermal_zone_device_priv(tz); > s16 data; > + int ret; > + > + ret =3D pm_runtime_resume_and_get(tmu->dev); > + if (ret < 0) > + return ret; > =20 > /* DATA0 is 16bit signed number */ > data =3D readw_relaxed(tmu->base + IMX91_TMU_DATA0); > *temp =3D imx91_tmu_to_mcelsius(data); > =20 > + pm_runtime_put(tmu->dev); > + > return 0; > } [Severity: Medium] Can this return stale temperature data from IMX91_TMU_DATA0 when the thermal zone is disabled? Disabling the zone in imx91_tmu_change_mode() stops measurements via imx91_tmu_start(tmu, false) before calling pm_runtime_put(). imx91_tmu_runtime_resume() only re-enables the clock and IMX91_TMU_CTRL1_EN, without starting a measurement or waiting for a conversion to complete. Reading sysfs temp while disabled then succeeds with whatever stale or zero value sits in IMX91_TMU_DATA0. Should imx91_tmu_get_temp() return -EAGAIN when the zone is disabled, or start a conversion and wait for data ready before reading? --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203195529.3063= 246-1-lee@kernel.org?part=3D7