Linux Watchdog driver development
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Johannes Thumshirn <jth@kernel.org>,
	Wim Van Sebroeck <wim@linux-watchdog.org>
Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] watchdog: menz069_wdt: fix timeout setting
Date: Tue, 18 Apr 2023 11:21:29 -0700	[thread overview]
Message-ID: <a2d036ae-de4e-770d-03d1-e4147ddaee10@roeck-us.net> (raw)
In-Reply-To: <20230418172531.177349-3-jth@kernel.org>

On 4/18/23 10:25, Johannes Thumshirn wrote:
> When setting the timeout for the menz069_wdt watchdog driver, we
> erroneously read from the 'watchdog value register' (WVR) instead of the
> 'watchdog timer register' (WTR) and then write the value back into WTR.
> 
> This can potentially lead to wrong timeouts and wrong enable bit settings.
> 
> Signed-off-by: Johannes Thumshirn <jth@kernel.org>

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

> ---
>   drivers/watchdog/menz69_wdt.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/menz69_wdt.c b/drivers/watchdog/menz69_wdt.c
> index bca0938f3429..3c98030b9fcd 100644
> --- a/drivers/watchdog/menz69_wdt.c
> +++ b/drivers/watchdog/menz69_wdt.c
> @@ -77,7 +77,7 @@ static int men_z069_wdt_set_timeout(struct watchdog_device *wdt,
>   	wdt->timeout = timeout;
>   	val = timeout * MEN_Z069_TIMER_FREQ;
>   
> -	reg = readw(drv->base + MEN_Z069_WVR);
> +	reg = readw(drv->base + MEN_Z069_WTR);
>   	ena = reg & MEN_Z069_WTR_WDEN;
>   	reg = ena | val;
>   	writew(reg, drv->base + MEN_Z069_WTR);


      reply	other threads:[~2023-04-18 18:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-18 17:25 [PATCH 0/2] watchdog: fixes for menz069_wdt driver Johannes Thumshirn
2023-04-18 17:25 ` [PATCH 1/2] watchdog: menz069_wdt: fix watchdog initialisation Johannes Thumshirn
2023-04-18 18:20   ` Guenter Roeck
2023-04-18 17:25 ` [PATCH 2/2] watchdog: menz069_wdt: fix timeout setting Johannes Thumshirn
2023-04-18 18:21   ` 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=a2d036ae-de4e-770d-03d1-e4147ddaee10@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=jth@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --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