Commit Graph

17 Commits (3b34c169f8197e02529fa3ec703703c2ce418c57)

Author SHA1 Message Date
Timur Tabi 112e75466f watchdog: booke_wdt: clean up status messages
Improve the status messages that are displayed during some operations of the
PowerPC watchdog timer driver.  When the watchdog is enabled, the timeout is
displayed as a number of seconds, instead of an obscure "period".  The "period"
is the position of a bit in a 64-bit timer register.  The higher the value,
the quicker the watchdog timeout occurs.  Some people chose a high "period"
value for the timer and get confused as to why the board resets within a
few seconds.

Messages displayed during open and close are now debug messages, so that they
don't clutter the console by default.  Finally, printk() is replaced with the
pr_xxx() equivalent.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2011-03-15 16:02:39 +00:00
Randy Vinson 6ae98ed186 watchdog: Propagate Book E WDT period changes to all cores
When the watchdog period is changed, it needs to be propagated to all cores
in addition to the core that performed the change.

Signed-off-by: Randy Vinson <rvinson@mvista.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2011-01-12 10:24:38 +00:00
Timur Tabi 5d63c13415 watchdog: add CONFIG_WATCHDOG_NOWAYOUT support to PowerPC Book-E watchdog driver
Normally, the watchdog is disabled when dev/watchdog is closed, but if
CONFIG_WATCHDOG_NOWAYOUT is defined, then it means that the watchdog should
remain enabled.  So we should disable it only if CONFIG_WATCHDOG_NOWAYOUT is
not defined.

Also ensure that /dev/watchdog is only opened by one process at a time.  That
way, a second process can't accidentally disable the watchdog while the first
process has it open.  There shouldn't be any need for more than one process to
open /dev/watchdog anyway.

Signed-off-by: Timur Tabi <timur@freescale.com>
Acked-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2011-01-12 10:24:27 +00:00
Timur Tabi e0dc09ff9a powerpc/watchdog: Make default timeout for Book-E watchdog a Kconfig option
The PowerPC Book-E watchdog driver (booke_wdt.c) defines a default timeout
value in the code based on whether it's a Freescale Book-E part of not.
Instead of having hard-coded values in the driver, make it a Kconfig
option.

As newer chips gets faster, the current default values become less
appropriate, since the timeout sometimes occurs before the kernel finishes
booting.  Making the value a Kconfig option allows BSPs to configure a new
value without requiring the wdt_period command-line parameter to be set.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-10-14 01:05:32 -05:00
Timur Tabi fbdd7144ce powerpc/watchdog: Allow the Book-E driver to be compiled as a module
Register the __init and __exit functions in the PowerPC Book-E Watchdog
driver as module entry/exit functions, and modify the Kconfig entry.

Add a .release method for the PowerPC Book-E Watchdog driver, so that the
watchdog is disabled when the driver is closed.

Loosely based on original code from Jiang Yutang <b14898@freescale.com>.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-10-14 00:52:44 -05:00
Wim Van Sebroeck 8b18085a92 watchdog: booke_wdt: fix ioctl status flags
The WDIOC_GETSTATUS & WDIOC_GETBOOTSTATUS ioctl calls return the WDIOF_* flags
and nothing else.

Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2010-05-25 09:04:06 +00:00
Anton Vorontsov d8d8b63b6d watchdog: booke_wdt: fix build - unconstify watchdog_info
commit 42747d712d ("[WATCHDOG] watchdog_info
constify") introduced the following build failure:

   CC      booke_wdt.o
 booke_wdt.c: In function 'booke_wdt_init':
 booke_wdt.c:220: error: assignment of read-only variable 'ident'

Fix this by removing 'const' qualifier from watchdog_info struct.

Signed-off-by: Anton Vorontsov <avorontsov@mvista.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Cc: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2010-04-27 07:58:47 +00:00
Luuk Paulussen 0fb06571bb [WATCHDOG] fixed book E watchdog period register mask.
A previous fix changed the WDTP function to use the period directly,
rather than subtracting from 63.  However the mask generation was
not changed, so the mask was coming out as 0.  This patch fixes it.

Signed-off-by: Luuk Paulussen <luuk.paulussen@alliedtelesis.co.nz>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2010-04-16 12:23:04 +00:00
Wim Van Sebroeck 42747d712d [WATCHDOG] watchdog_info constify
make the watchdog_info struct const where possible.

Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2010-03-07 10:30:57 +00:00
Chris Friesen dcfb748422 [WATCHDOG] fix book E watchdog to take WDIOC_SETTIMEOUT arg in seconds
The WDIOC_SETTIMEOUT argument is supposed to be a "seconds" value.
However, the book E wdt currently treats it as a "period" which is
interpreted in a board-specific way.

This patch allows the user to pass in a "seconds" value and the driver
will set the smallest timeout that is at least as large as specified
by the user.  It's been tested on e500 hardware and works as
expected.

The patch only modifies the CONFIG_FSL_BOOKE case, the CONFIG_4xx case
is left unmodified as I don't have any hardware to test it on.

Signed-off-by: Chris Friesen <cfriesen@nortel.com>
Cc: Kumar Gala <galak@gate.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2009-09-18 08:37:21 +00:00
Matthias Fuchs 0a0e9e0cb9 powerpc: Fix Book-E watchdog timer interval setting
This patch fixes the setting of the Book-E watchdog timer interval setup
on initialization and by ioctl().

On initialization the period bits have to be masked before setting
a new period.

In WDIOC_SETTIMEOUT ioctl we have to use the correct mask.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-11-08 12:38:59 -06:00
Wim Van Sebroeck 0c06090c94 [WATCHDOG] Coding style - Indentation - part 2
This brings the watchdog drivers into line with coding style.
This patch takes cares of the indentation as described in chapter 1.
Main changes:
* Re-structure the ioctl switch call for all drivers as follows:
	switch (cmd) {
	case WDIOC_GETSUPPORT:
	case WDIOC_GETSTATUS:
	case WDIOC_GETBOOTSTATUS:
	case WDIOC_GETTEMP:
	case WDIOC_SETOPTIONS:
	case WDIOC_KEEPALIVE:
	case WDIOC_SETTIMEOUT:
	case WDIOC_GETTIMEOUT:
	case WDIOC_GETTIMELEFT:
	default:
	}

This to make the migration from the drivers to the uniform watchdog
device driver easier in the future.

Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2008-08-06 13:21:09 +00:00
Wim Van Sebroeck 96e2e6fafa [WATCHDOG] Merge code clean-up's from Alan Cox.
Merge branch 'alan' of ../linux-2.6-watchdog-mm
Fixed Conflicts in the following files:
	drivers/watchdog/booke_wdt.c
	drivers/watchdog/mpc5200_wdt.c
	drivers/watchdog/sc1200wdt.c

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2008-08-06 11:58:26 +00:00
Ingo Molnar f6f88e9bfb generic-ipi: more merge fallout
fix more API change fallout in recently merged upstream changes.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-07-15 22:08:52 +02:00
Alan Cox 00e9c2059a [WATCHDOG 20/57] booke watchdog: clean up and unlocked_ioctl
Review and switch to unlocked_ioctl

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2008-06-13 18:49:29 +00:00
Chen Gong f172ddc61a [WATCHDOG] Fix booke_wdt.c on MPC85xx SMP system's
On Book-E SMP systems each core has its own private watchdog.  If only one
watchdog is enabled, when the core that doesn't enable the watchdog is hung,
system can't reset because no watchdog is running on it.  That's bad.  It
means we must enable watchdogs on both cores.

We can use smp_call_function() to send appropriate messages to all the other
cores to enable and update the watchdog.

Signed-off-by: Chen Gong <g.chen@freescale.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2008-05-25 09:43:06 +00:00
Wim Van Sebroeck b7e04f8c61 mv watchdog tree under drivers
move watchdog tree from drivers/char/watchdog to drivers/watchdog.

Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
2007-10-18 10:39:03 +00:00