Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e75a9f3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull watchdog updates from Wim Van Sebroeck:

 - new drivers for: NI 903x/913x watchdog driver, WinSystems EBC-C384
   watchdog timer and ARM SBSA watchdog driver

 - Support for NCT6102D devices

 - Improvements of the generic watchdog framework (improve restart
   handler, make set_timeout optional, introduce infrastructure
   triggered keepalives, ...

 - improvements on the pnx4008 watchdog driver

 - several smaller fixes and improvements

* git://www.linux-watchdog.org/linux-watchdog: (28 commits)
  watchdog: Ensure that wdd is not dereferenced if NULL
  watchdog: imx2: Convert to use infrastructure triggered keepalives
  watchdog: dw_wdt: Convert to use watchdog infrastructure
  watchdog: Add support for minimum time between heartbeats
  watchdog: Make stop function optional
  watchdog: Introduce WDOG_HW_RUNNING flag
  watchdog: Introduce hardware maximum heartbeat in watchdog core
  watchdog: Make set_timeout function optional
  arm: lpc32xx: remove restart handler
  arm: lpc32xx: phy3250 remove restart hook
  watchdog: pnx4008: restart: support "cmd" from userspace
  watchdog: pnx4008: add support for soft reset
  watchdog: pnx4008: add restart handler
  watchdog: pnx4008: update logging during power-on
  watchdog: tangox_wdt: test clock rate to avoid division by 0
  watchdog: atlas7_wdt: test clock rate to avoid division by 0
  watchdog: s3c2410_wdt: Add max and min timeout values
  Watchdog: introduce ARM SBSA watchdog driver
  Documentation: add sbsa-gwdt driver documentation
  watchdog: Add watchdog timer support for the WinSystems EBC-C384
  ...
parents 1c3d7700 d1ed3ba4
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
* SBSA (Server Base System Architecture) Generic Watchdog

The SBSA Generic Watchdog Timer is used to force a reset of the system
after two stages of timeout have elapsed.  A detailed definition of the
watchdog timer can be found in the ARM document: ARM-DEN-0029 - Server
Base System Architecture (SBSA)

Required properties:
- compatible: Should at least contain "arm,sbsa-gwdt".

- reg: Each entry specifies the base physical address of a register frame
  and the length of that frame; currently, two frames must be defined,
  in this order:
  1: Watchdog control frame;
  2: Refresh frame.

- interrupts: Should contain the Watchdog Signal 0 (WS0) SPI (Shared
  Peripheral Interrupt) number of SBSA Generic Watchdog.

Optional properties
- timeout-sec: Watchdog timeout values (in seconds).

Example for FVP Foundation Model v8:

watchdog@2a440000 {
	compatible = "arm,sbsa-gwdt";
	reg = <0x0 0x2a440000 0 0x1000>,
	      <0x0 0x2a450000 0 0x1000>;
	interrupts = <0 27 4>;
	timeout-sec = <30>;
};
+47 −12
Original line number Diff line number Diff line
@@ -52,6 +52,8 @@ struct watchdog_device {
	unsigned int timeout;
	unsigned int min_timeout;
	unsigned int max_timeout;
	unsigned int min_hw_heartbeat_ms;
	unsigned int max_hw_heartbeat_ms;
	struct notifier_block reboot_nb;
	struct notifier_block restart_nb;
	void *driver_data;
@@ -73,8 +75,21 @@ It contains following fields:
  additional information about the watchdog timer itself. (Like it's unique name)
* ops: a pointer to the list of watchdog operations that the watchdog supports.
* timeout: the watchdog timer's timeout value (in seconds).
  This is the time after which the system will reboot if user space does
  not send a heartbeat request if WDOG_ACTIVE is set.
* min_timeout: the watchdog timer's minimum timeout value (in seconds).
* max_timeout: the watchdog timer's maximum timeout value (in seconds).
  If set, the minimum configurable value for 'timeout'.
* max_timeout: the watchdog timer's maximum timeout value (in seconds),
  as seen from userspace. If set, the maximum configurable value for
  'timeout'. Not used if max_hw_heartbeat_ms is non-zero.
* min_hw_heartbeat_ms: Minimum time between heartbeats sent to the chip,
  in milli-seconds.
* max_hw_heartbeat_ms: Maximum hardware heartbeat, in milli-seconds.
  If set, the infrastructure will send heartbeats to the watchdog driver
  if 'timeout' is larger than max_hw_heartbeat_ms, unless WDOG_ACTIVE
  is set and userspace failed to send a heartbeat for at least 'timeout'
  seconds. max_hw_heartbeat_ms must be set if a driver does not implement
  the stop function.
* reboot_nb: notifier block that is registered for reboot notifications, for
  internal use only. If the driver calls watchdog_stop_on_reboot, watchdog core
  will stop the watchdog on such notifications.
@@ -123,17 +138,20 @@ are:
  device.
  The routine needs a pointer to the watchdog timer device structure as a
  parameter. It returns zero on success or a negative errno code for failure.
* stop: with this routine the watchdog timer device is being stopped.
  The routine needs a pointer to the watchdog timer device structure as a
  parameter. It returns zero on success or a negative errno code for failure.
  Some watchdog timer hardware can only be started and not be stopped. The
  driver supporting this hardware needs to make sure that a start and stop
  routine is being provided. This can be done by using a timer in the driver
  that regularly sends a keepalive ping to the watchdog timer hardware.

Not all watchdog timer hardware supports the same functionality. That's why
all other routines/operations are optional. They only need to be provided if
they are supported. These optional routines/operations are:
* stop: with this routine the watchdog timer device is being stopped.
  The routine needs a pointer to the watchdog timer device structure as a
  parameter. It returns zero on success or a negative errno code for failure.
  Some watchdog timer hardware can only be started and not be stopped. A
  driver supporting such hardware does not have to implement the stop routine.
  If a driver has no stop function, the watchdog core will set WDOG_HW_RUNNING
  and start calling the driver's keepalive pings function after the watchdog
  device is closed.
  If a watchdog driver does not implement the stop function, it must set
  max_hw_heartbeat_ms.
* ping: this is the routine that sends a keepalive ping to the watchdog timer
  hardware.
  The routine needs a pointer to the watchdog timer device structure as a
@@ -153,9 +171,18 @@ they are supported. These optional routines/operations are:
  and -EIO for "could not write value to the watchdog". On success this
  routine should set the timeout value of the watchdog_device to the
  achieved timeout value (which may be different from the requested one
  because the watchdog does not necessarily has a 1 second resolution).
  because the watchdog does not necessarily have a 1 second resolution).
  Drivers implementing max_hw_heartbeat_ms set the hardware watchdog heartbeat
  to the minimum of timeout and max_hw_heartbeat_ms. Those drivers set the
  timeout value of the watchdog_device either to the requested timeout value
  (if it is larger than max_hw_heartbeat_ms), or to the achieved timeout value.
  (Note: the WDIOF_SETTIMEOUT needs to be set in the options field of the
  watchdog's info structure).
  If the watchdog driver does not have to perform any action but setting the
  watchdog_device.timeout, this callback can be omitted.
  If set_timeout is not provided but, WDIOF_SETTIMEOUT is set, the watchdog
  infrastructure updates the timeout value of the watchdog_device internally
  to the requested value.
* get_timeleft: this routines returns the time that's left before a reset.
* restart: this routine restarts the machine. It returns 0 on success or a
  negative errno code for failure.
@@ -169,11 +196,19 @@ The 'ref' and 'unref' operations are no longer used and deprecated.
The status bits should (preferably) be set with the set_bit and clear_bit alike
bit-operations. The status bits that are defined are:
* WDOG_ACTIVE: this status bit indicates whether or not a watchdog timer device
  is active or not. When the watchdog is active after booting, then you should
  set this status bit (Note: when you register the watchdog timer device with
  this bit set, then opening /dev/watchdog will skip the start operation)
  is active or not from user perspective. User space is expected to send
  heartbeat requests to the driver while this flag is set.
* WDOG_NO_WAY_OUT: this bit stores the nowayout setting for the watchdog.
  If this bit is set then the watchdog timer will not be able to stop.
* WDOG_HW_RUNNING: Set by the watchdog driver if the hardware watchdog is
  running. The bit must be set if the watchdog timer hardware can not be
  stopped. The bit may also be set if the watchdog timer is running after
  booting, before the watchdog device is opened. If set, the watchdog
  infrastructure will send keepalives to the watchdog hardware while
  WDOG_ACTIVE is not set.
  Note: when you register the watchdog timer device with this bit set,
  then opening /dev/watchdog will skip the start operation but send a keepalive
  request instead.

  To set the WDOG_NO_WAY_OUT status bit (before registering your watchdog
  timer device) you can either:
+12 −0
Original line number Diff line number Diff line
@@ -200,6 +200,11 @@ mv64x60_wdt:
nowayout: Watchdog cannot be stopped once started
	(default=kernel config parameter)
-------------------------------------------------
ni903x_wdt:
timeout: Initial watchdog timeout in seconds (0<timeout<516, default=60)
nowayout: Watchdog cannot be stopped once started
	(default=kernel config parameter)
-------------------------------------------------
nuc900_wdt:
heartbeat: Watchdog heartbeats in seconds.
	(default = 15)
@@ -284,6 +289,13 @@ sbc_fitpc2_wdt:
margin: Watchdog margin in seconds (default 60s)
nowayout: Watchdog cannot be stopped once started
-------------------------------------------------
sbsa_gwdt:
timeout: Watchdog timeout in seconds. (default 10s)
action: Watchdog action at the first stage timeout,
	set to 0 to ignore, 1 to panic. (default=0)
nowayout: Watchdog cannot be stopped once started
	(default=kernel config parameter)
-------------------------------------------------
sc1200wdt:
isapnp: When set to 0 driver ISA PnP support will be disabled (default=1)
io: io port
+6 −0
Original line number Diff line number Diff line
@@ -11965,6 +11965,12 @@ M: David Härdeman <david@hardeman.nu>
S:	Maintained
F:	drivers/media/rc/winbond-cir.c

WINSYSTEMS EBC-C384 WATCHDOG DRIVER
M:	William Breathitt Gray <vilhelm.gray@gmail.com>
L:	linux-watchdog@vger.kernel.org
S:	Maintained
F:	drivers/watchdog/ebc-c384_wdt.c

WINSYSTEMS WS16C48 GPIO DRIVER
M:	William Breathitt Gray <vilhelm.gray@gmail.com>
L:	linux-gpio@vger.kernel.org
+0 −15
Original line number Diff line number Diff line
@@ -194,21 +194,6 @@ void __init lpc32xx_map_io(void)
	iotable_init(lpc32xx_io_desc, ARRAY_SIZE(lpc32xx_io_desc));
}

void lpc23xx_restart(enum reboot_mode mode, const char *cmd)
{
	/* Make sure WDT clocks are enabled */
	__raw_writel(LPC32XX_CLKPWR_PWMCLK_WDOG_EN,
		LPC32XX_CLKPWR_TIMER_CLK_CTRL);

	/* Instant assert of RESETOUT_N with pulse length 1mS */
	__raw_writel(13000, io_p2v(LPC32XX_WDTIM_BASE + 0x18));
	__raw_writel(0x70, io_p2v(LPC32XX_WDTIM_BASE + 0xC));

	/* Wait for watchdog to reset system */
	while (1)
		;
}

static int __init lpc32xx_check_uid(void)
{
	u32 uid[4];
Loading