[PATCH] thermal/drivers/imx8mm: Keep the clock on until the zones are unregistered

Peng Fan (OSS) peng.fan at oss.nxp.com
Sun Nov 29 19:02:36 PST 2026


On Sun, 29 Nov 2026 11:31:13 +0400 Arina Kharlamova via B4 Relay <devnull+arina.kharlamova.mbzuai.ac.ae at kernel.org> wrote:

> From: Arina Kharlamova <arina.kharlamova at mbzuai.ac.ae>
> 
> The thermal zones are registered with devm_thermal_of_zone_register(),
> but the TMU clock is enabled by hand and disabled in remove(). devres
> unregisters the zones only after remove() has returned, so in that
> window the polling work or a sysfs read of the temperature can still
> call tmu_get_temp() and read TRITSR with the clock gated. The same
> happens on the probe error path after the zones are registered.
> 
> Get the clock with devm_clk_get_enabled(). It is acquired before the
> zones, so devres disables it after they are gone, and the manual
> disables in remove() and on the error path can go.
> 
> Fixes: 5eed800a6811 ("thermal: imx8mm: Add support for i.MX8MM thermal monitoring unit")
> Signed-off-by: Arina Kharlamova <arina.kharlamova at mbzuai.ac.ae>

Reviewed-by: Peng Fan <peng.fan at nxp.com>



More information about the linux-arm-kernel mailing list