mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
	linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org,
	Wim Van Sebroeck <wim@iguana.be>
Subject: Re: [PATCH v2 1/2] watchdog: report fw_version in sysfs
Date: Tue, 31 Jan 2023 09:43:21 -0800	[thread overview]
Message-ID: <20230131174321.GA3602958@roeck-us.net> (raw)
In-Reply-To: <20221216-watchdog-sysfs-v2-1-6189311103a9@weissschuh.net>

On Mon, Dec 19, 2022 at 09:30:39PM +0000, 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.
> 
> The file is called "fw_version" instead of "firmware_version" as
> "firmware_version" is already used as custom attribute by single drivers.
> 
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  Documentation/ABI/testing/sysfs-class-watchdog |  7 +++++++
>  drivers/watchdog/watchdog_dev.c                | 10 ++++++++++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/Documentation/ABI/testing/sysfs-class-watchdog b/Documentation/ABI/testing/sysfs-class-watchdog
> index 585caecda3a5..27c000238fe4 100644
> --- a/Documentation/ABI/testing/sysfs-class-watchdog
> +++ b/Documentation/ABI/testing/sysfs-class-watchdog
> @@ -6,6 +6,13 @@ Description:
>  		device at boot. It is equivalent to WDIOC_GETBOOTSTATUS of
>  		ioctl interface.
>  
> +What:		/sys/class/watchdog/watchdogn/fw_version
> +Date:		April 2023
> +Contact:	Thomas Weißschuh
> +Description:
> +		It is a read only file. It contains firmware version of
> +		watchdog device.
> +
>  What:		/sys/class/watchdog/watchdogn/identity
>  Date:		August 2015
>  Contact:	Wim Van Sebroeck <wim@iguana.be>
> diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c
> index 55574ed42504..7feeda02a531 100644
> --- a/drivers/watchdog/watchdog_dev.c
> +++ b/drivers/watchdog/watchdog_dev.c
> @@ -546,6 +546,15 @@ static ssize_t pretimeout_show(struct device *dev,
>  }
>  static DEVICE_ATTR_RO(pretimeout);
>  
> +static ssize_t fw_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(fw_version);
> +
>  static ssize_t identity_show(struct device *dev, struct device_attribute *attr,
>  				char *buf)
>  {
> @@ -617,6 +626,7 @@ static umode_t wdt_is_visible(struct kobject *kobj, struct attribute *attr,
>  }
>  static struct attribute *wdt_attrs[] = {
>  	&dev_attr_state.attr,
> +	&dev_attr_fw_version.attr,
>  	&dev_attr_identity.attr,
>  	&dev_attr_timeout.attr,
>  	&dev_attr_min_timeout.attr,

  reply	other threads:[~2023-01-31 17:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-19 21:30 [PATCH v2 0/2] watchdog: report all watchdog_ident information via sysfs Thomas Weißschuh
2022-12-19 21:30 ` [PATCH v2 1/2] watchdog: report fw_version in sysfs Thomas Weißschuh
2023-01-31 17:43   ` Guenter Roeck [this message]
2022-12-19 21:30 ` [PATCH v2 2/2] watchdog: report options " 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=20230131174321.GA3602958@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=wim@iguana.be \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®