Re: [PATCH] powerpc: Add support for the MPC83xx watchdog

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

 



> +static unsigned long wdt_is_open;
> +static spinlock_t wdt_spinlock;
> +
> +static void mpc83xx_wdt_keepalive(void)
> +{
> +	/* Ping the WDT */
> +	spin_lock(&wdt_spinlock);
> +	out_be16(&wd_base->swsrr, 0x556c);
> +	out_be16(&wd_base->swsrr, 0xaa39);
> +	spin_unlock(&wdt_spinlock);
> +}
> +
> +static ssize_t mpc83xx_wdt_write(struct file * file, const char __user * buf,
> +				 size_t count, loff_t * ppos)
> +{
> +	if(count)
> +		mpc83xx_wdt_keepalive();
> +	return count;
> +}
> +
> +static int mpc83xx_wdt_open(struct inode * inode, struct file * file)
> +{
> +	u32 tmp = SWCRR_SWEN;
> +	if (test_and_set_bit(0, &wdt_is_open))
> +		return -EBUSY;

Hi Kumar,

What do you need the spinlock for if the device can't be opened 
by more than one process?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux