Re: [PATCH] Add support for SB1 hardware watchdog.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 3 Dec 2007 18:34:19 +0000 Alan Cox <alan@xxxxxxxxxxxxxxxxxxx>
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


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux