Skip to contentSkip to conversation

watchdog - v3.6 merge window

GIT PULL Wim Van Sebroeck 1 participant 1 message Jul 23, 2012

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

Hi Linus,

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

This merge set contains:
* conversion of iTCO_wdt and orion_wdt to the generic watchdog API
* uses module_platform_driver() for s3c2410_wdt
* Adds support for Jetway JNF99 Motherboard
* various fixes

This will update the following files:

 char/ipmi/ipmi_watchdog.c |   13 --
 watchdog/Kconfig          |    2 
 watchdog/bcm63xx_wdt.c    |    4 
 watchdog/coh901327_wdt.c  |    7 -
 watchdog/f71808e_wdt.c    |    4 
 watchdog/iTCO_wdt.c       |  213 ++++++++++------------------------------------
 watchdog/ie6xx_wdt.c      |    4 
 watchdog/of_xilinx_wdt.c  |    2 
 watchdog/omap_wdt.c       |   17 ---
 watchdog/orion_wdt.c      |  203 ++++++++++---------------------------------
 watchdog/s3c2410_wdt.c    |   16 ---
 watchdog/sch311x_wdt.c    |   10 +-
 12 files changed, 121 insertions(+), 374 deletions(-)

with these Changes:

commit 0dd6e4847ed8a42e81df6ffaa71129245a6d9d72

Author: Axel Lin <[email protected]>
Date:   Mon Mar 26 11:14:29 2012 +0800

watchdog: orion_wdt: Convert driver to watchdog core

Convert orion_wdt driver to use watchdog framework API.

commit 6b761b2902c56b468370e0ee1691c37e0dae042a

Author: Sachin Kamat <[email protected]>
Date:   Thu Jul 12 17:17:40 2012 +0530

watchdog: s3c2410_wdt: Use module_platform_driver()

module_platform_driver() replaces module_init() and module_exit() and makes the code simpler.

commit 7732c6b96f127bb5d9474715149b4e94e369412c

Author: Wim Van Sebroeck <[email protected]>
Date:   Sun Jul 8 14:57:09 2012 +0200

watchdog: sch311x_wdt: Fix Polarity when starting watchdog

Some motherboards like the Advantech ARK3400 documentation use a non-inverted GPIO pin. We fix this by assuming that the BIOS will set the Polarity bit for the GPIO correctly at startup and we keep the Bit-setting intact when we start and stop the watchdog.

commit 41814eed414ab3cef3d2b857ae3690a2b4888291

Author: Lokesh Vutla <[email protected]>
Date:   Mon Jun 18 10:53:16 2012 +0530

Watchdog: OMAP: Fix the runtime pm code to avoid module getting stuck intransition state.

OMAP watchdog driver is adapted to runtime PM like a general device driver but it is not appropriate. It is causing couple of functional issues.

1. On OMAP4 SYSCLK can't be gated, because of issue with WDTIMER2 module, which constantly stays in "in transition" state. Value of register CM_WKUP_WDTIMER2_CLKCTRL is always 0x00010000 in this case. Issue occurs immediately after first idle, when hwmod framework tries to disable WDTIMER2 functional clock - "wd_timer2_fck". After this module falls to "in transition" state, and SYSCLK gating is blocked.

2. Due to runtime PM, watchdog timer may be completely disabled. In current code base watchdog timer is not disabled only because of issue 1. Otherwise state of WDTIMER2 module will be "Disabled", and there will be no interrupts from omap_wdt. In other words watchdog will not work at all.

Watchdong is a special IP and it should not be disabled otherwise purpose of it itself is defeated. Watchdog functional clock should never be disabled. This patch updates the runtime PM handling in driver so that runtime PM is limited only during probe/shutdown and suspend/resume.

The patch fixes issue 1 and 2

commit 0402450f45673d3c03340cb1e679bf2a1fc0abee

Author: Gerard Snitselaar <[email protected]>
Date:   Wed Jul 4 09:32:11 2012 -0700

watchdog: ie6xx_wdt: section mismatch in ie6xx_wdt_probe()

ie6xx_wdt_probe() calls ie6xx_wdt_debugfs_exit() as part of it's error cleanup path, and ie6xx_wdt_debugfs_exit() is currently annotated __devexit.

commit 5a135f3c72c5bc738a29629d81a99c981b17a736

Author: Florian Fainelli <[email protected]>
Date:   Fri Jun 29 11:14:44 2012 +0200

watchdog: bcm63xx_wdt: fix driver section mismatch

bcm63xx_wdt was used as a platform_driver but was not suffixed with _driver, thus causing section mismatches, fix that.

commit bff23431fe7e2eba939fe4cdaa78d94a4d9497f7

Author: Wim Van Sebroeck <[email protected]>
Date:   Sat Jun 9 14:10:28 2012 +0200

watchdog: iTCO_wdt.c: convert to watchdog core

This patch converts the iTCO_wdt watchdog driver to use the generic watchdog framework.

commit 18cb2ae55f98648caf0d52ef075f38b16aae7ec6

Author: Oskar Schirmer <[email protected]>
Date:   Thu May 31 09:28:43 2012 +0000

char/ipmi: remove local ioctl defines replaced by generic ones

This watchdog driver had ioctl defines introduced locally for pre timeout handling, marked to be removed as soon as a generic replacement would become available.

The latter has actually occurred in 2006, at e05b59fe.

Remove the local duplicates for pre timeout handling.

commit 90fe6c608f8d46e5bb3f31c2d5e1c90475253f79

Author: Michal Simek <[email protected]>
Date:   Thu Jun 21 08:45:40 2012 +0200

watchdog: xilinx: Read clock frequency directly from DT node

Do not use clock-frequency property from parent node. Use it from watchdog node.

commit c362cb597b5c30a32f4228136e0dfd9bf4c5d65b

Author: Linus Walleij <[email protected]>
Date:   Tue Jun 12 19:19:01 2012 +0200

watchdog: coh901327_wdt: use clk_prepare/unprepare

Make sure we prepare/unprepare the COH901327 watchdog timer as is required by the clk API especially if you use common clock.

commit 3017020dc73a3ae222db2cda9b5952f0e4cf7a09

Author: Justin Wheeler <[email protected]>
Date:   Mon Jun 11 01:07:58 2012 -0400

watchdog: f71808e_wdt: Add support for Jetway JNF99 motherboard

The Jetway JNF99 motherboard features a F71869 SuperIO chip, but its watchdog chipset ID appears to be 1007 (as opposed to 0814). Some testing confirmed it behaves the exact same as 0814. So add this chipset ID to the module's ID list so that the Fintek watchdog driver can correctly identify and access it.

For completeness, I added the overal diff below.

Greetings,
Wim.

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

drivers/char/ipmi/ipmi_watchdog.c +0 -13
index 7ed356e..37b8be7 100644
@@ -141,17 +141,6 @@
 
 #define IPMI_WDOG_TIMER_NOT_INIT_RESP	0x80
 
-/* These are here until the real ones get into the watchdog.h interface. */
-#ifndef WDIOC_GETTIMEOUT
-#define	WDIOC_GETTIMEOUT        _IOW(WATCHDOG_IOCTL_BASE, 20, int)
-#endif
-#ifndef WDIOC_SET_PRETIMEOUT
-#define	WDIOC_SET_PRETIMEOUT     _IOW(WATCHDOG_IOCTL_BASE, 21, int)
-#endif
-#ifndef WDIOC_GET_PRETIMEOUT
-#define	WDIOC_GET_PRETIMEOUT     _IOW(WATCHDOG_IOCTL_BASE, 22, int)
-#endif
-
 static DEFINE_MUTEX(ipmi_watchdog_mutex);
 static bool nowayout = WATCHDOG_NOWAYOUT;
 
@@ -732,7 +721,6 @@ static int ipmi_ioctl(struct file *file,
 			return -EFAULT;
 		return 0;
 
-	case WDIOC_SET_PRETIMEOUT:
 	case WDIOC_SETPRETIMEOUT:
 		i = copy_from_user(&val, argp, sizeof(int));
 		if (i)
@@ -740,7 +728,6 @@ static int ipmi_ioctl(struct file *file,
 		pretimeout = val;
 		return ipmi_set_timeout(IPMI_SET_TIMEOUT_HB_IF_NECESSARY);
 
-	case WDIOC_GET_PRETIMEOUT:
 	case WDIOC_GETPRETIMEOUT:
 		i = copy_to_user(argp, &pretimeout, sizeof(pretimeout));
 		if (i)
drivers/watchdog/Kconfig +2 -0
index fe819b7..46e258c 100644
@@ -279,6 +279,7 @@ config DAVINCI_WATCHDOG
 config ORION_WATCHDOG
 	tristate "Orion watchdog"
 	depends on ARCH_ORION5X || ARCH_KIRKWOOD
+	select WATCHDOG_CORE
 	help
 	  Say Y here if to include support for the watchdog timer
 	  in the Marvell Orion5x and Kirkwood ARM SoCs.
@@ -578,6 +579,7 @@ config INTEL_SCU_WATCHDOG
 config ITCO_WDT
 	tristate "Intel TCO Timer/Watchdog"
 	depends on (X86 || IA64) && PCI
+	select WATCHDOG_CORE
 	select LPC_ICH
 	---help---
 	  Hardware driver for the intel TCO timer based watchdog devices.
drivers/watchdog/bcm63xx_wdt.c +2 -2
index 8379dc3..551880b 100644
@@ -302,7 +302,7 @@ static void bcm63xx_wdt_shutdown(struct platform_device *pdev)
 	bcm63xx_wdt_pause();
 }
 
-static struct platform_driver bcm63xx_wdt = {
+static struct platform_driver bcm63xx_wdt_driver = {
 	.probe	= bcm63xx_wdt_probe,
 	.remove = __devexit_p(bcm63xx_wdt_remove),
 	.shutdown = bcm63xx_wdt_shutdown,
@@ -312,7 +312,7 @@ static struct platform_driver bcm63xx_wdt = {
 	}
 };
 
-module_platform_driver(bcm63xx_wdt);
+module_platform_driver(bcm63xx_wdt_driver);
 
 MODULE_AUTHOR("Miguel Gaio <[email protected]>");
 MODULE_AUTHOR("Florian Fainelli <[email protected]>");
drivers/watchdog/coh901327_wdt.c +4 -3
index 6876430..cb5da5c 100644
@@ -263,6 +263,7 @@ static int __exit coh901327_remove(struct platform_device *pdev)
 	watchdog_unregister_device(&coh901327_wdt);
 	coh901327_disable();
 	free_irq(irq, pdev);
+	clk_unprepare(clk);
 	clk_put(clk);
 	iounmap(virtbase);
 	release_mem_region(phybase, physize);
@@ -300,9 +301,9 @@ static int __init coh901327_probe(struct platform_device *pdev)
 		dev_err(&pdev->dev, "could not get clock\n");
 		goto out_no_clk;
 	}
-	ret = clk_enable(clk);
+	ret = clk_prepare_enable(clk);
 	if (ret) {
-		dev_err(&pdev->dev, "could not enable clock\n");
+		dev_err(&pdev->dev, "could not prepare and enable clock\n");
 		goto out_no_clk_enable;
 	}
 
@@ -369,7 +370,7 @@ static int __init coh901327_probe(struct platform_device *pdev)
 out_no_wdog:
 	free_irq(irq, pdev);
 out_no_irq:
-	clk_disable(clk);
+	clk_disable_unprepare(clk);
 out_no_clk_enable:
 	clk_put(clk);
 out_no_clk:
drivers/watchdog/f71808e_wdt.c +3 -1
index c65b0a5..016bd93 100644
@@ -56,6 +56,7 @@
 #define SIO_F71858_ID		0x0507	/* Chipset ID */
 #define SIO_F71862_ID		0x0601	/* Chipset ID */
 #define SIO_F71869_ID		0x0814	/* Chipset ID */
+#define SIO_F71869A_ID		0x1007	/* Chipset ID */
 #define SIO_F71882_ID		0x0541	/* Chipset ID */
 #define SIO_F71889_ID		0x0723	/* Chipset ID */
 
@@ -195,7 +196,7 @@ static inline int superio_enter(int base)
 		return -EBUSY;
 	}
 
-	/* according to the datasheet the key must be send twice! */
+	/* according to the datasheet the key must be sent twice! */
 	outb(SIO_UNLOCK_KEY, base);
 	outb(SIO_UNLOCK_KEY, base);
 
@@ -756,6 +757,7 @@ static int __init f71808e_find(int sioaddr)
 		err = f71862fg_pin_configure(0); /* validate module parameter */
 		break;
 	case SIO_F71869_ID:
+	case SIO_F71869A_ID:
 		watchdog.type = f71869;
 		break;
 	case SIO_F71882_ID:
drivers/watchdog/iTCO_wdt.c +48 -165

327 lines not on this page · raw message

drivers/watchdog/ie6xx_wdt.c +2 -2
index 5f0d776..8f541b9 100644
@@ -232,7 +232,7 @@ static void __devinit ie6xx_wdt_debugfs_init(void)
 		S_IFREG | S_IRUGO, NULL, NULL, &ie6xx_wdt_dbg_operations);
 }
 
-static void __devexit ie6xx_wdt_debugfs_exit(void)
+static void ie6xx_wdt_debugfs_exit(void)
 {
 	debugfs_remove(ie6xx_wdt_data.debugfs);
 }
@@ -242,7 +242,7 @@ static void __devinit ie6xx_wdt_debugfs_init(void)
 {
 }
 
-static void __devexit ie6xx_wdt_debugfs_exit(void)
+static void ie6xx_wdt_debugfs_exit(void)
 {
 }
 #endif
drivers/watchdog/of_xilinx_wdt.c +1 -1
index 55d2f66..294fb4e 100644
@@ -297,7 +297,7 @@ static int __devinit xwdt_probe(struct platform_device *pdev)
 
 	no_timeout = 0;
 
-	pfreq = (u32 *)of_get_property(pdev->dev.of_node->parent,
+	pfreq = (u32 *)of_get_property(pdev->dev.of_node,
 					"clock-frequency", NULL);
 
 	if (pfreq == NULL) {
drivers/watchdog/omap_wdt.c +0 -17
index 8285d65..27ab8db 100644
@@ -126,8 +126,6 @@ static void omap_wdt_set_timeout(struct omap_wdt_dev *wdev)
 	u32 pre_margin = GET_WLDR_VAL(timer_margin);
 	void __iomem *base = wdev->base;
 
-	pm_runtime_get_sync(wdev->dev);
-
 	/* just count up at 32 KHz */
 	while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x04)
 		cpu_relax();
@@ -135,8 +133,6 @@ static void omap_wdt_set_timeout(struct omap_wdt_dev *wdev)
 	__raw_writel(pre_margin, base + OMAP_WATCHDOG_LDR);
 	while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x04)
 		cpu_relax();
-
-	pm_runtime_put_sync(wdev->dev);
 }
 
 /*
@@ -166,8 +162,6 @@ static int omap_wdt_open(struct inode *inode, struct file *file)
 	omap_wdt_ping(wdev); /* trigger loading of new timeout value */
 	omap_wdt_enable(wdev);
 
-	pm_runtime_put_sync(wdev->dev);
-
 	return nonseekable_open(inode, file);
 }
 
@@ -179,8 +173,6 @@ static int omap_wdt_release(struct inode *inode, struct file *file)
 	 *      Shut off the timer unless NOWAYOUT is defined.
 	 */
 #ifndef CONFIG_WATCHDOG_NOWAYOUT
-	pm_runtime_get_sync(wdev->dev);
-
 	omap_wdt_disable(wdev);
 
 	pm_runtime_put_sync(wdev->dev);
@@ -199,11 +191,9 @@ static ssize_t omap_wdt_write(struct file *file, const char __user *data,
 
 	/* Refresh LOAD_TIME. */
 	if (len) {
-		pm_runtime_get_sync(wdev->dev);
 		spin_lock(&wdt_lock);
 		omap_wdt_ping(wdev);
 		spin_unlock(&wdt_lock);
-		pm_runtime_put_sync(wdev->dev);
 	}
 	return len;
 }
@@ -236,18 +226,15 @@ static long omap_wdt_ioctl(struct file *file, unsigned int cmd,
 					(int __user *)arg);
 		return put_user(0, (int __user *)arg);
 	case WDIOC_KEEPALIVE:
-		pm_runtime_get_sync(wdev->dev);
 		spin_lock(&wdt_lock);
 		omap_wdt_ping(wdev);
 		spin_unlock(&wdt_lock);
-		pm_runtime_put_sync(wdev->dev);
 		return 0;
 	case WDIOC_SETTIMEOUT:
 		if (get_user(new_margin, (int __user *)arg))
 			return -EFAULT;
 		omap_wdt_adjust_timeout(new_margin);
 
-		pm_runtime_get_sync(wdev->dev);
 		spin_lock(&wdt_lock);
 		omap_wdt_disable(wdev);
 		omap_wdt_set_timeout(wdev);
@@ -255,7 +242,6 @@ static long omap_wdt_ioctl(struct file *file, unsigned int cmd,
 
 		omap_wdt_ping(wdev);
 		spin_unlock(&wdt_lock);
-		pm_runtime_put_sync(wdev->dev);
 		/* Fall */
 	case WDIOC_GETTIMEOUT:
 		return put_user(timer_margin, (int __user *)arg);
@@ -363,7 +349,6 @@ static void omap_wdt_shutdown(struct platform_device *pdev)
 	struct omap_wdt_dev *wdev = platform_get_drvdata(pdev);
 
 	if (wdev->omap_wdt_users) {
-		pm_runtime_get_sync(wdev->dev);
 		omap_wdt_disable(wdev);
 		pm_runtime_put_sync(wdev->dev);
 	}
@@ -403,7 +388,6 @@ static int omap_wdt_suspend(struct platform_device *pdev, pm_message_t state)
 	struct omap_wdt_dev *wdev = platform_get_drvdata(pdev);
 
 	if (wdev->omap_wdt_users) {
-		pm_runtime_get_sync(wdev->dev);
 		omap_wdt_disable(wdev);
 		pm_runtime_put_sync(wdev->dev);
 	}
@@ -419,7 +403,6 @@ static int omap_wdt_resume(struct platform_device *pdev)
 		pm_runtime_get_sync(wdev->dev);
 		omap_wdt_enable(wdev);
 		omap_wdt_ping(wdev);
-		pm_runtime_put_sync(wdev->dev);
 	}
 
 	return 0;
drivers/watchdog/orion_wdt.c +50 -153

303 lines not on this page · raw message

drivers/watchdog/s3c2410_wdt.c +1 -15
index 200ece5..9245b4d 100644
@@ -519,21 +519,7 @@ static struct platform_driver s3c2410wdt_driver = {
 	},
 };
 
-
-static int __init watchdog_init(void)
-{
-	pr_info("S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics\n");
-
-	return platform_driver_register(&s3c2410wdt_driver);
-}
-
-static void __exit watchdog_exit(void)
-{
-	platform_driver_unregister(&s3c2410wdt_driver);
-}
-
-module_init(watchdog_init);
-module_exit(watchdog_exit);
+module_platform_driver(s3c2410wdt_driver);
 
 MODULE_AUTHOR("Ben Dooks <[email protected]>, "
 	      "Dimitry Andric <[email protected]>");
drivers/watchdog/sch311x_wdt.c +8 -2
index f847700..9681ada 100644
@@ -136,6 +136,8 @@ static void sch311x_wdt_set_timeout(int t)
 
 static void sch311x_wdt_start(void)
 {
+	unsigned char t;
+
 	spin_lock(&sch311x_wdt_data.io_lock);
 
 	/* set watchdog's timeout */
@@ -149,7 +151,8 @@ static void sch311x_wdt_start(void)
 	 * Bit 4-6  (Reserved)
 	 * Bit 7,   Output Type: 0 = Push Pull Bit, 1 = Open Drain
 	 */
-	outb(0x0e, sch311x_wdt_data.runtime_reg + GP60);
+	t = inb(sch311x_wdt_data.runtime_reg + GP60);
+	outb((t & ~0x0d) | 0x0c, sch311x_wdt_data.runtime_reg + GP60);
 
 	spin_unlock(&sch311x_wdt_data.io_lock);
 
@@ -157,10 +160,13 @@ static void sch311x_wdt_start(void)
 
 static void sch311x_wdt_stop(void)
 {
+	unsigned char t;
+
 	spin_lock(&sch311x_wdt_data.io_lock);
 
 	/* stop the watchdog */
-	outb(0x01, sch311x_wdt_data.runtime_reg + GP60);
+	t = inb(sch311x_wdt_data.runtime_reg + GP60);
+	outb((t & ~0x0d) | 0x01, sch311x_wdt_data.runtime_reg + GP60);
 	/* disable timeout by setting it to 0 */
 	sch311x_wdt_set_timeout(0);
 

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