linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Christian Schneider <cschneider@radiodata.biz>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH] hwmon, gpio-fan: fix that sysfs_notify in void fan_alarm_notify is not received in userspace
Date: Fri, 14 Jun 2019 07:52:56 -0700	[thread overview]
Message-ID: <20190614145256.GA464@roeck-us.net> (raw)
In-Reply-To: <178c4302-3333-b60f-afbd-ff73fbe943ca@radiodata.biz>

On Fri, Jun 14, 2019 at 04:16:55PM +0200, Christian Schneider wrote:
> Am 14.06.2019 um 15:05 schrieb Guenter Roeck:
> >On 6/14/19 6:52 AM, Christian Schneider wrote:
> >>From: Christian Schneider <cschneider@radiodata.biz>
> >>   To: linux-hwmon
> >
> >The above should not be part of the e-mail body.
> >
> >>Alarms on gpio-fan can't be received from sysfs_notify, because the
> >>wrong kobject is passed.
> >>This patch fixes this.
> >
> >Empty line here please.
> >
> >>Signed-off-by: Christian Schneider <cschneider@radiodata.biz>
> >>---
> >>diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
> >>index 84753680a4e8..5f3a35db18a1 100644
> >>--- a/drivers/hwmon/gpio-fan.c
> >>+++ b/drivers/hwmon/gpio-fan.c
> >>@@ -54,7 +54,7 @@ static void fan_alarm_notify(struct work_struct *ws)
> >>         struct gpio_fan_data *fan_data =
> >>                 container_of(ws, struct gpio_fan_data, alarm_work);
> >>
> >>-       sysfs_notify(&fan_data->dev->kobj, NULL, "fan1_alarm");
> >>+       sysfs_notify(&fan_data->hwmon_dev->kobj, NULL, "fan1_alarm");
> >>         kobject_uevent(&fan_data->dev->kobj, KOBJ_CHANGE);
> >>  }
> >>
> >You'll want to make the same change for kobject_uevent().
> 
> Actually, uevents are send and can be received as is. I have tried changing
> the kobject for kobject_uevent(), too, and only the content of the uevent
> changes.
> Since I don't know what would be the "right" one, I left it as is.
> If you say, that it would be correct with the hwmon_dev kobject, I'll add
> this to the patch.

The point of uevent notifications is to tell userspace that something changed
in the provided directory. It doesn't help if the uevent does not point there.

Guenter

  reply	other threads:[~2019-06-14 14:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14 13:52 [PATCH] hwmon, gpio-fan: fix that sysfs_notify in void fan_alarm_notify is not received in userspace Christian Schneider
2019-06-14 14:05 ` Guenter Roeck
2019-06-14 14:16   ` Christian Schneider
2019-06-14 14:52     ` Guenter Roeck [this message]
2019-06-14 15:35       ` [PATCHv2] " Christian Schneider
2019-06-15 13:17         ` Guenter Roeck
2019-06-17  9:36           ` Christian Schneider
2019-06-14 15:37       ` [PATCH] " Christian Schneider

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=20190614145256.GA464@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=cschneider@radiodata.biz \
    --cc=linux-hwmon@vger.kernel.org \
    /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).