* [PATCH] hwmon: (mcp9982) Propagate one-shot polling errors
@ 2026-08-19 18:07 Nikhil Gurudasani
2026-08-19 18:12 ` sashiko-bot
2026-08-19 20:34 ` Guenter Roeck
0 siblings, 2 replies; 3+ messages in thread
From: Nikhil Gurudasani @ 2026-08-19 18:07 UTC (permalink / raw)
To: Victor Duicu, Guenter Roeck; +Cc: linux-hwmon, linux-kernel
When a device is in standby, the driver starts a one-shot conversion and
polls the BUSY flag before reading temperature, alarm, or fault data.
The poll result is currently ignored. Therefore, a timeout or a
status-register read failure can be hidden by a later successful read,
causing stale data to be returned as valid.
Return the polling error before reading the requested attribute.
Fixes: e2fe950f34e5 ("hwmon: add support for MCP998X")
Cc: stable@vger.kernel.org
Signed-off-by: Nikhil Gurudasani <nikhilgurudasani314@gmail.com>
---
drivers/hwmon/mcp9982.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hwmon/mcp9982.c b/drivers/hwmon/mcp9982.c
index 9e19e2697e25..3918dc36c946 100644
--- a/drivers/hwmon/mcp9982.c
+++ b/drivers/hwmon/mcp9982.c
@@ -395,6 +395,8 @@ static int mcp9982_read(struct device *dev, enum hwmon_sensor_types type, u32 at
reg_status, !(reg_status & MCP9982_STATUS_BUSY),
MCP9982_WAKE_UP_TIME_US,
MCP9982_WAKE_UP_TIME_US * 10);
+ if (ret)
+ return ret;
break;
}
break;
base-commit: f7c9176d2326eacae3a87fa3f5214a78c818cc07
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] hwmon: (mcp9982) Propagate one-shot polling errors
2026-08-19 18:07 [PATCH] hwmon: (mcp9982) Propagate one-shot polling errors Nikhil Gurudasani
@ 2026-08-19 18:12 ` sashiko-bot
2026-08-19 20:34 ` Guenter Roeck
1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-08-19 18:12 UTC (permalink / raw)
To: Nikhil Gurudasani; +Cc: linux-hwmon
> When a device is in standby, the driver starts a one-shot conversion and
> polls the BUSY flag before reading temperature, alarm, or fault data.
> The poll result is currently ignored. Therefore, a timeout or a
> status-register read failure can be hidden by a later successful read,
> causing stale data to be returned as valid.
>
> Return the polling error before reading the requested attribute.
>
> Fixes: e2fe950f34e5 ("hwmon: add support for MCP998X")
> Cc: stable@vger.kernel.org
> Signed-off-by: Nikhil Gurudasani <nikhilgurudasani314@gmail.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260819180701.34797-1-nikhilgurudasani314@gmail.com?part=1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hwmon: (mcp9982) Propagate one-shot polling errors
2026-08-19 18:07 [PATCH] hwmon: (mcp9982) Propagate one-shot polling errors Nikhil Gurudasani
2026-08-19 18:12 ` sashiko-bot
@ 2026-08-19 20:34 ` Guenter Roeck
1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2026-08-19 20:34 UTC (permalink / raw)
To: Nikhil Gurudasani; +Cc: Victor Duicu, linux-hwmon, linux-kernel
On Wed, Aug 19, 2026 at 11:37:01PM +0530, Nikhil Gurudasani wrote:
> When a device is in standby, the driver starts a one-shot conversion and
> polls the BUSY flag before reading temperature, alarm, or fault data.
> The poll result is currently ignored. Therefore, a timeout or a
> status-register read failure can be hidden by a later successful read,
> causing stale data to be returned as valid.
>
> Return the polling error before reading the requested attribute.
>
> Fixes: e2fe950f34e5 ("hwmon: add support for MCP998X")
> Cc: stable@vger.kernel.org
> Signed-off-by: Nikhil Gurudasani <nikhilgurudasani314@gmail.com>
Applied.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-19 20:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-19 18:07 [PATCH] hwmon: (mcp9982) Propagate one-shot polling errors Nikhil Gurudasani
2026-08-19 18:12 ` sashiko-bot
2026-08-19 20:34 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox