Skip to contentSkip to conversation

linux-2.6-watchdog-mm patches

WATCHDOG Wim Van Sebroeck 2 participants 2 messages Mar 15, 2005

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

Hi Andrew,

please do a

bk pull http://linux-watchdog.bkbits.net/linux-2.6-watchdog-mm

This will update the following files:

 drivers/char/watchdog/Kconfig       |   14 
 drivers/char/watchdog/Makefile      |   86 +++---
 drivers/char/watchdog/i6300esb.c    |  508 ++++++++++++++++++++++++++++++++++++
 drivers/char/watchdog/i6300esb.h    |   62 ++++
 drivers/char/watchdog/i8xx_tco.c    |    1 
 drivers/char/watchdog/ixp2000_wdt.c |    2 
 drivers/char/watchdog/ixp4xx_wdt.c  |    2 
 drivers/char/watchdog/mv64x60_wdt.c |  252 +++++++++++++++++
 drivers/char/watchdog/pcwd_pci.c    |    6 
 drivers/char/watchdog/pcwd_usb.c    |    6 
 drivers/char/watchdog/s3c2410_wdt.c |   95 ++++--
 drivers/char/watchdog/sa1100_wdt.c  |    2 
 drivers/char/watchdog/scx200_wdt.c  |    2 
 include/asm-ppc/mv64x60.h           |    8 
 14 files changed, 969 insertions(+), 77 deletions(-)

through these ChangeSets:

<[email protected]> (05/03/15 1.2187)
[WATCHDOG] pcwd_usb: usb_control_msg-timeout-patch

set timeout in usb_control_msg to USB_COMMAND_TIMEOUT instead of a full second.

<[email protected]> (05/03/15 1.2188)
[WATCHDOG] s3c2410-divide-patch

The s3c2410 watchdog driver has an incorrect /2 in the timer calculation, fix this problem

<[email protected]> (05/03/15 1.2189)
[WATCHDOG] pcwd_pci-register-driver-patch

convert from pci_module_init to pci_register_driver

<[email protected]> (05/03/15 1.2190)
[WATCHDOG] Makefile-patch

The comment at the top of the Makefile suggests that the current ordering is incorrect.

<[email protected]> (05/03/15 1.2191)
[WATCHDOG] correct sysfs name for watchdog devices

While looking for possible candidates for our udev.rules package, I found a few odd ->name properties. /dev/watchdog has minor 130 according to devices.txt. Since all watchdog drivers use the misc_register() call, they will end up in /sys/class/misc/$foo. udev may create the /dev/watchdog node if the driver is loaded. I dont have such a device, so I cant test it.
The drivers below provide names with spaces and even with / in it. Not a big deal, but apps may expect /dev/watchdog.

<[email protected]> (05/03/15 1.2192)
[WATCHDOG] mv64x60_wdt.patch

Add mv64x60 (Marvell Discovery) watchdog support.

<[email protected]> (05/03/15 1.2193)
[WATCHDOG] i6300esb.patch

From: David Hardeman <[email protected]>

I wrote earlier to the list[1] asking for a driver for the watchdog included in the 6300ESB chipset. I got a 2.4 driver via private email from Ross Biro which I've changed into what I hope resembles a 2.6 driver (which was done by looking a lot at the watchdog drivers already in the 2.6 tree).

I've attached the result, and I'm hoping to get some feedback on the coding as a first step. I can't actually test it on the hardware right now as I won't have physical access until April. So my own tests have been limited to "compiles-without-warnings" and "can-be-insmodded-in-other-machine-without-oops".

[1] http://marc.theaimsgroup.com/?l=linux-kernel&m=110711079825794&w=2
[2] http://marc.theaimsgroup.com/?l=linux-kernel&m=110711973917746&w=2

<[email protected]> (05/03/15 1.2194)
From: David Hardeman <[email protected]>

Add support for the intel 6300ESB chipset.

<[email protected]> (05/03/15 1.2195)
[WATCHDOG] s3c2410 watchdog power management

Patch from Dimitry Andric <[email protected]>, updated by Ben Dooks <[email protected]>. Patch is against 2.6.11-mm2

Add power management support to the s3c2410 watchdog, so that it is shut-down over suspend, and re-initialised on resume.

Also add Dimitry to the list of authors.

<[email protected]> (05/03/15 1.2196)
[WATCHDOG] s3c2410 watchdog - replace reboot notifier

Patch from Dimitry Andric <[email protected]>

Change to using platfrom driver's .shutdown method instead of an reboot notifier

<[email protected]> (05/03/15 1.2197)
[WATCHDOG] Makefile-probe_order-patch

Re-arrange Makefile according to what we want to probe first.

The ChangeSets can also be looked at on:

	http://linux-watchdog.bkbits.net:8080/linux-2.6-watchdog-mm

For completeness, I added the patches below.

Greetings,
Wim.

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

drivers/char/watchdog/pcwd_usb.c +3 -3
diff -Nru a/drivers/char/watchdog/pcwd_usb.c b/drivers/char/watchdog/pcwd_usb.c
@@ -56,8 +56,8 @@
 
 
 /* Module and Version Information */
-#define DRIVER_VERSION "1.00"
-#define DRIVER_DATE "12 Jun 2004"
+#define DRIVER_VERSION "1.01"
+#define DRIVER_DATE "15 Mar 2005"
 #define DRIVER_AUTHOR "Wim Van Sebroeck <[email protected]>"
 #define DRIVER_DESC "Berkshire USB-PC Watchdog driver"
 #define DRIVER_LICENSE "GPL"
@@ -227,7 +227,7 @@
 	if (usb_control_msg(usb_pcwd->udev, usb_sndctrlpipe(usb_pcwd->udev, 0),
 			HID_REQ_SET_REPORT, HID_DT_REPORT,
 			0x0200, usb_pcwd->interface_number, buf, sizeof(buf),
-			1000) != sizeof(buf)) {
+			USB_COMMAND_TIMEOUT) != sizeof(buf)) {
 		dbg("usb_pcwd_send_command: error in usb_control_msg for cmd 0x%x 0x%x 0x%x\n", cmd, *msb, *lsb);
 	}
 	/* wait till the usb card processed the command,
drivers/char/watchdog/s3c2410_wdt.c +3 -5
diff -Nru a/drivers/char/watchdog/s3c2410_wdt.c b/drivers/char/watchdog/s3c2410_wdt.c
@@ -27,6 +27,8 @@
  *				Fixed tmr_count / wdt_count confusion
  *				Added configurable debug
  *
+ *	11-Jan-2004	BJD	Fixed divide-by-2 in timeout code
+ *
  *	10-Mar-2005	LCVR	Changed S3C2410_VA to S3C24XX_VA
 */
 
@@ -165,11 +167,7 @@
 	if (timeout < 1)
 		return -EINVAL;
 
-	/* I think someone must have missed a divide-by-2 in the 2410,
-	 * as a divisor of 128 gives half the calculated delay...
-	 */
-
-	freq /= 128/2;
+	freq /= 128;
 	count = timeout * freq;
 
 	DBG("%s: count=%d, timeout=%d, freq=%d\n",
drivers/char/watchdog/pcwd_pci.c +3 -3
diff -Nru a/drivers/char/watchdog/pcwd_pci.c b/drivers/char/watchdog/pcwd_pci.c
@@ -48,8 +48,8 @@
 #include <asm/io.h>
 
 /* Module and version information */
-#define WATCHDOG_VERSION "1.00"
-#define WATCHDOG_DATE "12 Jun 2004"
+#define WATCHDOG_VERSION "1.01"
+#define WATCHDOG_DATE "15 Mar 2005"
 #define WATCHDOG_DRIVER_NAME "PCI-PC Watchdog"
 #define WATCHDOG_NAME "pcwd_pci"
 #define PFX WATCHDOG_NAME ": "
@@ -659,7 +659,7 @@
 {
 	spin_lock_init (&pcipcwd_private.io_lock);
 
-	return pci_module_init(&pcipcwd_driver);
+	return pci_register_driver(&pcipcwd_driver);
 }
 
 static void __exit pcipcwd_cleanup_module(void)
drivers/char/watchdog/Makefile +7 -6
diff -Nru a/drivers/char/watchdog/Makefile b/drivers/char/watchdog/Makefile
@@ -2,11 +2,6 @@
 # Makefile for the WatchDog device drivers.
 #
 
-# Only one watchdog can succeed. We probe the hardware watchdog
-# drivers first, then the softdog driver.  This means if your hardware
-# watchdog dies or is 'borrowed' for some reason the software watchdog
-# still gives you some cover.
-
 obj-$(CONFIG_PCWATCHDOG) += pcwd.o
 obj-$(CONFIG_ACQUIRE_WDT) += acquirewdt.o
 obj-$(CONFIG_ADVANTECH_WDT) += advantechwdt.o
@@ -24,7 +19,6 @@
 obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o
 obj-$(CONFIG_SA1100_WATCHDOG) += sa1100_wdt.o
 obj-$(CONFIG_EUROTECH_WDT) += eurotechwdt.o
-obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o
 obj-$(CONFIG_W83877F_WDT) += w83877f_wdt.o
 obj-$(CONFIG_W83627HF_WDT) += w83627hf_wdt.o
 obj-$(CONFIG_SC520_WDT) += sc520_wdt.o
@@ -39,3 +33,10 @@
 obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o
 obj-$(CONFIG_IXP2000_WATCHDOG) += ixp2000_wdt.o
 obj-$(CONFIG_8xx_WDT) += mpc8xx_wdt.o
+
+# Only one watchdog can succeed. We probe the hardware watchdog
+# drivers first, then the softdog driver.  This means if your hardware
+# watchdog dies or is 'borrowed' for some reason the software watchdog
+# still gives you some cover.
+
+obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o
drivers/char/watchdog/ixp2000_wdt.c +1 -1
diff -Nru a/drivers/char/watchdog/ixp2000_wdt.c b/drivers/char/watchdog/ixp2000_wdt.c
@@ -186,7 +186,7 @@
 static struct miscdevice ixp2000_wdt_miscdev =
 {
 	.minor		= WATCHDOG_MINOR,
-	.name		= "IXP2000 Watchdog",
+	.name		= "watchdog",
 	.fops		= &ixp2000_wdt_fops,
 };
 
drivers/char/watchdog/ixp4xx_wdt.c +1 -1
diff -Nru a/drivers/char/watchdog/ixp4xx_wdt.c b/drivers/char/watchdog/ixp4xx_wdt.c
@@ -180,7 +180,7 @@
 static struct miscdevice ixp4xx_wdt_miscdev =
 {
 	.minor		= WATCHDOG_MINOR,
-	.name		= "IXP4xx Watchdog",
+	.name		= "watchdog",
 	.fops		= &ixp4xx_wdt_fops,
 };
 
drivers/char/watchdog/sa1100_wdt.c +1 -1
diff -Nru a/drivers/char/watchdog/sa1100_wdt.c b/drivers/char/watchdog/sa1100_wdt.c
@@ -176,7 +176,7 @@
 static struct miscdevice sa1100dog_miscdev =
 {
 	.minor		= WATCHDOG_MINOR,
-	.name		= "SA1100/PXA2xx watchdog",
+	.name		= "watchdog",
 	.fops		= &sa1100dog_fops,
 };
 
drivers/char/watchdog/scx200_wdt.c +1 -1
diff -Nru a/drivers/char/watchdog/scx200_wdt.c b/drivers/char/watchdog/scx200_wdt.c
@@ -210,7 +210,7 @@
 
 static struct miscdevice scx200_wdt_miscdev = {
 	.minor = WATCHDOG_MINOR,
-	.name  = NAME,
+	.name  = "watchdog",
 	.fops  = &scx200_wdt_fops,
 };
 
drivers/char/watchdog/Kconfig +4 -0
diff -Nru a/drivers/char/watchdog/Kconfig b/drivers/char/watchdog/Kconfig
@@ -346,6 +346,10 @@
 	tristate "MPC8xx Watchdog Timer"
 	depends on WATCHDOG && 8xx
 
+config MV64X60_WDT
+	tristate "MV64X60 (Marvell Discovery) Watchdog Timer"
+	depends on WATCHDOG && MV64X60
+
 # MIPS Architecture
 
 config INDYDOG
drivers/char/watchdog/Makefile +1 -0
diff -Nru a/drivers/char/watchdog/Makefile b/drivers/char/watchdog/Makefile
@@ -33,6 +33,7 @@
 obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o
 obj-$(CONFIG_IXP2000_WATCHDOG) += ixp2000_wdt.o
 obj-$(CONFIG_8xx_WDT) += mpc8xx_wdt.o
+obj-$(CONFIG_MV64X60_WDT) += mv64x60_wdt.o
 
 # Only one watchdog can succeed. We probe the hardware watchdog
 # drivers first, then the softdog driver.  This means if your hardware
drivers/char/watchdog/mv64x60_wdt.c new file +252 -0

252 lines not on this page · raw message

include/asm-ppc/mv64x60.h +8 -0
diff -Nru a/include/asm-ppc/mv64x60.h b/include/asm-ppc/mv64x60.h
@@ -119,6 +119,14 @@
 
 #define	MV64x60_64BIT_WIN_COUNT			24
 
+/* Watchdog Platform Device, Driver Data */
+#define	MV64x60_WDT_NAME			"wdt"
+
+struct mv64x60_wdt_pdata {
+	int	timeout;	/* watchdog expiry in seconds, default 10 */
+	int	bus_clk;	/* bus clock in MHz, default 133 */
+};
+
 /*
  * Define a structure that's used to pass in config information to the
  * core routines.
drivers/char/watchdog/Kconfig +10 -0
diff -Nru a/drivers/char/watchdog/Kconfig b/drivers/char/watchdog/Kconfig
@@ -252,6 +252,16 @@
 	  To compile this driver as a module, choose M here: the
 	  module will be called i8xx_tco.
 
+config I6300ESB_WDT
+	tristate "Intel 6300ESB Timer/Watchdog"
+	depends on WATCHDOG && X86 && PCI
+	---help---
+	  Hardware driver for the watchdog timer built into the Intel
+	  6300ESB controller hub.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called i6300esb.
+
 config SC1200_WDT
 	tristate "National Semiconductor PC87307/PC97307 (ala SC1200) Watchdog"
 	depends on WATCHDOG && X86
drivers/char/watchdog/Makefile +1 -0
diff -Nru a/drivers/char/watchdog/Makefile b/drivers/char/watchdog/Makefile
@@ -14,6 +14,7 @@
 obj-$(CONFIG_21285_WATCHDOG) += wdt285.o
 obj-$(CONFIG_977_WATCHDOG) += wdt977.o
 obj-$(CONFIG_I8XX_TCO) += i8xx_tco.o
+obj-$(CONFIG_I6300ESB_WDT) += i6300esb.o
 obj-$(CONFIG_MACHZ_WDT) += machzwd.o
 obj-$(CONFIG_SH_WDT) += shwdt.o
 obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o
drivers/char/watchdog/i6300esb.c new file +508 -0

508 lines not on this page · raw message

drivers/char/watchdog/i6300esb.h new file +62 -0

62 lines not on this page · raw message

drivers/char/watchdog/i8xx_tco.c +1 -0
diff -Nru a/drivers/char/watchdog/i8xx_tco.c b/drivers/char/watchdog/i8xx_tco.c
@@ -382,6 +382,7 @@
 	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_2,	PCI_ANY_ID, PCI_ANY_ID, },
 	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_0,	PCI_ANY_ID, PCI_ANY_ID, },
 	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_1,	PCI_ANY_ID, PCI_ANY_ID, },
+	{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_1,	PCI_ANY_ID, PCI_ANY_ID, },
 	{ 0, },			/* End of list */
 };
 MODULE_DEVICE_TABLE (pci, i8xx_tco_pci_tbl);
drivers/char/watchdog/s3c2410_wdt.c +48 -3

77 lines not on this page · raw message

drivers/char/watchdog/s3c2410_wdt.c +7 -29
diff -Nru a/drivers/char/watchdog/s3c2410_wdt.c b/drivers/char/watchdog/s3c2410_wdt.c
@@ -30,6 +30,7 @@
  *	11-Jan-2005	BJD	Fixed divide-by-2 in timeout code
  *
  *	25-Jan-2005	DA	Added suspend/resume support
+ *				Replaced reboot notifier with .shutdown method
  *
  *	10-Mar-2005	LCVR	Changed S3C2410_VA to S3C24XX_VA
 */
@@ -42,8 +43,6 @@
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
 #include <linux/fs.h>
-#include <linux/notifier.h>
-#include <linux/reboot.h>
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/interrupt.h>
@@ -324,20 +323,6 @@
 	}
 }
 
-/*
- *	Notifier for system down
- */
-
-static int s3c2410wdt_notify_sys(struct notifier_block *this, unsigned long code,
-			      void *unused)
-{
-	if(code==SYS_DOWN || code==SYS_HALT) {
-		/* Turn the WDT off */
-		s3c2410wdt_stop();
-	}
-	return NOTIFY_DONE;
-}
-
 /* kernel interface */
 
 static struct file_operations s3c2410wdt_fops = {
@@ -355,10 +340,6 @@
 	.fops		= &s3c2410wdt_fops,
 };
 
-static struct notifier_block s3c2410wdt_notifier = {
-	.notifier_call	= s3c2410wdt_notify_sys,
-};
-
 /* interrupt handler code */
 
 static irqreturn_t s3c2410wdt_irq(int irqno, void *param,
@@ -439,18 +420,10 @@
 		}
 	}
 
-	ret = register_reboot_notifier(&s3c2410wdt_notifier);
-	if (ret) {
-		printk (KERN_ERR PFX "cannot register reboot notifier (%d)\n",
-			ret);
-		return ret;
-	}
-
 	ret = misc_register(&s3c2410wdt_miscdev);
 	if (ret) {
 		printk (KERN_ERR PFX "cannot register miscdev on minor=%d (%d)\n",
 			WATCHDOG_MINOR, ret);
-		unregister_reboot_notifier(&s3c2410wdt_notifier);
 		return ret;
 	}
 
@@ -486,6 +459,11 @@
 	return 0;
 }
 
+static void s3c2410wdt_shutdown(struct device *dev)
+{
+	s3c2410wdt_stop();	
+}
+
 #ifdef CONFIG_PM
 
 static unsigned long wtcon_save;
@@ -532,6 +510,7 @@
 	.bus		= &platform_bus_type,
 	.probe		= s3c2410wdt_probe,
 	.remove		= s3c2410wdt_remove,
+	.shutdown	= s3c2410wdt_shutdown,
 	.suspend	= s3c2410wdt_suspend,
 	.resume		= s3c2410wdt_resume,
 };
@@ -548,7 +527,6 @@
 static void __exit watchdog_exit(void)
 {
 	driver_unregister(&s3c2410wdt_driver);
-	unregister_reboot_notifier(&s3c2410wdt_notifier);
 }
 
 module_init(watchdog_init);
drivers/char/watchdog/Makefile +47 -24

90 lines not on this page · raw message

#1 lore raw
Quoted 4 lines · Wim Van Sebroeck

please do a

bk pull http://linux-watchdog.bkbits.net/linux-2.6-watchdog-mm

I do, about three times a day ;) And I resolve conflicts between the bk trees and Linus's tree. And I resolve conflicts if there's a clash between one bk tree and another. And I'll let you know if there's some non-trivial conflict looming between your tree and someone else's. And I'll let you know if there's a compile error or bug in your tree and might even have a patch for it.

The only real problem with this scheme is that you don't know when I'm about to release your tree in a -mm kernel. So I don't support a "this change is only half done but I'll check it in now" state. That hasn't caused any problem yet, as far as I know.