Skip to contentSkip to conversation

hwmon: (scpi) skip unsupported sensors properly

PATCH Superseded Sudeep Holla 3 participants 8 messages Oct 28, 2015 – Nov 16, 2015 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (scpi) skip unsupported sensors properly

Currently it's assumed that firmware exports only the class of sensors supported by the driver. However with newer firmware or SCPI protocol revision, support for newer classes of sensors can be present.

The driver fails to probe with the following warning if an unsupported class of sensor is encountered in the firmware.

sysfs: cannot create duplicate filename
'/devices/platform/scpi/scpi:sensors/hwmon/hwmon0/'

------------[ cut here ]------------
WARNING: at fs/sysfs/dir.c:31
Modules linked in:

CPU: 0 PID: 6 Comm: kworker/u12:0 Not tainted 4.3.0-rc7 #137
Hardware name: ARM Juno development board (r0) (DT)
Workqueue: deferwq deferred_probe_work_func
PC is at sysfs_warn_dup+0x54/0x78
LR is at sysfs_warn_dup+0x54/0x78

This patch fixes the above issue by skipping through the unsupported class of SCPI sensors.

Fixes 68acc77a2d51 ("hwmon: Support thermal zones registration for SCP temperature sensors")
Fixes ea98b29a05e9 ("hwmon: Support sensors exported via ARM SCP interface")
Cc Punit Agrawal <[email protected]>
Cc Guenter Roeck <[email protected]>
---
 drivers/hwmon/scpi-hwmon.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/hwmon/scpi-hwmon.c +11 -10
index 2c1241bbf9af..5b80cd7f5c86 100644
@@ -117,7 +117,7 @@ static int scpi_hwmon_probe(struct platform_device *pdev)
 	struct scpi_ops *scpi_ops;
 	struct device *hwdev, *dev = &pdev->dev;
 	struct scpi_sensors *scpi_sensors;
-	int ret;
+	int ret, idx;
 
 	scpi_ops = get_scpi_ops();
 	if (!scpi_ops)
@@ -146,8 +146,8 @@ static int scpi_hwmon_probe(struct platform_device *pdev)
 
 	scpi_sensors->scpi_ops = scpi_ops;
 
-	for (i = 0; i < nr_sensors; i++) {
-		struct sensor_data *sensor = &scpi_sensors->data[i];
+	for (i = 0, idx = 0; i < nr_sensors; i++) {
+		struct sensor_data *sensor = &scpi_sensors->data[idx];
 
 		ret = scpi_ops->sensor_get_info(i, &sensor->info);
 		if (ret)
@@ -183,7 +183,7 @@ static int scpi_hwmon_probe(struct platform_device *pdev)
 			num_power++;
 			break;
 		default:
-			break;
+			continue;
 		}
 
 		sensor->dev_attr_input.attr.mode = S_IRUGO;
@@ -194,11 +194,12 @@ static int scpi_hwmon_probe(struct platform_device *pdev)
 		sensor->dev_attr_label.show = scpi_show_label;
 		sensor->dev_attr_label.attr.name = sensor->label;
 
-		scpi_sensors->attrs[i << 1] = &sensor->dev_attr_input.attr;
-		scpi_sensors->attrs[(i << 1) + 1] = &sensor->dev_attr_label.attr;
+		scpi_sensors->attrs[idx << 1] = &sensor->dev_attr_input.attr;
+		scpi_sensors->attrs[(idx << 1) + 1] = &sensor->dev_attr_label.attr;
 
-		sysfs_attr_init(scpi_sensors->attrs[i << 1]);
-		sysfs_attr_init(scpi_sensors->attrs[(i << 1) + 1]);
+		sysfs_attr_init(scpi_sensors->attrs[idx << 1]);
+		sysfs_attr_init(scpi_sensors->attrs[(idx << 1) + 1]);
+		idx++;
 	}
 
 	scpi_sensors->group.attrs = scpi_sensors->attrs;
@@ -234,9 +235,9 @@ static int scpi_hwmon_probe(struct platform_device *pdev)
 			goto unregister_tzd;
 		}
 
-		zone->sensor_id = i;
+		zone->sensor_id = sensor->info.sensor_id;
 		zone->scpi_sensors = scpi_sensors;
-		zone->tzd = thermal_zone_of_sensor_register(dev, i, zone,
+		zone->tzd = thermal_zone_of_sensor_register(dev, zone->sensor_id, zone,
 							    &scpi_sensor_ops);
 		/*
 		 * The call to thermal_zone_of_sensor_register returns

--
1.9.1

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

Reviewed-by on v1 1/1
#1 lore raw

Hi Sudeep,

Quoted 9 lines · Sudeep Holla

Currently it's assumed that firmware exports only the class of sensors supported by the driver. However with newer firmware or SCPI protocol revision, support for newer classes of sensors can be present.

The driver fails to probe with the following warning if an unsupported class of sensor is encountered in the firmware.

sysfs: cannot create duplicate filename
'/devices/platform/scpi/scpi:sensors/hwmon/hwmon0/'

Quoted 10 lines
------------[ cut here ]------------
WARNING: at fs/sysfs/dir.c:31
Modules linked in:

CPU: 0 PID: 6 Comm: kworker/u12:0 Not tainted 4.3.0-rc7 #137
Hardware name: ARM Juno development board (r0) (DT)
Workqueue: deferwq deferred_probe_work_func
PC is at sysfs_warn_dup+0x54/0x78
LR is at sysfs_warn_dup+0x54/0x78

Thanks for spotting the issue and the fix below. Some comments below.

Quoted 18 lines

This patch fixes the above issue by skipping through the unsupported class of SCPI sensors.

Fixes 68acc77a2d51 ("hwmon: Support thermal zones registration for SCP temperature sensors")
Fixes ea98b29a05e9 ("hwmon: Support sensors exported via ARM SCP interface")
Cc Punit Agrawal <[email protected]>
Cc Guenter Roeck <[email protected]>
---
 drivers/hwmon/scpi-hwmon.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/hwmon/scpi-hwmon.c +0 -0
index 2c1241bbf9af..5b80cd7f5c86 100644

[...]

drivers/hwmon/scpi-hwmon.c static int scpi_hwmon_probe(struct platform_device *pdev) · line 238

Quoted 6 lines
drivers/hwmon/scpi-hwmon.c +1 -1
@@ -234,9 +235,9 @@ static int scpi_hwmon_probe(struct platform_device *pdev)
 			goto unregister_tzd;
 		}
 
-		zone->sensor_id = i;
+		zone->sensor_id = sensor->info.sensor_id;

This shouldn't be changed . The zone->sensor_id is used to access the sensor data in scpi_read_temp and will use the wrong index with the above change. Which means...

drivers/hwmon/scpi-hwmon.c static int scpi_hwmon_probe(struct platform_device *pdev) · line 241

Quoted 4 lines
drivers/hwmon/scpi-hwmon.c +1 -1
 		zone->scpi_sensors = scpi_sensors;
-		zone->tzd = thermal_zone_of_sensor_register(dev, i, zone,
+		zone->tzd = thermal_zone_of_sensor_register(dev, zone->sensor_id, zone,
 							    &scpi_sensor_ops);

... the thermal zone registration should use sensor->info.sensor_id instead of zone->sensor_id.

With these two changes, feel free to add

Quoted 10 lines
drivers/hwmon/scpi-hwmon.c +0 -1
 		/*
 		 * The call to thermal_zone_of_sensor_register returns
--

1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#2 lore raw
Quoted 52 lines · Punit Agrawal

Hi Sudeep,

Quoted 9 lines · Sudeep Holla

Currently it's assumed that firmware exports only the class of sensors supported by the driver. However with newer firmware or SCPI protocol revision, support for newer classes of sensors can be present.

The driver fails to probe with the following warning if an unsupported class of sensor is encountered in the firmware.

sysfs: cannot create duplicate filename
'/devices/platform/scpi/scpi:sensors/hwmon/hwmon0/'

Quoted 10 lines
------------[ cut here ]------------
WARNING: at fs/sysfs/dir.c:31
Modules linked in:

CPU: 0 PID: 6 Comm: kworker/u12:0 Not tainted 4.3.0-rc7 #137
Hardware name: ARM Juno development board (r0) (DT)
Workqueue: deferwq deferred_probe_work_func
PC is at sysfs_warn_dup+0x54/0x78
LR is at sysfs_warn_dup+0x54/0x78

Thanks for spotting the issue and the fix below. Some comments below.

Quoted 18 lines

This patch fixes the above issue by skipping through the unsupported class of SCPI sensors.

Fixes 68acc77a2d51 ("hwmon: Support thermal zones registration for SCP temperature sensors")
Fixes ea98b29a05e9 ("hwmon: Support sensors exported via ARM SCP interface")
Cc Punit Agrawal <[email protected]>
Cc Guenter Roeck <[email protected]>
---
  drivers/hwmon/scpi-hwmon.c | 21 +++++++++++----------
  1 file changed, 11 insertions(+), 10 deletions(-)
drivers/hwmon/scpi-hwmon.c +0 -0
index 2c1241bbf9af..5b80cd7f5c86 100644

[...]

Quoted 4 lines
drivers/hwmon/scpi-hwmon.c +0 -0
@@ -234,9 +235,9 @@ static int scpi_hwmon_probe(struct platform_device *pdev)
  			goto unregister_tzd;
  		}
 
Quoted 7 lines

drivers/hwmon/scpi-hwmon.c static int scpi_hwmon_probe(struct platform_device *pdev) · line 238

Quoted 2 lines
drivers/hwmon/scpi-hwmon.c +1 -1
-		zone->sensor_id = i;
+		zone->sensor_id = sensor->info.sensor_id;

This shouldn't be changed . The zone->sensor_id is used to access the sensor data in scpi_read_temp and will use the wrong index with the above change. Which means...

Ah, right thanks for spotting this.

Quoted 11 lines

drivers/hwmon/scpi-hwmon.c static int scpi_hwmon_probe(struct platform_device *pdev) · line 241

Quoted 4 lines
drivers/hwmon/scpi-hwmon.c +1 -1
  		zone->scpi_sensors = scpi_sensors;
-		zone->tzd = thermal_zone_of_sensor_register(dev, i, zone,
+		zone->tzd = thermal_zone_of_sensor_register(dev, zone->sensor_id, zone,
  							    &scpi_sensor_ops);

... the thermal zone registration should use sensor->info.sensor_id instead of zone->sensor_id.

With these two changes, feel free to add

Will update the patch with these 2 changes and resend. Thanks for the review.

Signature · 7 lines
Regards,
Sudeep

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#3 lore raw

PATCH v2 1/1 hwmon: (scpi) skip unsupported sensors properly

In reply to Sudeep Holla

Currently it's assumed that firmware exports only the class of sensors supported by the driver. However with newer firmware or SCPI protocol revision, support for newer classes of sensors can be present.

The driver fails to probe with the following warning if an unsupported class of sensor is encountered in the firmware.

sysfs: cannot create duplicate filename
'/devices/platform/scpi/scpi:sensors/hwmon/hwmon0/'

------------[ cut here ]------------
WARNING: at fs/sysfs/dir.c:31
Modules linked in:

CPU: 0 PID: 6 Comm: kworker/u12:0 Not tainted 4.3.0-rc7 #137
Hardware name: ARM Juno development board (r0) (DT)
Workqueue: deferwq deferred_probe_work_func
PC is at sysfs_warn_dup+0x54/0x78
LR is at sysfs_warn_dup+0x54/0x78

This patch fixes the above issue by skipping through the unsupported class of SCPI sensors.

Fixes 68acc77a2d51 ("hwmon: Support thermal zones registration for SCP temperature sensors")
Fixes ea98b29a05e9 ("hwmon: Support sensors exported via ARM SCP interface")
Cc Guenter Roeck <[email protected]>
---
 drivers/hwmon/scpi-hwmon.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

Hi Guenter,

Either me/Punit will need ping you once the original driver is merged via arm-soc so that you can pick this after that. Alternatively we can push it via arm-soc but I wouldn't rush for that as it's not that urgent. Is that fine with you ?

Regards,
Sudeep

drivers/hwmon/scpi-hwmon.c +11 -10
index 2c1241bbf9af..7e20567bc369 100644
@@ -117,7 +117,7 @@ static int scpi_hwmon_probe(struct platform_device *pdev)
 	struct scpi_ops *scpi_ops;
 	struct device *hwdev, *dev = &pdev->dev;
 	struct scpi_sensors *scpi_sensors;
-	int ret;
+	int ret, idx;
 
 	scpi_ops = get_scpi_ops();
 	if (!scpi_ops)
@@ -146,8 +146,8 @@ static int scpi_hwmon_probe(struct platform_device *pdev)
 
 	scpi_sensors->scpi_ops = scpi_ops;
 
-	for (i = 0; i < nr_sensors; i++) {
-		struct sensor_data *sensor = &scpi_sensors->data[i];
+	for (i = 0, idx = 0; i < nr_sensors; i++) {
+		struct sensor_data *sensor = &scpi_sensors->data[idx];
 
 		ret = scpi_ops->sensor_get_info(i, &sensor->info);
 		if (ret)
@@ -183,7 +183,7 @@ static int scpi_hwmon_probe(struct platform_device *pdev)
 			num_power++;
 			break;
 		default:
-			break;
+			continue;
 		}
 
 		sensor->dev_attr_input.attr.mode = S_IRUGO;
@@ -194,11 +194,12 @@ static int scpi_hwmon_probe(struct platform_device *pdev)
 		sensor->dev_attr_label.show = scpi_show_label;
 		sensor->dev_attr_label.attr.name = sensor->label;
 
-		scpi_sensors->attrs[i << 1] = &sensor->dev_attr_input.attr;
-		scpi_sensors->attrs[(i << 1) + 1] = &sensor->dev_attr_label.attr;
+		scpi_sensors->attrs[idx << 1] = &sensor->dev_attr_input.attr;
+		scpi_sensors->attrs[(idx << 1) + 1] = &sensor->dev_attr_label.attr;
 
-		sysfs_attr_init(scpi_sensors->attrs[i << 1]);
-		sysfs_attr_init(scpi_sensors->attrs[(i << 1) + 1]);
+		sysfs_attr_init(scpi_sensors->attrs[idx << 1]);
+		sysfs_attr_init(scpi_sensors->attrs[(idx << 1) + 1]);
+		idx++;
 	}
 
 	scpi_sensors->group.attrs = scpi_sensors->attrs;
@@ -236,8 +237,8 @@ static int scpi_hwmon_probe(struct platform_device *pdev)
 
 		zone->sensor_id = i;
 		zone->scpi_sensors = scpi_sensors;
-		zone->tzd = thermal_zone_of_sensor_register(dev, i, zone,
-							    &scpi_sensor_ops);
+		zone->tzd = thermal_zone_of_sensor_register(dev,
+				sensor->info.sensor_id, zone, &scpi_sensor_ops);
 		/*
 		 * The call to thermal_zone_of_sensor_register returns
 		 * an error for sensors that are not associated with

--
1.9.1

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

maintainer Acked-by on v2 1/1
#4 lore raw
Quoted 19 lines · Sudeep Holla

Currently it's assumed that firmware exports only the class of sensors supported by the driver. However with newer firmware or SCPI protocol revision, support for newer classes of sensors can be present.

The driver fails to probe with the following warning if an unsupported class of sensor is encountered in the firmware.

sysfs: cannot create duplicate filename
'/devices/platform/scpi/scpi:sensors/hwmon/hwmon0/'

------------[ cut here ]------------
WARNING: at fs/sysfs/dir.c:31
Modules linked in:

CPU: 0 PID: 6 Comm: kworker/u12:0 Not tainted 4.3.0-rc7 #137
Hardware name: ARM Juno development board (r0) (DT)
Workqueue: deferwq deferred_probe_work_func
PC is at sysfs_warn_dup+0x54/0x78
LR is at sysfs_warn_dup+0x54/0x78
Quoted 8 lines

This patch fixes the above issue by skipping through the unsupported class of SCPI sensors.

Fixes 68acc77a2d51 ("hwmon: Support thermal zones registration for SCP temperature sensors")
Fixes ea98b29a05e9 ("hwmon: Support sensors exported via ARM SCP interface")
Cc Guenter Roeck <[email protected]>
Quoted 11 lines
---
 drivers/hwmon/scpi-hwmon.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

Hi Guenter,

Either me/Punit will need ping you once the original driver is merged via arm-soc so that you can pick this after that. Alternatively we can push it via arm-soc but I wouldn't rush for that as it's not that urgent. Is that fine with you ?

Either way is fine with me.

Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#5 lore raw

Hi Guenter,

Quoted 35 lines · Guenter Roeck
Quoted 19 lines · Sudeep Holla

Currently it's assumed that firmware exports only the class of sensors supported by the driver. However with newer firmware or SCPI protocol revision, support for newer classes of sensors can be present.

The driver fails to probe with the following warning if an unsupported class of sensor is encountered in the firmware.

sysfs: cannot create duplicate filename
'/devices/platform/scpi/scpi:sensors/hwmon/hwmon0/'

------------[ cut here ]------------
WARNING: at fs/sysfs/dir.c:31
Modules linked in:

CPU: 0 PID: 6 Comm: kworker/u12:0 Not tainted 4.3.0-rc7 #137
Hardware name: ARM Juno development board (r0) (DT)
Workqueue: deferwq deferred_probe_work_func
PC is at sysfs_warn_dup+0x54/0x78
LR is at sysfs_warn_dup+0x54/0x78
Quoted 8 lines

This patch fixes the above issue by skipping through the unsupported class of SCPI sensors.

Fixes 68acc77a2d51 ("hwmon: Support thermal zones registration for SCP temperature sensors")
Fixes ea98b29a05e9 ("hwmon: Support sensors exported via ARM SCP interface")
Cc Guenter Roeck <[email protected]>
Quoted 4 lines
---
 drivers/hwmon/scpi-hwmon.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)
Quoted 8 lines
Quoted 7 lines

Hi Guenter,

Either me/Punit will need ping you once the original driver is merged via arm-soc so that you can pick this after that. Alternatively we can push it via arm-soc but I wouldn't rush for that as it's not that urgent. Is that fine with you ?

Either way is fine with me.

Now that rc1 is tagged, could you please pick this fix? It makes the driver more robust when faced with changes to the firmware interface.

Quoted 7 lines

Guenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

maintainer
#6 lore raw
In reply to Sudeep Holla
Quoted 22 lines · Sudeep Holla

Currently it's assumed that firmware exports only the class of sensors supported by the driver. However with newer firmware or SCPI protocol revision, support for newer classes of sensors can be present.

The driver fails to probe with the following warning if an unsupported class of sensor is encountered in the firmware.

sysfs: cannot create duplicate filename
'/devices/platform/scpi/scpi:sensors/hwmon/hwmon0/'

------------[ cut here ]------------
WARNING: at fs/sysfs/dir.c:31
Modules linked in:

CPU: 0 PID: 6 Comm: kworker/u12:0 Not tainted 4.3.0-rc7 #137
Hardware name: ARM Juno development board (r0) (DT)
Workqueue: deferwq deferred_probe_work_func
PC is at sysfs_warn_dup+0x54/0x78
LR is at sysfs_warn_dup+0x54/0x78

This patch fixes the above issue by skipping through the unsupported class of SCPI sensors.

Quoted 6 lines
Fixes 68acc77a2d51 ("hwmon: Support thermal zones registration for SCP temperature sensors")
Fixes ea98b29a05e9 ("hwmon: Support sensors exported via ARM SCP interface")
Cc Guenter Roeck <[email protected]>

In the assumption that this patch can now be applied, I queued it up for the next -rc.

Guenter

Quoted 68 lines
---
 drivers/hwmon/scpi-hwmon.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

Hi Guenter,

Either me/Punit will need ping you once the original driver is merged via arm-soc so that you can pick this after that. Alternatively we can push it via arm-soc but I wouldn't rush for that as it's not that urgent. Is that fine with you ?

Regards,
Sudeep

--
1.9.1

drivers/hwmon/scpi-hwmon.c +9 -8
index 2c1241bbf9af..7e20567bc369 100644
@@ -117,7 +117,7 @@ static int scpi_hwmon_probe(struct platform_device *pdev)
 	struct scpi_ops *scpi_ops;
 	struct device *hwdev, *dev = &pdev->dev;
 	struct scpi_sensors *scpi_sensors;
-	int ret;
+	int ret, idx;
 
 	scpi_ops = get_scpi_ops();
 	if (!scpi_ops)
@@ -146,8 +146,8 @@ static int scpi_hwmon_probe(struct platform_device *pdev)
 
 	scpi_sensors->scpi_ops = scpi_ops;
 
-	for (i = 0; i < nr_sensors; i++) {
-		struct sensor_data *sensor = &scpi_sensors->data[i];
+	for (i = 0, idx = 0; i < nr_sensors; i++) {
+		struct sensor_data *sensor = &scpi_sensors->data[idx];
 
 		ret = scpi_ops->sensor_get_info(i, &sensor->info);
 		if (ret)
@@ -183,7 +183,7 @@ static int scpi_hwmon_probe(struct platform_device *pdev)
 			num_power++;
 			break;
 		default:
-			break;
+			continue;
 		}
 
 		sensor->dev_attr_input.attr.mode = S_IRUGO;
@@ -194,11 +194,12 @@ static int scpi_hwmon_probe(struct platform_device *pdev)
 		sensor->dev_attr_label.show = scpi_show_label;
 		sensor->dev_attr_label.attr.name = sensor->label;
 
-		scpi_sensors->attrs[i << 1] = &sensor->dev_attr_input.attr;
-		scpi_sensors->attrs[(i << 1) + 1] = &sensor->dev_attr_label.attr;
+		scpi_sensors->attrs[idx << 1] = &sensor->dev_attr_input.attr;
+		scpi_sensors->attrs[(idx << 1) + 1] = &sensor->dev_attr_label.attr;
 
-		sysfs_attr_init(scpi_sensors->attrs[i << 1]);
-		sysfs_attr_init(scpi_sensors->attrs[(i << 1) + 1]);
+		sysfs_attr_init(scpi_sensors->attrs[idx << 1]);
+		sysfs_attr_init(scpi_sensors->attrs[(idx << 1) + 1]);
+		idx++;
 	}
 
 	scpi_sensors->group.attrs = scpi_sensors->attrs;

drivers/hwmon/scpi-hwmon.c static int scpi_hwmon_probe(struct platform_device *pdev) · line 244

Quoted 10 lines
drivers/hwmon/scpi-hwmon.c +2 -2
@@ -236,8 +237,8 @@ static int scpi_hwmon_probe(struct platform_device *pdev)
 
 		zone->sensor_id = i;
 		zone->scpi_sensors = scpi_sensors;
-		zone->tzd = thermal_zone_of_sensor_register(dev, i, zone,
-							    &scpi_sensor_ops);
+		zone->tzd = thermal_zone_of_sensor_register(dev,
+				sensor->info.sensor_id, zone, &scpi_sensor_ops);
 		/*
 		 * The call to thermal_zone_of_sensor_register returns
 		 * an error for sensors that are not associated with

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#7 lore raw
Quoted 30 lines · Guenter Roeck
Quoted 22 lines · Sudeep Holla

Currently it's assumed that firmware exports only the class of sensors supported by the driver. However with newer firmware or SCPI protocol revision, support for newer classes of sensors can be present.

The driver fails to probe with the following warning if an unsupported class of sensor is encountered in the firmware.

sysfs: cannot create duplicate filename
'/devices/platform/scpi/scpi:sensors/hwmon/hwmon0/'

------------[ cut here ]------------
WARNING: at fs/sysfs/dir.c:31
Modules linked in:

CPU: 0 PID: 6 Comm: kworker/u12:0 Not tainted 4.3.0-rc7 #137
Hardware name: ARM Juno development board (r0) (DT)
Workqueue: deferwq deferred_probe_work_func
PC is at sysfs_warn_dup+0x54/0x78
LR is at sysfs_warn_dup+0x54/0x78

This patch fixes the above issue by skipping through the unsupported class of SCPI sensors.

Quoted 6 lines
Fixes 68acc77a2d51 ("hwmon: Support thermal zones registration for SCP temperature sensors")
Fixes ea98b29a05e9 ("hwmon: Support sensors exported via ARM SCP interface")
Cc Guenter Roeck <[email protected]>
Quoted 2 lines

In the assumption that this patch can now be applied, I queued it up for the next -rc.

Looks like our emails crossed on the wire. :)

Thanks for applying the patch.

Punit

Quoted 7 lines

Guenter

Quoted 4 lines
---
 drivers/hwmon/scpi-hwmon.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

[...]

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors