[PATCH] powerpc/mpc52xx/wdt: Fix 5200 wdt always being used as gpt

Albrecht Dreß albrecht.dress at arcor.de
Tue Aug 4 02:40:46 EST 2009

In the current code, all MPC5200 timers are registered by the  
mpc52xx_gpt driver, even if gpt0 (the only one with this capability)  
shall be used as hardware watchdog which is indicated by the  
"fsl,has-wdt" or "has-wdt" property in the device tree.  Thus, the  
watchdog driver does never find any watchdog and simply doesn't work.

This trivial patch protects timers with a "(fsl,)?has-wdt" property  
from being probed as gpt's.  The watchdog timer now works just fine.

Tested on a custom (roughly Icecube based) MPC5200B board, with the  
5200 watchdog driver built into the kernel.

Signed-off-by: Albrecht Dreß <albrecht.dress at arcor.de>


--- linux-	 
2009-07-24 23:47:51.000000000 +0200
+++ linux-	 
2009-08-03 14:20:10.000000000 +0200
@@ -343,6 +343,14 @@
  	struct mpc52xx_gpt_priv *gpt;

+	/* do not grab devices which shall be used as watchdog */
+	if (of_get_property(ofdev->node, "fsl,has-wdt", NULL) ||
+		of_get_property(ofdev->node, "has-wdt", NULL)) {
+		pr_notice("%s: ignore wdt %s\n", __func__,
+			  ofdev->node->full_name);
+		return -ENODEV;
+	}
  	gpt = kzalloc(sizeof *gpt, GFP_KERNEL);
  	if (!gpt)
  		return -ENOMEM;

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20090803/eb900bea/attachment.pgp>

More information about the Linuxppc-dev mailing list