From: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
To: Guenter Roeck <linux@roeck-us.net>, mpe@ellerman.id.au
Cc: linuxppc-dev@lists.ozlabs.org, linux-hwmon@vger.kernel.org,
linux-kernel@vger.kernel.org, ego@linux.vnet.ibm.com
Subject: Re: [PATCH v2 2/2] hwmon: ibmpowernv: Add attributes to enable/disable sensor groups
Date: Wed, 4 Jul 2018 22:23:51 +0530 [thread overview]
Message-ID: <c7e1272a-c9c8-a120-632f-7693cef3fd22@linux.vnet.ibm.com> (raw)
In-Reply-To: <e3a013fb-eaf0-8d45-2f23-3be8b3e5640b@roeck-us.net>
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
next prev parent reply other threads:[~2018-07-04 16:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-04 9:16 [PATCH v2 0/2] hwmon: Add attributes to enable/disable sensors Shilpasri G Bhat
2018-07-04 9:16 ` [PATCH v2 1/2] powernv:opal-sensor-groups: Add support to enable sensor groups Shilpasri G Bhat
2018-07-04 9:16 ` [PATCH v2 2/2] hwmon: ibmpowernv: Add attributes to enable/disable " Shilpasri G Bhat
2018-07-04 14:46 ` Guenter Roeck
2018-07-04 16:53 ` Shilpasri G Bhat [this message]
2018-07-04 21:42 ` Guenter Roeck
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=c7e1272a-c9c8-a120-632f-7693cef3fd22@linux.vnet.ibm.com \
--to=shilpa.bhat@linux.vnet.ibm.com \
--cc=ego@linux.vnet.ibm.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).