Skip to contentSkip to conversation

watchdog - v3.18 Merge window

GIT PULL Wim Van Sebroeck 2 participants 2 messages Oct 20, 2014 – Oct 21, 2014

Subsystems (12)
lore
Share & tools
lore
#0 lore raw

Hi Linus,

Sorry for being late. I reckoned you would go for a 2.5 week schedule, but didn't expect a 2 week schedule and since I had to check wether or not the code that the tree is dependent on was allready in, I am now normally to late. So I hope you can still do this pull request.

Please pull from 'master' branch of
git://www.linux-watchdog.org/linux-watchdog.git

It contains following changes:
* Add Cadence WDT Driver
* Add Ricoh RN5T618 watchdog
* Add DA9063 PMIC watchdog driver
* Add Meson WDT driver
* add Restart handling code
* fixes and improvements

This will update the following files:

 Documentation/devicetree/bindings/watchdog/cadence-wdt.txt |   24 
 Documentation/devicetree/bindings/watchdog/fsl-imx-wdt.txt |    3 
 Documentation/devicetree/bindings/watchdog/meson6-wdt.txt  |   13 
 Documentation/devicetree/bindings/watchdog/qcom-wdt.txt    |   24 
 Documentation/devicetree/bindings/watchdog/samsung-wdt.txt |    1 
 arch/arm/configs/multi_v7_defconfig                        |    1 
 drivers/watchdog/Kconfig                                   |   54 +
 drivers/watchdog/Makefile                                  |    5 
 drivers/watchdog/booke_wdt.c                               |   28 
 drivers/watchdog/cadence_wdt.c                             |  516 +++++++++++++
 drivers/watchdog/da9063_wdt.c                              |  191 ++++
 drivers/watchdog/dw_wdt.c                                  |   36 
 drivers/watchdog/imx2_wdt.c                                |   43 -
 drivers/watchdog/meson_wdt.c                               |  236 +++++
 drivers/watchdog/of_xilinx_wdt.c                           |    1 
 drivers/watchdog/qcom-wdt.c                                |  224 +++++
 drivers/watchdog/rn5t618_wdt.c                             |  198 ++++
 drivers/watchdog/s3c2410_wdt.c                             |   47 +
 drivers/watchdog/stmp3xxx_rtc_wdt.c                        |   24 
 drivers/watchdog/sunxi_wdt.c                               |  111 ++
 drivers/watchdog/ts72xx_wdt.c                              |    6 
 include/linux/watchdog.h                                   |    9 
 22 files changed, 1725 insertions(+), 70 deletions(-)

with these Changes:

commit 06980b24cf9bfcc753a07ee362976169bb869869

Author: Carlo Caione <[email protected]>
Date:   Thu Oct 9 21:59:16 2014 +0200

watchdog: meson: remove magic value for reboot

This patch removes the magic value used for rebooting the board. This value is useless and leads to a static checker warning as reported by Dan Carpenter.

commit 71fd380a6b87f384002feceda39fd670ede7ea5f

Author: Chen Gang <[email protected]>
Date:   Sun Oct 5 09:28:33 2014 +0800

watchdog: Let XILINX_WATCHDOG and TEGRA_WATCHDOG depend on HAS_IOMEM

They need HAS_IOMEM, so let them depend on it, the related error (with allmodconfig under um):

MODPOST 1205 modules
ERROR: "devm_ioremap_resource" [drivers/watchdog/tegra_wdt.ko] undefined!
ERROR: "devm_ioremap_resource" [drivers/watchdog/of_xilinx_wdt.ko] undefined!

commit c5ec618fbf83045b9d51679d809ddd45f990fe0a

Author: Chen-Yu Tsai <[email protected]>
Date:   Mon Sep 22 00:05:19 2014 +0800

watchdog: sunxi: Add A31 watchdog support

This patch adds support for the watchdog hardware found in A31 and newer SoCs. This new hardware has registers at different offsets, and the system reset control has been split out of the "mode" register into a new "configuration" register.

Differences not supported by this driver include separate interrupt lines for each watchdog, instead of sharing an interrupt line and registers with the timer block.

commit f2147de334703c7c44372f013d7d466d756e6943

Author: Chen-Yu Tsai <[email protected]>
Date:   Mon Sep 22 00:05:18 2014 +0800

watchdog: sunxi: support parameterized compatible strings

This patch adds support for hardware parameters tied to compatible strings, so similar hardware can reuse the driver.

This will be used to support the newer watchdog found in A31 and later SoCs. Differences in the new hardware include separate interrupt lines for each watchdog, and corresponding interrupt control/status registers. Watchdog control registers were also slightly rearranged.

Also replace ioread32()/iowrite32() with readl()/writel() in various places changed.

commit 334a9d8131254e06685b2af0c0f3cc7b3ec5bd04

Author: Jingchang Lu <[email protected]>
Date:   Fri Sep 12 15:24:36 2014 +0800

watchdog: imx2_wdt: add restart handler support

Register the watchdog as the system restart function
to the new introducing kernel restart call chain in the driver instead of providing the restart in machine desc.
This restart handler function is from the mxc_restart()
in arch/arm/mach-imx/system.c

commit 05e487d905ab29b5756d6d1e47e27eefa6693fb3

Author: Josh Cartwright <[email protected]>
Date:   Thu Sep 25 17:51:04 2014 -0500

watchdog: qcom: register a restart notifier

The WDT's BITE_TIME warm-reset behavior can be leveraged as a last resort mechanism for triggering chip reset. Usually, other restart methods (such as PS_HOLD) are preferrable for issuing a more complete reset of the chip. As such, keep the priority of the watchdog notifier low.

commit f286e1335f579dfd970c7fc3f62b248773a47a5c

Author: Heiko Stuebner <[email protected]>
Date:   Tue Aug 19 17:45:36 2014 -0700

watchdog: s3c2410: add restart handler

On a lot of Samsung systems the watchdog is responsible for restarting the system and until now this code was contained in plat-samsung/watchdog-reset.c.

With the introduction of the restart handlers, this code can now move into driver itself, removing the need for arch-specific code.

Tested on a S3C2442 based GTA02

commit 31228f43ab528628c9b5f1351604361aa1d78533

Author: Jisheng Zhang <[email protected]>
Date:   Tue Sep 23 15:42:12 2014 +0800

watchdog: dw_wdt: add restart handler support

The kernel core now provides an API to trigger a system restart. Register with it to support restarting the system via. watchdog.

commit 69a160a0543fd569661048a8692c10afcdb1914b

Author: Carlo Caione <[email protected]>
Date:   Sat Sep 20 19:06:52 2014 +0200

ARM: defconfig: update multi_v7_defconfig

Update the multi_v7_defconfig enabling the watchdog driver for Meson SoCs.

commit 22e1b8f60f913cf71e688af9b64317b515303f4c

Author: Carlo Caione <[email protected]>
Date:   Sat Sep 20 19:06:50 2014 +0200

ARM: meson: add watchdog driver

This patch adds the watchdog driver for the Amlogic Meson SoCs used also to reboot the device.

commit 0c5691f00879cacf98a31b873c02d71c66d72855

Author: Carlo Caione <[email protected]>
Date:   Sat Sep 20 19:06:49 2014 +0200

ARM: docs: add documentation binding for meson watchdog

commit 3281b85c8697938e344d67144ca8ba520fa54d2b

Author: Janusz Uzycki <[email protected]>
Date:   Mon Sep 22 22:55:47 2014 +0200

stmp3xxx_rtc_wdt: Add suspend/resume PM support

There is no conflict with rtc/rtc-stmp3xxx.c parent because modified registers in PM functions of stmp3xxx_rtc_wdt are different.

commit 5e9c16e3760893b3721f599f180795ca7160afef

Author: Krystian Garbaciak <[email protected]>
Date:   Sun Sep 28 19:05:45 2014 +0200

watchdog: Add DA9063 PMIC watchdog driver.

This driver supports the watchdog device inside the DA9063 PMIC.

commit 22b1c841e31510c3124c88a13b8a7ada14e2e2d1

Author: Beniamino Galvani <[email protected]>
Date:   Mon Sep 29 00:39:47 2014 +0200

watchdog: add driver for Ricoh RN5T618 watchdog

This adds a driver for the watchdog timer available in Ricoh RN5T618 PMIC. The device supports a programmable expiration time of 1, 8, 32 or 128 seconds.

commit 2b9366b669679f1388457ec5a62f9dd1d0a78b08

Author: Naveen Krishna Chatradhi <[email protected]>
Date:   Wed Aug 27 15:17:11 2014 +0530

watchdog: s3c2410_wdt: Add support for Watchdog device on Exynos7

Exynos7 SoC has a Watchdog for Atlas (A57) cores This patch adds support for the Atlas watchdog.

commit 7c92c3d58429c38557ffd7e6a69dc97522335454

Author: Josh Cartwright <[email protected]>
Date:   Thu Sep 25 17:51:03 2014 -0500

watchdog: qcom: document device tree bindings

The Qualcomm Krait Processor Sub-system (KPSS) contains one or more instances of the WDT. Provide documentation on how to describe these in the device tree.

commit 1094ebe9d1e1dde0754ff8cede16159fb20b2f3b

Author: Josh Cartwright <[email protected]>
Date:   Thu Sep 25 17:51:02 2014 -0500

watchdog: qcom: add support for KPSS WDT

Add a driver for the watchdog timer block found in the Krait Processor Subsystem (KPSS) on the MSM8960, APQ8064, and IPQ8064.

commit dfa07141e7a792aecf98a8a99dd40df0bf91bce2

Author: Jisheng Zhang <[email protected]>
Date:   Tue Sep 23 15:42:11 2014 +0800

watchdog: dw_wdt: initialise TOP_INIT in dw_wdt_set_top()

The TOP_INIT, ie bit 4-7 of the WDOG_TIMEOUT_RANGE_REG_OFFSET register may be zero, so the timeout period may be very short after initialization is done, thus the system may be reset soon after enabling. We fix this problem by also initialising the TOP_INIT when setting TOP in function dw_wdt_set_top().

commit 191891c0378f44aec8e06e889a08d0b76fe6c5cb

Author: Harini Katakam <[email protected]>
Date:   Fri Aug 22 14:58:02 2014 +0530

devicetree: Add Cadence WDT devicetree bindings documentation

Add cadence-wdt bindings documentation.

commit 58bf016426594e5370e7e7059698a278294db997

Author: Harini Katakam <[email protected]>
Date:   Fri Aug 22 14:58:01 2014 +0530

watchdog: Add Cadence WDT driver

Add Cadence WDT driver. This is used by Xilinx Zynq.

commit 4846e3784585173f48e267b76f968bcb4a12d3b2

Author: Uwe Kleine-König <[email protected]>
Date:   Tue Sep 9 22:18:31 2014 +0200

watchdog: simplify definitions of WATCHDOG_NOWAYOUT(_INIT_STATUS)?

commit 0461aea7ec379b00f4acb5d612bfb2f7a497eb92

Author: Xiubo Li <[email protected]>
Date:   Mon Aug 18 16:12:50 2014 +0800

watchdog: imx2_wdt: Convert to use regmap framework's endianness method.

commit 1f897a81915222310374cac1a85c0c7104f16249

Author: Mika Westerberg <[email protected]>
Date:   Tue Aug 19 14:57:12 2014 +0300

watchdog: ts72xx_wdt: Kill superfluous variable in remove

There is no need to store the return value of misc_deregister() in a variable. Instead we can just return the value directly.

commit 62ce25439a7ea01eba5c2a6a8284e4aa23890042

Author: Pranith Kumar <[email protected]>
Date:   Wed Aug 20 15:26:46 2014 -0400

powerpc: booke_wdt: Fix build error as a module

Building booke_wdt fails when trying to build as a module as there is no early_param() in module. Fix by using module_param() instead of early_param().

commit fca8c0481bc8d751479ca13f454e89a7fdfece03

Author: Michal Simek <[email protected]>
Date:   Wed Aug 13 13:51:28 2014 +0200

watchdog: xilinx: Remove .owner field for driver

There is no need to init .owner field.

Based on the patch from Peter Griffin <[email protected]> "mmc: remove .owner field for drivers using module_platform_driver"

This patch removes the superflous .owner field for drivers which use the module_platform_driver API, as this is overriden in platform_driver_register anyway."

For completeness, I added the overal diff below.

Greetings,
Wim.

================================================================================

Documentation/devicetree/bindings/watchdog/cadence-wdt.txt new file +24 -0
new file mode 100644
index 0000000..c3a36ee
@@ -0,0 +1,24 @@
+Zynq Watchdog Device Tree Bindings
+-------------------------------------------
+
+Required properties:
+- compatible		: Should be "cdns,wdt-r1p2".
+- clocks		: This is pclk (APB clock).
+- interrupts		: This is wd_irq - watchdog timeout interrupt.
+- interrupt-parent	: Must be core interrupt controller.
+
+Optional properties
+- reset-on-timeout	: If this property exists, then a reset is done
+			  when watchdog times out.
+- timeout-sec		: Watchdog timeout value (in seconds).
+
+Example:
+	watchdog@f8005000 {
+		compatible = "cdns,wdt-r1p2";
+		clocks = <&clkc 45>;
+		interrupt-parent = <&intc>;
+		interrupts = <0 9 1>;
+		reg = <0xf8005000 0x1000>;
+		reset-on-timeout;
+		timeout-sec = <10>;
+	};
Documentation/devicetree/bindings/watchdog/fsl-imx-wdt.txt +2 -1
index e52ba2d..8dab6fd 100644
@@ -7,7 +7,8 @@ Required properties:
 
 Optional property:
 - big-endian: If present the watchdog device's registers are implemented
-  in big endian mode, otherwise in little mode.
+  in big endian mode, otherwise in native mode(same with CPU), for more
+  detail please see: Documentation/devicetree/bindings/regmap/regmap.txt.
 
 Examples:
 
Documentation/devicetree/bindings/watchdog/meson6-wdt.txt new file +13 -0
new file mode 100644
index 0000000..9200fc2
@@ -0,0 +1,13 @@
+Meson SoCs Watchdog timer
+
+Required properties:
+
+- compatible : should be "amlogic,meson6-wdt"
+- reg : Specifies base physical address and size of the registers.
+
+Example:
+
+wdt: watchdog@c1109900 {
+	compatible = "amlogic,meson6-wdt";
+	reg = <0xc1109900 0x8>;
+};
Documentation/devicetree/bindings/watchdog/qcom-wdt.txt new file +24 -0
new file mode 100644
index 0000000..4726924
@@ -0,0 +1,24 @@
+Qualcomm Krait Processor Sub-system (KPSS) Watchdog
+---------------------------------------------------
+
+Required properties :
+- compatible : shall contain only one of the following:
+
+			"qcom,kpss-wdt-msm8960"
+			"qcom,kpss-wdt-apq8064"
+			"qcom,kpss-wdt-ipq8064"
+
+- reg : shall contain base register location and length
+- clocks : shall contain the input clock
+
+Optional properties :
+- timeout-sec : shall contain the default watchdog timeout in seconds,
+                if unset, the default timeout is 30 seconds
+
+Example:
+	watchdog@208a038 {
+		compatible = "qcom,kpss-wdt-ipq8064";
+		reg = <0x0208a038 0x40>;
+		clocks = <&sleep_clk>;
+		timeout-sec = <10>;
+	};
Documentation/devicetree/bindings/watchdog/samsung-wdt.txt +1 -0
index cfff375..8f3d96a 100644
@@ -9,6 +9,7 @@ Required properties:
 	(a) "samsung,s3c2410-wdt" for Exynos4 and previous SoCs
 	(b) "samsung,exynos5250-wdt" for Exynos5250
 	(c) "samsung,exynos5420-wdt" for Exynos5420
+	(c) "samsung,exynos7-wdt" for Exynos7
 
 - reg : base physical address of the controller and length of memory mapped
 	region.
arch/arm/configs/multi_v7_defconfig +1 -0
index 491b7d5..9702b14 100644
@@ -261,6 +261,7 @@ CONFIG_WATCHDOG=y
 CONFIG_XILINX_WATCHDOG=y
 CONFIG_ORION_WATCHDOG=y
 CONFIG_SUNXI_WATCHDOG=y
+CONFIG_MESON_WATCHDOG=y
 CONFIG_MFD_AS3722=y
 CONFIG_MFD_BCM590XX=y
 CONFIG_MFD_CROS_EC=y
drivers/watchdog/Kconfig +53 -1

90 lines not on this page · raw message

drivers/watchdog/Makefile +5 -0
index de17014..c569ec8 100644
@@ -32,6 +32,7 @@ obj-$(CONFIG_USBPCWATCHDOG) += pcwd_usb.o
 obj-$(CONFIG_ARM_SP805_WATCHDOG) += sp805_wdt.o
 obj-$(CONFIG_AT91RM9200_WATCHDOG) += at91rm9200_wdt.o
 obj-$(CONFIG_AT91SAM9X_WATCHDOG) += at91sam9_wdt.o
+obj-$(CONFIG_CADENCE_WATCHDOG) += cadence_wdt.o
 obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o
 obj-$(CONFIG_TWL4030_WATCHDOG) += twl4030_wdt.o
 obj-$(CONFIG_21285_WATCHDOG) += wdt285.o
@@ -47,6 +48,7 @@ obj-$(CONFIG_IOP_WATCHDOG) += iop_wdt.o
 obj-$(CONFIG_DAVINCI_WATCHDOG) += davinci_wdt.o
 obj-$(CONFIG_ORION_WATCHDOG) += orion_wdt.o
 obj-$(CONFIG_SUNXI_WATCHDOG) += sunxi_wdt.o
+obj-$(CONFIG_RN5T618_WATCHDOG) += rn5t618_wdt.o
 obj-$(CONFIG_COH901327_WATCHDOG) += coh901327_wdt.o
 obj-$(CONFIG_STMP3XXX_RTC_WATCHDOG) += stmp3xxx_rtc_wdt.o
 obj-$(CONFIG_NUC900_WATCHDOG) += nuc900_wdt.o
@@ -57,8 +59,10 @@ obj-$(CONFIG_RETU_WATCHDOG) += retu_wdt.o
 obj-$(CONFIG_BCM2835_WDT) += bcm2835_wdt.o
 obj-$(CONFIG_MOXART_WDT) += moxart_wdt.o
 obj-$(CONFIG_SIRFSOC_WATCHDOG) += sirfsoc_wdt.o
+obj-$(CONFIG_QCOM_WDT) += qcom-wdt.o
 obj-$(CONFIG_BCM_KONA_WDT) += bcm_kona_wdt.o
 obj-$(CONFIG_TEGRA_WATCHDOG) += tegra_wdt.o
+obj-$(CONFIG_MESON_WATCHDOG) += meson_wdt.o
 
 # AVR32 Architecture
 obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o
@@ -173,6 +177,7 @@ obj-$(CONFIG_XEN_WDT) += xen_wdt.o
 # Architecture Independent
 obj-$(CONFIG_DA9052_WATCHDOG) += da9052_wdt.o
 obj-$(CONFIG_DA9055_WATCHDOG) += da9055_wdt.o
+obj-$(CONFIG_DA9063_WATCHDOG) += da9063_wdt.o
 obj-$(CONFIG_GPIO_WATCHDOG)	+= gpio_wdt.o
 obj-$(CONFIG_WM831X_WATCHDOG) += wm831x_wdt.o
 obj-$(CONFIG_WM8350_WATCHDOG) += wm8350_wdt.o
drivers/watchdog/booke_wdt.c +5 -23
index 08a7853..e96b09b 100644
@@ -30,8 +30,6 @@
  * occur, and the final time the board will reset.
  */
 
-u32 booke_wdt_enabled;
-u32 booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
 
 #ifdef	CONFIG_PPC_FSL_BOOK3E
 #define WDTP(x)		((((x)&0x3)<<30)|(((x)&0x3c)<<15))
@@ -41,27 +39,10 @@ u32 booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
 #define WDTP_MASK	(TCR_WP_MASK)
 #endif
 
-/* Checks wdt=x and wdt_period=xx command-line option */
-notrace int __init early_parse_wdt(char *p)
-{
-	if (p && strncmp(p, "0", 1) != 0)
-		booke_wdt_enabled = 1;
-
-	return 0;
-}
-early_param("wdt", early_parse_wdt);
-
-int __init early_parse_wdt_period(char *p)
-{
-	unsigned long ret;
-	if (p) {
-		if (!kstrtol(p, 0, &ret))
-			booke_wdt_period = ret;
-	}
-
-	return 0;
-}
-early_param("wdt_period", early_parse_wdt_period);
+static bool booke_wdt_enabled;
+module_param(booke_wdt_enabled, bool, 0);
+static int  booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT;
+module_param(booke_wdt_period, int, 0);
 
 #ifdef CONFIG_PPC_FSL_BOOK3E
 
@@ -259,5 +240,6 @@ static int __init booke_wdt_init(void)
 module_init(booke_wdt_init);
 module_exit(booke_wdt_exit);
 
+MODULE_ALIAS("booke_wdt");
 MODULE_DESCRIPTION("PowerPC Book-E watchdog driver");
 MODULE_LICENSE("GPL");
drivers/watchdog/cadence_wdt.c new file +516 -0

516 lines not on this page · raw message

drivers/watchdog/da9063_wdt.c new file +191 -0

191 lines not on this page · raw message

drivers/watchdog/dw_wdt.c +35 -1
index 9f21029..9e577a6 100644
@@ -21,6 +21,7 @@
 
 #include <linux/bitops.h>
 #include <linux/clk.h>
+#include <linux/delay.h>
 #include <linux/device.h>
 #include <linux/err.h>
 #include <linux/fs.h>
@@ -29,9 +30,11 @@
 #include <linux/miscdevice.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
+#include <linux/notifier.h>
 #include <linux/of.h>
 #include <linux/pm.h>
 #include <linux/platform_device.h>
+#include <linux/reboot.h>
 #include <linux/spinlock.h>
 #include <linux/timer.h>
 #include <linux/uaccess.h>
@@ -40,6 +43,7 @@
 #define WDOG_CONTROL_REG_OFFSET		    0x00
 #define WDOG_CONTROL_REG_WDT_EN_MASK	    0x01
 #define WDOG_TIMEOUT_RANGE_REG_OFFSET	    0x04
+#define WDOG_TIMEOUT_RANGE_TOPINIT_SHIFT    4
 #define WDOG_CURRENT_COUNT_REG_OFFSET	    0x08
 #define WDOG_COUNTER_RESTART_REG_OFFSET     0x0c
 #define WDOG_COUNTER_RESTART_KICK_VALUE	    0x76
@@ -62,6 +66,7 @@ static struct {
 	unsigned long		next_heartbeat;
 	struct timer_list	timer;
 	int			expect_close;
+	struct notifier_block	restart_handler;
 } dw_wdt;
 
 static inline int dw_wdt_is_enabled(void)
@@ -106,7 +111,8 @@ static int dw_wdt_set_top(unsigned top_s)
 		}
 
 	/* Set the new value in the watchdog. */
-	writel(top_val, dw_wdt.regs + WDOG_TIMEOUT_RANGE_REG_OFFSET);
+	writel(top_val | top_val << WDOG_TIMEOUT_RANGE_TOPINIT_SHIFT,
+		dw_wdt.regs + WDOG_TIMEOUT_RANGE_REG_OFFSET);
 
 	dw_wdt_set_next_heartbeat();
 
@@ -119,6 +125,26 @@ static void dw_wdt_keepalive(void)
 	       WDOG_COUNTER_RESTART_REG_OFFSET);
 }
 
+static int dw_wdt_restart_handle(struct notifier_block *this,
+				unsigned long mode, void *cmd)
+{
+	u32 val;
+
+	writel(0, dw_wdt.regs + WDOG_TIMEOUT_RANGE_REG_OFFSET);
+	val = readl(dw_wdt.regs + WDOG_CONTROL_REG_OFFSET);
+	if (val & WDOG_CONTROL_REG_WDT_EN_MASK)
+		writel(WDOG_COUNTER_RESTART_KICK_VALUE, dw_wdt.regs +
+			WDOG_COUNTER_RESTART_REG_OFFSET);
+	else
+		writel(WDOG_CONTROL_REG_WDT_EN_MASK,
+		       dw_wdt.regs + WDOG_CONTROL_REG_OFFSET);
+
+	/* wait for reset to assert... */
+	mdelay(500);
+
+	return NOTIFY_DONE;
+}
+
 static void dw_wdt_ping(unsigned long data)
 {
 	if (time_before(jiffies, dw_wdt.next_heartbeat) ||
@@ -314,6 +340,12 @@ static int dw_wdt_drv_probe(struct platform_device *pdev)
 	if (ret)
 		goto out_disable_clk;
 
+	dw_wdt.restart_handler.notifier_call = dw_wdt_restart_handle;
+	dw_wdt.restart_handler.priority = 128;
+	ret = register_restart_handler(&dw_wdt.restart_handler);
+	if (ret)
+		pr_warn("cannot register restart handler\n");
+
 	dw_wdt_set_next_heartbeat();
 	setup_timer(&dw_wdt.timer, dw_wdt_ping, 0);
 	mod_timer(&dw_wdt.timer, jiffies + WDT_TIMEOUT);
@@ -328,6 +360,8 @@ out_disable_clk:
 
 static int dw_wdt_drv_remove(struct platform_device *pdev)
 {
+	unregister_restart_handler(&dw_wdt.restart_handler);
+
 	misc_deregister(&dw_wdt_miscdev);
 
 	clk_disable_unprepare(dw_wdt.clk);
drivers/watchdog/imx2_wdt.c +37 -6

97 lines not on this page · raw message

drivers/watchdog/meson_wdt.c new file +236 -0

236 lines not on this page · raw message

drivers/watchdog/of_xilinx_wdt.c +0 -1
index 1e6e28d..b2e1b4c 100644
@@ -236,7 +236,6 @@ static struct platform_driver xwdt_driver = {
 	.probe       = xwdt_probe,
 	.remove      = xwdt_remove,
 	.driver = {
-		.owner = THIS_MODULE,
 		.name  = WATCHDOG_NAME,
 		.of_match_table = xwdt_of_match,
 	},
drivers/watchdog/qcom-wdt.c new file +224 -0

224 lines not on this page · raw message

drivers/watchdog/rn5t618_wdt.c new file +198 -0

198 lines not on this page · raw message

drivers/watchdog/s3c2410_wdt.c +47 -0

89 lines not on this page · raw message

drivers/watchdog/stmp3xxx_rtc_wdt.c +24 -0
index 3804d5e..a62b1b6 100644
@@ -94,9 +94,33 @@ static int stmp3xxx_wdt_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static int __maybe_unused stmp3xxx_wdt_suspend(struct device *dev)
+{
+	struct watchdog_device *wdd = &stmp3xxx_wdd;
+
+	if (watchdog_active(wdd))
+		return wdt_stop(wdd);
+
+	return 0;
+}
+
+static int __maybe_unused stmp3xxx_wdt_resume(struct device *dev)
+{
+	struct watchdog_device *wdd = &stmp3xxx_wdd;
+
+	if (watchdog_active(wdd))
+		return wdt_start(wdd);
+
+	return 0;
+}
+
+static SIMPLE_DEV_PM_OPS(stmp3xxx_wdt_pm_ops,
+			 stmp3xxx_wdt_suspend, stmp3xxx_wdt_resume);
+
 static struct platform_driver stmp3xxx_wdt_driver = {
 	.driver = {
 		.name = "stmp3xxx_rtc_wdt",
+		.pm = &stmp3xxx_wdt_pm_ops,
 	},
 	.probe = stmp3xxx_wdt_probe,
 	.remove = stmp3xxx_wdt_remove,
drivers/watchdog/sunxi_wdt.c +86 -25

215 lines not on this page · raw message

drivers/watchdog/ts72xx_wdt.c +1 -5
index afa9d6e..dee9c6c 100644
@@ -428,11 +428,7 @@ static int ts72xx_wdt_probe(struct platform_device *pdev)
 
 static int ts72xx_wdt_remove(struct platform_device *pdev)
 {
-	int error;
-
-	error = misc_deregister(&ts72xx_wdt_miscdev);
-
-	return error;
+	return misc_deregister(&ts72xx_wdt_miscdev);
 }
 
 static struct platform_driver ts72xx_wdt_driver = {
include/linux/watchdog.h +2 -7
index 2a3038e..395b70e 100644
@@ -97,13 +97,8 @@ struct watchdog_device {
 #define WDOG_UNREGISTERED	4	/* Has the device been unregistered */
 };
 
-#ifdef CONFIG_WATCHDOG_NOWAYOUT
-#define WATCHDOG_NOWAYOUT		1
-#define WATCHDOG_NOWAYOUT_INIT_STATUS	(1 << WDOG_NO_WAY_OUT)
-#else
-#define WATCHDOG_NOWAYOUT		0
-#define WATCHDOG_NOWAYOUT_INIT_STATUS	0
-#endif
+#define WATCHDOG_NOWAYOUT		IS_BUILTIN(CONFIG_WATCHDOG_NOWAYOUT)
+#define WATCHDOG_NOWAYOUT_INIT_STATUS	(WATCHDOG_NOWAYOUT << WDOG_NO_WAY_OUT)
 
 /* Use the following function to check whether or not the watchdog is active */
 static inline bool watchdog_active(struct watchdog_device *wdd)
#1 lore raw

Hello Wim,

Quoted 7 lines · Wim Van Sebroeck

commit 4846e3784585173f48e267b76f968bcb4a12d3b2

Author: Uwe Kleine-König <[email protected]>
Date:   Tue Sep 9 22:18:31 2014 +0200

watchdog: simplify definitions of WATCHDOG_NOWAYOUT(_INIT_STATUS)?

I guess it's too late, but somehow my name got mangled here ...

If you consider fixing it (assuming an utf-8 locale):

	git filter-branch --msg-filter 'sed s/=C3=B6/ö/' linus/master..master

Best regards
Uwe

Quoted 2 lines
Signature · 6 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html