Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Andrew Sharp <andy.sharp@onstor.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>,
	akpm@linux-foundation.org, wim@iguana.be
Subject: Re: [PATCH] Add support for SB1 hardware watchdog.
Date: Mon, 3 Dec 2007 11:24:18 -0800	[thread overview]
Message-ID: <20071203112418.26b94838@ripper.onstor.net> (raw)
In-Reply-To: <20071203183419.3213d551@the-village.bc.nu>

On Mon, 3 Dec 2007 18:34:19 +0000 Alan Cox <alan@lxorguk.ukuu.org.uk>
wrote:

> > +	  on such processors; this driver supports only the first
> > one,
> > +	  because currently Linux only supports exporting one
> > watchdog
> > +	  to userspace.
> 
> Yep. Perhaps that should change.

I thought about that just a little; I'm just not sure what it would
mean to have multiple watchdog devices.

> > + * wdog is the iomem address of the cfg register
> > + */
> > + void
> > +sbwdog_set(char __iomem *wdog, unsigned long t)
> > +{
> > +	__raw_writeb(0, wdog - 0x10);
> > +	__raw_writeq(t & 0x7fffffUL, wdog);
> > +}
> 
> What guarantees you don't get a pair of these calls at once or
> interleaving ?

Not much, I suppose, except that opening the device file is exclusive.
A thread could fork (or dup) after that and get crazy in a theoretical
scenario ... are you suggesting this be serialized?

> 
> 
> > +		 * return the bits from the config register
> > +		 */
> > +		ret = put_user(__raw_readb(user_dog), p);
> 
> Should return the translated status bits ?

Don't need this really.  I see a few more things that need cleaning
up so I will do that and submit another patch.  And with changing of
the directory up a level, I also forgot the makefile change.

> 
> 
> Alan

  reply	other threads:[~2007-12-03 19:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-03 18:17 [PATCH] Add support for SB1 hardware watchdog Andrew Sharp
2007-12-03 18:34 ` Alan Cox
2007-12-03 19:24   ` Andrew Sharp [this message]
2007-12-03 23:08 ` Ralf Baechle
2007-12-05  3:41   ` Kaz Kylheku
2007-12-05  3:41     ` Kaz Kylheku
2007-12-05  3:50   ` Kaz Kylheku
2007-12-05  3:50     ` Kaz Kylheku

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=20071203112418.26b94838@ripper.onstor.net \
    --to=andy.sharp@onstor.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=wim@iguana.be \
    /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