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: <20150729104550.GG2773@codeblueprint.co.uk>
Date:	Wed, 29 Jul 2015 11:45:50 +0100
From:	Matt Fleming <matt@...eblueprint.co.uk>
To:	Jean Delvare <jdelvare@...e.de>
Cc:	Wim Van Sebroeck <wim@...ana.be>, linux-kernel@...r.kernel.org,
	linux-watchdog@...r.kernel.org,
	Mika Westerberg <mika.westerberg@...ux.intel.com>,
	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	Wolfram Sang <wsa@...-dreams.de>,
	Matt Fleming <matt.fleming@...el.com>,
	Guenter Roeck <linux@...ck-us.net>
Subject: Re: [PATCH 3/5] iTCO_wdt: Add support for TCO on Intel Sunrisepoint

On Tue, 28 Jul, at 07:03:41PM, Jean Delvare wrote:
> Hi Matt,
> 
> Le Monday 27 July 2015 à 14:38 +0100, Matt Fleming a écrit :
> > From: Matt Fleming <matt.fleming@...el.com>
> > 
> > The revision of the watchdog hardware in Sunrisepoint necessitates a new
> > "version" inside the TCO watchdog driver because some of the register
> > layouts have changed.
> > 
> > Cc: Wim Van Sebroeck <wim@...ana.be>
> > Signed-off-by: Matt Fleming <matt.fleming@...el.com>
> > ---
> >  drivers/watchdog/iTCO_wdt.c | 58 ++++++++++++++++++++++++++-------------------
> >  1 file changed, 34 insertions(+), 24 deletions(-)
> > 
> > diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c
> > index 9a6e70976f64..17dfbc51b85a 100644
> > --- a/drivers/watchdog/iTCO_wdt.c
> > +++ b/drivers/watchdog/iTCO_wdt.c
> > (...) 
> > @@ -503,7 +510,10 @@ static int iTCO_wdt_probe(struct platform_device *dev)
> >  		pdata->name, pdata->iTCO_version, (u64)TCOBASE);
> >  
> >  	/* Clear out the (probably old) status */
> > -	if (iTCO_wdt_private.iTCO_version == 3) {
> > +	if (iTCO_wdt_private.iTCO_version == 4) {
> > +		outw(0x0008, TCO1_STS);	/* Clear the Time Out Status bit */
> > +		outw(0x0002, TCO2_STS);	/* Clear SECOND_TO_STS bit */
> > +	} else if (iTCO_wdt_private.iTCO_version == 3) {
> >  		outl(0x20008, TCO1_STS);
> >  	} else {
> >  		outw(0x0008, TCO1_STS);	/* Clear the Time Out Status bit */
> 
> The "version == 4" branch is a subset of the "else" branch, so you could
> merge both with a conditional. If you prefer not to, then it probably
> makes sense to change the whole block to a switch/case construct.

I think the switch/case construct is the right choice here. I'll make the
update, thanks.

-- 
Matt Fleming, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ