From: Sudeep Holla <sudeep.holla@arm.com>
To: Punit Agrawal <punit.agrawal@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
linux-kernel@vger.kernel.org, Guenter Roeck <linux@roeck-us.net>,
lm-sensors@lm-sensors.org, Jean Delvare <jdelvare@suse.com>
Subject: Re: [lm-sensors] [PATCH] hwmon: (scpi) skip unsupported sensors properly
Date: Wed, 28 Oct 2015 15:58:47 +0000 [thread overview]
Message-ID: <5630F0B7.6010702@arm.com> (raw)
In-Reply-To: <9hhio5rato2.fsf@e105922-lin.cambridge.arm.com>
On 28/10/15 15:39, Punit Agrawal wrote:
> Hi Sudeep,
>
> Sudeep Holla <sudeep.holla@arm.com> writes:
>
>> 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
>>
>
> Thanks for spotting the issue and the fix below. Some comments below.
>
>
>> 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 <punit.agrawal@arm.com>
>> Cc: Guenter Roeck <linux@roeck-us.net>
>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>
>
>> ---
>> drivers/hwmon/scpi-hwmon.c | 21 +++++++++++----------
>> 1 file changed, 11 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/hwmon/scpi-hwmon.c b/drivers/hwmon/scpi-hwmon.c
>> index 2c1241bbf9af..5b80cd7f5c86 100644
>> --- a/drivers/hwmon/scpi-hwmon.c
>> +++ b/drivers/hwmon/scpi-hwmon.c
>
> [...]
>
>> @@ -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...
>
Ah, right thanks for spotting this.
>> 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
>
> Reviewed-by: Punit Agrawal <punit.agrawal@arm.com>
Will update the patch with these 2 changes and resend. Thanks for the
review.
--
Regards,
Sudeep
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
WARNING: multiple messages have this Message-ID (diff)
From: Sudeep Holla <sudeep.holla@arm.com>
To: Punit Agrawal <punit.agrawal@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
linux-kernel@vger.kernel.org, Guenter Roeck <linux@roeck-us.net>,
lm-sensors@lm-sensors.org, Jean Delvare <jdelvare@suse.com>
Subject: Re: [PATCH] hwmon: (scpi) skip unsupported sensors properly
Date: Wed, 28 Oct 2015 15:58:47 +0000 [thread overview]
Message-ID: <5630F0B7.6010702@arm.com> (raw)
In-Reply-To: <9hhio5rato2.fsf@e105922-lin.cambridge.arm.com>
On 28/10/15 15:39, Punit Agrawal wrote:
> Hi Sudeep,
>
> Sudeep Holla <sudeep.holla@arm.com> writes:
>
>> 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
>>
>
> Thanks for spotting the issue and the fix below. Some comments below.
>
>
>> 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 <punit.agrawal@arm.com>
>> Cc: Guenter Roeck <linux@roeck-us.net>
>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>
>
>> ---
>> drivers/hwmon/scpi-hwmon.c | 21 +++++++++++----------
>> 1 file changed, 11 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/hwmon/scpi-hwmon.c b/drivers/hwmon/scpi-hwmon.c
>> index 2c1241bbf9af..5b80cd7f5c86 100644
>> --- a/drivers/hwmon/scpi-hwmon.c
>> +++ b/drivers/hwmon/scpi-hwmon.c
>
> [...]
>
>> @@ -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...
>
Ah, right thanks for spotting this.
>> 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
>
> Reviewed-by: Punit Agrawal <punit.agrawal@arm.com>
Will update the patch with these 2 changes and resend. Thanks for the
review.
--
Regards,
Sudeep
next prev parent reply other threads:[~2015-10-28 15:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-28 14:08 [lm-sensors] [PATCH] hwmon: (scpi) skip unsupported sensors properly Sudeep Holla
2015-10-28 14:08 ` Sudeep Holla
2015-10-28 15:39 ` [lm-sensors] " Punit Agrawal
2015-10-28 15:39 ` Punit Agrawal
2015-10-28 15:58 ` Sudeep Holla [this message]
2015-10-28 15:58 ` Sudeep Holla
2015-10-28 17:17 ` [lm-sensors] [PATCH v2] " Sudeep Holla
2015-10-28 17:17 ` Sudeep Holla
2015-10-29 4:59 ` [lm-sensors] " Guenter Roeck
2015-10-29 4:59 ` Guenter Roeck
2015-11-16 18:00 ` [lm-sensors] " Punit Agrawal
2015-11-16 18:00 ` Punit Agrawal
2015-11-16 17:59 ` [lm-sensors] [v2] " Guenter Roeck
2015-11-16 17:59 ` Guenter Roeck
2015-11-16 19:37 ` [lm-sensors] " Punit Agrawal
2015-11-16 19:37 ` Punit Agrawal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5630F0B7.6010702@arm.com \
--to=sudeep.holla@arm.com \
--cc=jdelvare@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=lm-sensors@lm-sensors.org \
--cc=punit.agrawal@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.