linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hwmon, gpio-fan: fix that sysfs_notify in void fan_alarm_notify is not received in userspace
@ 2019-06-14 13:52 Christian Schneider
  2019-06-14 14:05 ` Guenter Roeck
  0 siblings, 1 reply; 8+ messages in thread
From: Christian Schneider @ 2019-06-14 13:52 UTC (permalink / raw)
  To: linux-hwmon

From: Christian Schneider <cschneider@radiodata.biz>
   To: linux-hwmon
Alarms on gpio-fan can't be received from sysfs_notify, because the 
wrong kobject is passed.
This patch fixes this.
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);
  }

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] hwmon, gpio-fan: fix that sysfs_notify in void fan_alarm_notify is not received in userspace
  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
  0 siblings, 1 reply; 8+ messages in thread
From: Guenter Roeck @ 2019-06-14 14:05 UTC (permalink / raw)
  To: Christian Schneider, linux-hwmon

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().

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] hwmon, gpio-fan: fix that sysfs_notify in void fan_alarm_notify is not received in userspace
  2019-06-14 14:05 ` Guenter Roeck
@ 2019-06-14 14:16   ` Christian Schneider
  2019-06-14 14:52     ` Guenter Roeck
  0 siblings, 1 reply; 8+ messages in thread
From: Christian Schneider @ 2019-06-14 14:16 UTC (permalink / raw)
  To: Guenter Roeck, linux-hwmon

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.

> 
> Thanks,
> Guenter

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] hwmon, gpio-fan: fix that sysfs_notify in void fan_alarm_notify is not received in userspace
  2019-06-14 14:16   ` Christian Schneider
@ 2019-06-14 14:52     ` Guenter Roeck
  2019-06-14 15:35       ` [PATCHv2] " Christian Schneider
  2019-06-14 15:37       ` [PATCH] " Christian Schneider
  0 siblings, 2 replies; 8+ messages in thread
From: Guenter Roeck @ 2019-06-14 14:52 UTC (permalink / raw)
  To: Christian Schneider; +Cc: linux-hwmon

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCHv2] hwmon, gpio-fan: fix that sysfs_notify in void fan_alarm_notify is not received in userspace
  2019-06-14 14:52     ` Guenter Roeck
@ 2019-06-14 15:35       ` Christian Schneider
  2019-06-15 13:17         ` Guenter Roeck
  2019-06-14 15:37       ` [PATCH] " Christian Schneider
  1 sibling, 1 reply; 8+ messages in thread
From: Christian Schneider @ 2019-06-14 15:35 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-hwmon

Alarms on gpio-fan can't be received from sysfs_notify, because the 
wrong kobject is passed.
This patch fixes this.

Signed-off-by: Christian Schneider <cschneider@radiodata.biz>
---
diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
index 84753680a4e8..76377791ff0e 100644
--- a/drivers/hwmon/gpio-fan.c
+++ b/drivers/hwmon/gpio-fan.c
@@ -54,8 +54,8 @@ 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");
-       kobject_uevent(&fan_data->dev->kobj, KOBJ_CHANGE);
+       sysfs_notify(&fan_data->hwmon_dev->kobj, NULL, "fan1_alarm");
+       kobject_uevent(&fan_data->hwmon_dev->kobj, KOBJ_CHANGE);
  }

  static irqreturn_t fan_alarm_irq_handler(int irq, void *dev_id)

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] hwmon, gpio-fan: fix that sysfs_notify in void fan_alarm_notify is not received in userspace
  2019-06-14 14:52     ` Guenter Roeck
  2019-06-14 15:35       ` [PATCHv2] " Christian Schneider
@ 2019-06-14 15:37       ` Christian Schneider
  1 sibling, 0 replies; 8+ messages in thread
From: Christian Schneider @ 2019-06-14 15:37 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-hwmon

Am 14.06.2019 um 15:52 schrieb Guenter Roeck:
> 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
> 

Sounds legit. I sent new patch.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCHv2] hwmon, gpio-fan: fix that sysfs_notify in void fan_alarm_notify is not received in userspace
  2019-06-14 15:35       ` [PATCHv2] " Christian Schneider
@ 2019-06-15 13:17         ` Guenter Roeck
  2019-06-17  9:36           ` Christian Schneider
  0 siblings, 1 reply; 8+ messages in thread
From: Guenter Roeck @ 2019-06-15 13:17 UTC (permalink / raw)
  To: Christian Schneider; +Cc: linux-hwmon

On 6/14/19 8:35 AM, Christian Schneider wrote:
> Alarms on gpio-fan can't be received from sysfs_notify, because the wrong kobject is passed.
> This patch fixes this.
> 
> Signed-off-by: Christian Schneider <cschneider@radiodata.biz>
> ---
> diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
> index 84753680a4e8..76377791ff0e 100644
> --- a/drivers/hwmon/gpio-fan.c
> +++ b/drivers/hwmon/gpio-fan.c
> @@ -54,8 +54,8 @@ 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");
> -       kobject_uevent(&fan_data->dev->kobj, KOBJ_CHANGE);
> +       sysfs_notify(&fan_data->hwmon_dev->kobj, NULL, "fan1_alarm");
> +       kobject_uevent(&fan_data->hwmon_dev->kobj, KOBJ_CHANGE);
>   }
> 
>   static irqreturn_t fan_alarm_irq_handler(int irq, void *dev_id)
> 
The patch is whitespace damaged (cut-and-paste, maybe ?) and does not apply.
Can you send it with git send-email, possibly ?

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCHv2] hwmon, gpio-fan: fix that sysfs_notify in void fan_alarm_notify is not received in userspace
  2019-06-15 13:17         ` Guenter Roeck
@ 2019-06-17  9:36           ` Christian Schneider
  0 siblings, 0 replies; 8+ messages in thread
From: Christian Schneider @ 2019-06-17  9:36 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-hwmon

sent again with git send-email.
Sorry for hazzle...

Am 15.06.2019 um 14:17 schrieb Guenter Roeck:
> On 6/14/19 8:35 AM, Christian Schneider wrote:
>> Alarms on gpio-fan can't be received from sysfs_notify, because the 
>> wrong kobject is passed.
>> This patch fixes this.
>>
>> Signed-off-by: Christian Schneider <cschneider@radiodata.biz>
>> ---
>> diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
>> index 84753680a4e8..76377791ff0e 100644
>> --- a/drivers/hwmon/gpio-fan.c
>> +++ b/drivers/hwmon/gpio-fan.c
>> @@ -54,8 +54,8 @@ 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");
>> -       kobject_uevent(&fan_data->dev->kobj, KOBJ_CHANGE);
>> +       sysfs_notify(&fan_data->hwmon_dev->kobj, NULL, "fan1_alarm");
>> +       kobject_uevent(&fan_data->hwmon_dev->kobj, KOBJ_CHANGE);
>>   }
>>
>>   static irqreturn_t fan_alarm_irq_handler(int irq, void *dev_id)
>>
> The patch is whitespace damaged (cut-and-paste, maybe ?) and does not 
> apply.
> Can you send it with git send-email, possibly ?
> 
> Thanks,
> Guenter

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-06-17  9:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).