lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1505788256.4080.24.camel@aj.id.au>
Date:   Tue, 19 Sep 2017 12:00:56 +0930
From:   Andrew Jeffery <andrew@...id.au>
To:     Guenter Roeck <linux@...ck-us.net>, linux-watchdog@...r.kernel.org
Cc:     wim@...ana.be, joel@....id.au, linux-kernel@...r.kernel.org,
        openbmc@...ts.ozlabs.org, linux-aspeed@...ts.ozlabs.org,
        ryan_chen@...eedtech.com
Subject: Re: [PATCH 1/4] watchdog: aspeed: Retain watchdog enabled state

On Mon, 2017-09-18 at 06:25 -0700, Guenter Roeck wrote:
> On 09/17/2017 10:49 PM, Andrew Jeffery wrote:
> > An unintended post-condition of probe() is that the watchdog is
> > disabled. Rework probe() such that we retain the value of the "enabled"
> > bit from the control register, and take the appropriate actions with
> > respect to the watchdog core if so. Otherwise, just configure the
> > watchdog as directed.
> > 
> > > > Signed-off-by: Andrew Jeffery <andrew@...id.au>
> > ---
> >   drivers/watchdog/aspeed_wdt.c | 9 +++++----
> >   1 file changed, 5 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c
> > index 79cc766cd30f..99bc6fbd8852 100644
> > --- a/drivers/watchdog/aspeed_wdt.c
> > +++ b/drivers/watchdog/aspeed_wdt.c
> > @@ -221,7 +221,8 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
> > > >   		return -EINVAL;
> > > >   	config = ofdid->data;
> >   
> > > > -	wdt->ctrl = WDT_CTRL_1MHZ_CLK;
> > > > +	wdt->ctrl |= readl(wdt->base + WDT_CTRL) & WDT_CTRL_ENABLE;
> > > > +	wdt->ctrl |= WDT_CTRL_1MHZ_CLK;
> >   
> > > >   	/*
> > > >   	 * Control reset on a per-device basis to ensure the
> > @@ -243,11 +244,11 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
> > > >   	if (of_property_read_bool(np, "aspeed,external-signal"))
> > > >   		wdt->ctrl |= WDT_CTRL_WDT_EXT;
> >   
> > > > -	writel(wdt->ctrl, wdt->base + WDT_CTRL);
> > -
> > > > -	if (readl(wdt->base + WDT_CTRL) & WDT_CTRL_ENABLE)  {
> > > > +	if (wdt->ctrl & WDT_CTRL_ENABLE) {
> >   		aspeed_wdt_start(&wdt->wdd);
> 
> Why call the start function in this case ?

... Good question. It was already there so I didn't touch it. I expect
it can be dropped - I'll look into it.

> 
> > > > > >   		set_bit(WDOG_HW_RUNNING, &wdt->wdd.status); > +	} else {
> > > > +		writel(wdt->ctrl, wdt->base + WDT_CTRL);
> > > >   	}
> >   
> > > >   	if (of_device_is_compatible(np, "aspeed,ast2500-wdt")) {
> > 
> 
> 
Download attachment "signature.asc" of type "application/pgp-signature" (802 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ