Skip to contentSkip to conversation

watchdog/max63xx: be careful when disabling the watchdog

PATCH In review Marc Zyngier 2 participants 2 messages Apr 15, 2010 Watchdog device drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchdog/max63xx: be careful when disabling the watchdog

Wim,

The attached patch fixes a nasty error with the max63xx driver, potentially leaving the platform dead (and watchdog disabled...).

Cheers,

        M.
Signature · 1 line
Who you jivin' with that Cosmik Debris?

From 4212d84a08845a6adf3f67367a24d9dbf076f9d6 Mon Sep 17 00:00:00 2001
From: Marc Zyngier <[email protected]>
Date: Fri, 9 Apr 2010 17:43:33 +0100
Subject: [PATCH] watchdog/max63xx: be careful when disabling the watchdog

When shutting down the watchdog timer, special care must be taken not to overwrite other bits in the register, as it may be shared with other peripherals.

For example, on the Arcom Vulcan, the register is shared between the watchdog and the PCI reset line...

---
 drivers/watchdog/max63xx_wdt.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
drivers/watchdog/max63xx_wdt.c +6 -1
index 75f3a83..3053ff0 100644
@@ -154,9 +154,14 @@ static void max63xx_wdt_enable(struct max63xx_timeout *entry)
 
 static void max63xx_wdt_disable(void)
 {
+	u8 val;
+
 	spin_lock(&io_lock);
 
-	__raw_writeb(3, wdt_base);
+	val = __raw_readb(wdt_base);
+	val &= ~MAX6369_WDSET;
+	val |= 3;
+	__raw_writeb(val, wdt_base);
 
 	spin_unlock(&io_lock);
 
Signature · 1 line
1.7.0
#1 lore raw

Hi Marc,

Quoted 2 lines

The attached patch fixes a nasty error with the max63xx driver, potentially leaving the platform dead (and watchdog disabled...).

Will add that fix also.

Kind regards,
Wim.