All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
	linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] watchdog: Report firmware_version in sysfs
Date: Sat, 26 Nov 2022 02:00:22 +0100	[thread overview]
Message-ID: <ddd1ea7b-0be7-4c16-a5ac-56516f955ef9@t-8ch.de> (raw)
In-Reply-To: <da94449e-d250-1b44-0e72-f951b73b1946@roeck-us.net>

On 2022-11-25 16:37-0800, Guenter Roeck wrote:
> On 11/25/22 14:23, Thomas Weißschuh wrote:
>> This synchronizes the information reported by ioctl and sysfs.
>> The mismatch is confusing because "wdctl" from util-linux uses the ioctl
>> when used with root privileges and sysfs without.
>> 
>> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
>> 
>> ---
>> 
>> Userspace implementation:
>> 
>> https://github.com/util-linux/util-linux/pull/1927
>> ---
>>   drivers/watchdog/watchdog_dev.c | 10 ++++++++++
>>   1 file changed, 10 insertions(+)
>> 
>> diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c
>> index 55574ed42504..88c76e27873c 100644
>> --- a/drivers/watchdog/watchdog_dev.c
>> +++ b/drivers/watchdog/watchdog_dev.c
>> @@ -555,6 +555,15 @@ static ssize_t identity_show(struct device *dev, struct device_attribute *attr,
>>   }
>>   static DEVICE_ATTR_RO(identity);
>> +static ssize_t firmware_version_show(struct device *dev, struct device_attribute *attr,
>> +				     char *buf)
>> +{
>> +	struct watchdog_device *wdd = dev_get_drvdata(dev);
>> +
>> +	return sysfs_emit(buf, "%d\n", wdd->info->firmware_version);
>> +}
>> +static DEVICE_ATTR_RO(firmware_version);
>> +
>>   static ssize_t state_show(struct device *dev, struct device_attribute *attr,
>>   				char *buf)
>>   {
>> @@ -618,6 +627,7 @@ static umode_t wdt_is_visible(struct kobject *kobj, struct attribute *attr,
>>   static struct attribute *wdt_attrs[] = {
>>   	&dev_attr_state.attr,
>>   	&dev_attr_identity.attr,
>> +	&dev_attr_firmware_version.attr,
>>   	&dev_attr_timeout.attr,
>>   	&dev_attr_min_timeout.attr,
>>   	&dev_attr_max_timeout.attr,
>> 
>> base-commit: 0b1dcc2cf55ae6523c6fbd0d741b3ac28c9f4536
> 
> I think this conflicts with drivers/watchdog/ziirave_wdt.c which generates its own
> firmnware_version attribute.

Indeed, thanks for the catch.

We probably can't change the attribute from ziirave_wdt, which is a bit
unfortunate as "firmware_version" would nicely match the name from
"struct watchdog_info".

How about "fw_version"?

That would match the naming of sysfs attributes from a bunch of other
subsystems.

And obviously an addition to Documentation/ABI/testing/sysfs-class-watchdog is
also missing from the patch.
I'll add it in v2.

Thomas

  reply	other threads:[~2022-11-26  1:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25 22:23 [PATCH] watchdog: Report firmware_version in sysfs Thomas Weißschuh
2022-11-26  0:37 ` Guenter Roeck
2022-11-26  1:00   ` Thomas Weißschuh [this message]
2022-11-26  1:46     ` Guenter Roeck
2022-11-26  3:21       ` Thomas Weißschuh

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=ddd1ea7b-0be7-4c16-a5ac-56516f955ef9@t-8ch.de \
    --to=linux@weissschuh.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=wim@linux-watchdog.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 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.