diff mbox series

[03/10] watchdog: Add documentation for read capability

Message ID 20200620174907.20229-4-minyard@acm.org (mailing list archive)
State Changes Requested
Headers show
Series Convert the IPMI watchdog to use the watchdog | expand

Commit Message

Corey Minyard June 20, 2020, 5:49 p.m. UTC
From: Corey Minyard <cminyard@mvista.com>

Document the read, poll, and async operations.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 Documentation/watchdog/watchdog-kernel-api.rst | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Guenter Roeck July 1, 2020, 2:49 a.m. UTC | #1
On Sat, Jun 20, 2020 at 12:49:00PM -0500, minyard@acm.org wrote:
> From: Corey Minyard <cminyard@mvista.com>
> 
> Document the read, poll, and async operations.
> 
> Signed-off-by: Corey Minyard <cminyard@mvista.com>
> ---
>  Documentation/watchdog/watchdog-kernel-api.rst | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/Documentation/watchdog/watchdog-kernel-api.rst b/Documentation/watchdog/watchdog-kernel-api.rst
> index 068a55ee0d4a..aa15a2d35397 100644
> --- a/Documentation/watchdog/watchdog-kernel-api.rst
> +++ b/Documentation/watchdog/watchdog-kernel-api.rst
> @@ -132,6 +132,10 @@ The list of watchdog operations is defined as::
>  	unsigned int (*get_timeleft)(struct watchdog_device *);
>  	int (*restart)(struct watchdog_device *);
>  	long (*ioctl)(struct watchdog_device *, unsigned int, unsigned long);
> +	ssize_t (*read)(struct watchdog_device *, struct file *, char __user *,
> +			size_t, loff_t *);
> +	__poll_t (*poll)(struct watchdog_device *, struct file *, poll_table *);
> +	int (*fasync)(struct watchdog_device *, int, struct file *, int);
>    };
>  
>  It is important that you first define the module owner of the watchdog timer
> @@ -235,6 +239,14 @@ they are supported. These optional routines/operations are:
>    our own internal ioctl call handling. This routine should return -ENOIOCTLCMD
>    if a command is not supported. The parameters that are passed to the ioctl
>    call are: watchdog_device, cmd and arg.
> +* read: If a read call comes in on the watchdog device, call this function.
> +  This allows a watchdog to provide data to the user.

I don't think this makes any sense. To be accepted, this would need to be
standardized. We can't have userspace read from a watchdog device without
knowing what is going to be returned.

Guenter

> +* poll: If a poll call comes in on the watchdog device, call this.  This
> +  allows the user to do select/poll waiting on the device to have read data
> +  ready.
> +* fasync: If a fasync call comes in on the watchdog, call this.  This
> +  allows the user to do async operations waiting for read data from
> +  the device.
>  
>  The status bits should (preferably) be set with the set_bit and clear_bit alike
>  bit-operations. The status bits that are defined are:
> -- 
> 2.17.1
>
diff mbox series

Patch

diff --git a/Documentation/watchdog/watchdog-kernel-api.rst b/Documentation/watchdog/watchdog-kernel-api.rst
index 068a55ee0d4a..aa15a2d35397 100644
--- a/Documentation/watchdog/watchdog-kernel-api.rst
+++ b/Documentation/watchdog/watchdog-kernel-api.rst
@@ -132,6 +132,10 @@  The list of watchdog operations is defined as::
 	unsigned int (*get_timeleft)(struct watchdog_device *);
 	int (*restart)(struct watchdog_device *);
 	long (*ioctl)(struct watchdog_device *, unsigned int, unsigned long);
+	ssize_t (*read)(struct watchdog_device *, struct file *, char __user *,
+			size_t, loff_t *);
+	__poll_t (*poll)(struct watchdog_device *, struct file *, poll_table *);
+	int (*fasync)(struct watchdog_device *, int, struct file *, int);
   };
 
 It is important that you first define the module owner of the watchdog timer
@@ -235,6 +239,14 @@  they are supported. These optional routines/operations are:
   our own internal ioctl call handling. This routine should return -ENOIOCTLCMD
   if a command is not supported. The parameters that are passed to the ioctl
   call are: watchdog_device, cmd and arg.
+* read: If a read call comes in on the watchdog device, call this function.
+  This allows a watchdog to provide data to the user.
+* poll: If a poll call comes in on the watchdog device, call this.  This
+  allows the user to do select/poll waiting on the device to have read data
+  ready.
+* fasync: If a fasync call comes in on the watchdog, call this.  This
+  allows the user to do async operations waiting for read data from
+  the device.
 
 The status bits should (preferably) be set with the set_bit and clear_bit alike
 bit-operations. The status bits that are defined are: