[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <c7e1272a-c9c8-a120-632f-7693cef3fd22@linux.vnet.ibm.com>
Date: Wed, 4 Jul 2018 22:23:51 +0530
From: Shilpasri G Bhat <shilpa.bhat@...ux.vnet.ibm.com>
To: Guenter Roeck <linux@...ck-us.net>, mpe@...erman.id.au
Cc: linuxppc-dev@...ts.ozlabs.org, linux-hwmon@...r.kernel.org,
linux-kernel@...r.kernel.org, ego@...ux.vnet.ibm.com
Subject: Re: [PATCH v2 2/2] hwmon: ibmpowernv: Add attributes to
enable/disable sensor groups
Hi Guenter,
Thanks for reviewing the patch.
On 07/04/2018 08:16 PM, Guenter Roeck wrote:
>> + /* Disable if last sensor in the group */
>> + send_command = true;
>> + for (i = 0; i < sg->nr_sensor; i++) {
>> + struct sensor_data *sd = sg->sensors[i];
>> +
>> + if (sd->enable) {
>> + send_command = false;
>> + break;
>> + }
>
> This is weird. So there are situations where a request to disable
> a sensor is accepted, but effectively ignored ? Shouldn't that
> return, say, -EBUSY ?
This is because we do not support per-sensor enable/disable. We can only
enable/disable at a sensor-group level.
This patch follows the semantic to disable a sensor group iff all the sensors
belonging to that group have been disabled. Otherwise the sensor alone is marked
to be disabled and returns -ENODATA on reading it.
And a sensor group will be enabled if any of the sensor in that group is enabled.
I will make changes to the remaining code according to your suggestion.
Thanks and Regards,
Shilpa
Powered by blists - more mailing lists