All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hwmon: (scmi) Enable temperature sensors using their sensor IDs
@ 2026-11-09  8:28 raoxu
  2026-11-09  8:41 ` sashiko-bot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: raoxu @ 2026-11-09  8:28 UTC (permalink / raw)
  To: sudeep.holla
  Cc: linux, cristian.marussi, marek.vasut, arm-scmi, linux-arm-kernel,
	linux-hwmon, linux-kernel, raoxu

From: Xu Rao <raoxu@uniontech.com>

scmi_hwmon_probe() groups sensors by hwmon type, so the index in
scmi_sensors->info[hwmon_temp] is not necessarily the SCMI sensor ID.
Passing that index to config_set() targets a different sensor if the
platform exposes non-temperature sensors ahead of temperature sensors.
The intended temperature sensor can remain disabled, causing subsequent
readings to fail. If configuring the wrong sensor fails, thermal
registration of the intended sensor is also skipped.

Use the firmware sensor ID, as the read and thermal registration paths
already do, so temperature sensors are enabled correctly.

The patch was reviewed and the commit message expanded with OpenCode
AI assistance.

Fixes: 72804d1631b3 ("hwmon: (scmi) Enable sensors to assure they can be read")
Signed-off-by: Xu Rao <raoxu@uniontech.com>
---
 drivers/hwmon/scmi-hwmon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/scmi-hwmon.c b/drivers/hwmon/scmi-hwmon.c
index 9ae8f774297e..6a9895697f3c 100644
--- a/drivers/hwmon/scmi-hwmon.c
+++ b/drivers/hwmon/scmi-hwmon.c
@@ -342,7 +342,7 @@ static int scmi_hwmon_probe(struct scmi_device *sdev)
 		if (!sensor)
 			continue;
 
-		ret = sensor_ops->config_set(ph, i, sensor_config);
+		ret = sensor_ops->config_set(ph, sensor->id, sensor_config);
 		if (ret) {
 			dev_err(dev, "Error enabling sensor %s. err=%d\n",
 				sensor->name, ret);
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-09 15:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-09  8:28 [PATCH] hwmon: (scmi) Enable temperature sensors using their sensor IDs raoxu
2026-11-09  8:41 ` sashiko-bot
2026-11-09  9:40 ` Sudeep Holla
2026-11-09 15:56 ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.