All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>,
	Hardware Monitoring <linux-hwmon@vger.kernel.org>
Cc: Jean Delvare <jdelvare@suse.com>
Subject: Re: [PATCH 6/6] hwmon: (lm90) Fix sysfs and udev notifications
Date: Sun, 16 Jan 2022 11:14:31 +0300	[thread overview]
Message-ID: <ae0dff3a-fb19-1dae-6e74-07ed50161fc6@gmail.com> (raw)
In-Reply-To: <93718b89-5b79-1d24-45ed-ada964429e2e@roeck-us.net>

16.01.2022 00:11, Guenter Roeck пишет:
> On 1/15/22 12:41 PM, Dmitry Osipenko wrote:
>> 15.01.2022 23:33, Dmitry Osipenko пишет:
>>> 11.01.2022 19:51, Guenter Roeck пишет:
>>>> sysfs and udev notifications need to be sent to the _alarm
>>>> attributes, not to the value attributes.
>>>>
>>>> Fixes: 94dbd23ed88c ("hwmon: (lm90) Use hwmon_notify_event()")
>>>> Cc: Dmitry Osipenko <digetx@gmail.com>
>>>> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
>>>> ---
>>>>   drivers/hwmon/lm90.c | 12 ++++++------
>>>>   1 file changed, 6 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
>>>> index ba01127c1deb..1c9493c70813 100644
>>>> --- a/drivers/hwmon/lm90.c
>>>> +++ b/drivers/hwmon/lm90.c
>>>> @@ -1808,22 +1808,22 @@ static bool lm90_is_tripped(struct
>>>> i2c_client *client, u16 *status)
>>>>         if (st & LM90_STATUS_LLOW)
>>>>           hwmon_notify_event(data->hwmon_dev, hwmon_temp,
>>>> -                   hwmon_temp_min, 0);
>>>> +                   hwmon_temp_min_alarm, 0);
>>>>       if (st & LM90_STATUS_RLOW)
>>>>           hwmon_notify_event(data->hwmon_dev, hwmon_temp,
>>>> -                   hwmon_temp_min, 1);
>>>> +                   hwmon_temp_min_alarm, 1);
>>>>       if (st2 & MAX6696_STATUS2_R2LOW)
>>>>           hwmon_notify_event(data->hwmon_dev, hwmon_temp,
>>>> -                   hwmon_temp_min, 2);
>>>> +                   hwmon_temp_min_alarm, 2);
>>>>       if (st & LM90_STATUS_LHIGH)
>>>>           hwmon_notify_event(data->hwmon_dev, hwmon_temp,
>>>> -                   hwmon_temp_max, 0);
>>>> +                   hwmon_temp_max_alarm, 0);
>>>>       if (st & LM90_STATUS_RHIGH)
>>>>           hwmon_notify_event(data->hwmon_dev, hwmon_temp,
>>>> -                   hwmon_temp_max, 1);
>>>> +                   hwmon_temp_max_alarm, 1);
>>>>       if (st2 & MAX6696_STATUS2_R2HIGH)
>>>>           hwmon_notify_event(data->hwmon_dev, hwmon_temp,
>>>> -                   hwmon_temp_max, 2);
>>>> +                   hwmon_temp_max_alarm, 2);
>>>
>>>
>>> IIUC, "alarm" is about the T_CRIT output line. While these attributes
>>> are about the ALERT line. Hence why "alert" notifications need to be
>>> sent to the unrelated "alarm" attributes? This change doesn't look
>>> right.
>>>
>>
>> Although, no. I see now that the "alarm_bits" in the code are about the
>> alerts. Should be okay then.
>>
> 
> Alarm attributes are really neither about interrupts nor about alerts.
> Alarm attributes alert userspace that a limit has been exceeded.
> How and if the driver notices that a limit has been exceeded is
> an implementation detail. In a specific implementation, alerts
> or interrupts can be used to notify a driver that a notable event
> has occurred on a given device, but technically that is not
> necessary. Polling would do just as well.

Datasheet refers to T_CRIT using the "alarm" term, this confused me a tad.

BTW, we don't have events wired for the temp_crit_alarm attribute.

  reply	other threads:[~2022-01-16  8:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11 16:51 [PATCH 0/6] hwmon: Fixes for lm90 driver Guenter Roeck
2022-01-11 16:51 ` [PATCH 1/6] hwmon: (lm90) Reduce maximum conversion rate for G781 Guenter Roeck
2022-01-11 16:51 ` [PATCH 2/6] hwmon: (lm90) Re-enable interrupts after alert clears Guenter Roeck
2022-01-15 20:09   ` Dmitry Osipenko
2022-01-11 16:51 ` [PATCH 3/6] hwmon: (lm90) Mark alert as broken for MAX6654 Guenter Roeck
2022-01-11 16:51 ` [PATCH 4/6] hwmon: (lm90) Mark alert as broken for MAX6680 Guenter Roeck
2022-01-11 16:51 ` [PATCH 5/6] hwmon: (lm90) Mark alert as broken for MAX6646/6647/6649 Guenter Roeck
2022-01-11 16:51 ` [PATCH 6/6] hwmon: (lm90) Fix sysfs and udev notifications Guenter Roeck
2022-01-15 20:33   ` Dmitry Osipenko
2022-01-15 20:41     ` Dmitry Osipenko
2022-01-15 21:11       ` Guenter Roeck
2022-01-16  8:14         ` Dmitry Osipenko [this message]
2022-01-16 15:58           ` Guenter Roeck
2022-01-16 18:20             ` Dmitry Osipenko

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=ae0dff3a-fb19-1dae-6e74-07ed50161fc6@gmail.com \
    --to=digetx@gmail.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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.