[PATCH 07/15] thermal/drivers/samsung: acpm-tmu: Return -ENODATA when sensor is disabled
Tudor Ambarus
tudor.ambarus at linaro.org
Mon Oct 26 09:01:24 PDT 2026
In the thermal core, returning -EAGAIN from .get_temp() instructs
__thermal_zone_device_update() -> thermal_zone_recheck() to schedule a
250 ms (4 Hz) retry loop with no backoff. If re-enabling a sensor fails
(for example on resume, or after an acpm_tmu_update_thresholds() failure
when polling is active), sensor->enabled remains false while tz->mode is
still THERMAL_DEVICE_ENABLED, causing an infinite 4 Hz retry loop
instead of backing off and disabling the broken zone via
thermal_zone_broken_disable(). In addition, hwmon's temp_input_show()
forwards -EAGAIN directly to userspace rather than -ENODATA.
Return -ENODATA instead of -EAGAIN when !sensor->enabled in
acpm_tmu_get_temp().
Fixes: 50a2c5d4062a ("thermal/drivers/samsung: Add Exynos ACPM TMU driver GS101")
Signed-off-by: Tudor Ambarus <tudor.ambarus at linaro.org>
---
drivers/thermal/samsung/acpm-tmu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/samsung/acpm-tmu.c b/drivers/thermal/samsung/acpm-tmu.c
index 4257bec802c1..1f56c69af76f 100644
--- a/drivers/thermal/samsung/acpm-tmu.c
+++ b/drivers/thermal/samsung/acpm-tmu.c
@@ -200,7 +200,7 @@ static int acpm_tmu_get_temp(struct thermal_zone_device *tz, int *temp)
* after PM resume.
*/
if (!sensor->enabled)
- return -EAGAIN;
+ return -ENODATA;
ret = pm_runtime_resume_and_get(dev);
if (ret < 0)
@@ -208,7 +208,7 @@ static int acpm_tmu_get_temp(struct thermal_zone_device *tz, int *temp)
scoped_guard(mutex, &sensor->lock) {
if (!sensor->enabled) {
- ret = -EAGAIN;
+ ret = -ENODATA;
} else {
ret = ops->read_temp(handle, priv->mbox_chan_id,
sensor->group->id, &acpm_temp);
--
2.56.0.257.gf7497c7d27-goog
More information about the linux-arm-kernel
mailing list