linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv2 5/5] ARM: picoxcell: implement watchdog restart
Date: Sun, 18 Dec 2011 08:13:27 +0000	[thread overview]
Message-ID: <20111218081327.GT14542@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1771411.xn5pEUbjJo@wuerfel>

On Sat, Dec 17, 2011 at 09:17:00PM +0100, Arnd Bergmann wrote:
> > +static void picoxcell_wdt_restart(char mode, const char *cmd)
> > +{
> > +	/*
> > +	 * Configure the watchdog to reset with the shortest possible timeout
> > +	 * and give it chance to do the reset.
> > +	 */
> > +	if (wdt_regs) {
> > +		__raw_writel(WDT_CTRL_REG_EN_MASK, wdt_regs + WDT_CTRL_REG_OFFS);
> > +		__raw_writel(0, wdt_regs + WDT_TIMEOUT_REG_OFFS);
> > +		mdelay(500);
> > +	}
> > +}
> 
> Does this work if the real watchdog is still running, on a preemtible kernel?
> 
> Also, please always use writel_relaxed instead of __raw_writel, and try to use
> msleep instead of mdelay by default. If msleep doesn't work here because it
> actually causes the system not to be reset, just add a comment.

Restarting can be called from atomic contexts, so any function which may
sleep must not be used.  That include sioremap.

  parent reply	other threads:[~2011-12-18  8:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-17 13:42 [PATCHv2 0/5] Misc picoxcell updates for 3.3 Jamie Iles
2011-12-17 13:42 ` [PATCHv2 1/5] ARM: picoxcell: remove mach/memory.h Jamie Iles
2011-12-17 13:42 ` [PATCHv2 2/5] ARM: picoxcell: don't reserve irq_descs Jamie Iles
2011-12-17 13:42 ` [PATCHv2 3/5] ARM: picoxcell: move io mappings to common.c Jamie Iles
2011-12-17 13:42 ` [PATCHv2 4/5] MAINTAINERS: add maintainer entry for Picochip picoxcell Jamie Iles
2011-12-17 13:42 ` [PATCHv2 5/5] ARM: picoxcell: implement watchdog restart Jamie Iles
2011-12-17 20:17   ` Arnd Bergmann
2011-12-18  0:05     ` Jamie Iles
2011-12-18  8:13     ` Russell King - ARM Linux [this message]
2011-12-18  9:41       ` Jamie Iles
2011-12-17 20:18 ` [PATCHv2 0/5] Misc picoxcell updates for 3.3 Arnd Bergmann

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=20111218081327.GT14542@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).