linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
To: Kumar Gala <galak@gate.crashing.org>
Cc: Andrew Morton <akpm@osdl.org>,
	dave@cray.org, linux-kernel@vger.kernel.org,
	iinuxppc-embedded@gate.crashing.org, linuxppc-dev@ozlabs.org,
	wim@iguana.be
Subject: Re: [PATCH] powerpc: Add support for the MPC83xx watchdog
Date: Mon, 16 Jan 2006 20:41:15 -0200	[thread overview]
Message-ID: <20060116224115.GB17275@dmt.cnet> (raw)
In-Reply-To: <Pine.LNX.4.44.0601131618020.26648-100000@gate.crashing.org>

> +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?

      parent reply	other threads:[~2006-01-17  0:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-13 22:18 [PATCH] powerpc: Add support for the MPC83xx watchdog Kumar Gala
2006-01-13 22:52 ` Andrew Morton
2006-01-13 22:50   ` Kumar Gala
2006-01-13 22:58 ` Andrew Morton
2006-01-16 22:41 ` Marcelo Tosatti [this message]

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=20060116224115.GB17275@dmt.cnet \
    --to=marcelo.tosatti@cyclades.com \
    --cc=akpm@osdl.org \
    --cc=dave@cray.org \
    --cc=galak@gate.crashing.org \
    --cc=iinuxppc-embedded@gate.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).