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-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] watchdog: wdat_wdt: Avoid unimplemented get_timeleft
Date: Thu, 22 Dec 2022 16:55:14 -0800	[thread overview]
Message-ID: <20221223005514.GA3188712@roeck-us.net> (raw)
In-Reply-To: <20221221-wdat_wdt-timeleft-v1-1-8e8a314c36cc@weissschuh.net>

On Thu, Dec 22, 2022 at 11:43:31PM +0000, Thomas Weißschuh wrote:
> As per the specification the action QUERY_COUNTDOWN_PERIOD is optional.
> If the action is not implemented by the physical device the driver would
> always report "0" from get_timeleft().
> Avoid confusing userspace by only providing get_timeleft() when
> implemented by the hardware.
> 
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

Assuming that there can be only one of those watchdogs in the system,

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

Guenter

> ---
>  drivers/watchdog/wdat_wdt.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/watchdog/wdat_wdt.c b/drivers/watchdog/wdat_wdt.c
> index ce7a4a9e4b03..0ba99bed59fc 100644
> --- a/drivers/watchdog/wdat_wdt.c
> +++ b/drivers/watchdog/wdat_wdt.c
> @@ -301,13 +301,12 @@ static const struct watchdog_info wdat_wdt_info = {
>  	.identity = "wdat_wdt",
>  };
>  
> -static const struct watchdog_ops wdat_wdt_ops = {
> +static struct watchdog_ops wdat_wdt_ops = {
>  	.owner = THIS_MODULE,
>  	.start = wdat_wdt_start,
>  	.stop = wdat_wdt_stop,
>  	.ping = wdat_wdt_ping,
>  	.set_timeout = wdat_wdt_set_timeout,
> -	.get_timeleft = wdat_wdt_get_timeleft,
>  };
>  
>  static int wdat_wdt_probe(struct platform_device *pdev)
> @@ -436,6 +435,9 @@ static int wdat_wdt_probe(struct platform_device *pdev)
>  		list_add_tail(&instr->node, instructions);
>  	}
>  
> +	if (wdat->instructions[ACPI_WDAT_GET_CURRENT_COUNTDOWN])
> +		wdat_wdt_ops.get_timeleft = wdat_wdt_get_timeleft;
> +
>  	wdat_wdt_boot_status(wdat);
>  	wdat_wdt_set_running(wdat);
>  
> 
> ---
> base-commit: 0a924817d2ed9396401e0557c6134276d2e26382
> change-id: 20221221-wdat_wdt-timeleft-b38d0db39d9f
> 
> Best regards,
> -- 
> Thomas Weißschuh <linux@weissschuh.net>

      reply	other threads:[~2022-12-23  0:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-22 23:43 Thomas Weißschuh
2022-12-23  0:55 ` Guenter Roeck [this message]

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=20221223005514.GA3188712@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@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®