watchdog: xen: don't unconditionally enable the watchdog during resume
authorJan Beulich <JBeulich@suse.com>
Mon, 19 Mar 2012 09:30:33 +0000 (09:30 +0000)
committerWim Van Sebroeck <wim@iguana.be>
Tue, 27 Mar 2012 18:13:43 +0000 (20:13 +0200)
This was found to be a problem particularly after guest migration.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reported-by: Wouter de Geus <benv-xensource.com@junerules.com>
Reported-by: Ian Campbell <Ian.Campbell@citrix.com>
Tested-by: Wouter de Geus <benv-xensource.com@junerules.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
drivers/watchdog/xen_wdt.c

index 79aa7f96c246f39bfadc4d1892cb795ce7e0d392..e04fd6cf2121e044e13058140647b11278b29b67 100644 (file)
@@ -296,11 +296,18 @@ static void xen_wdt_shutdown(struct platform_device *dev)
 
 static int xen_wdt_suspend(struct platform_device *dev, pm_message_t state)
 {
-       return xen_wdt_stop();
+       typeof(wdt.id) id = wdt.id;
+       int rc = xen_wdt_stop();
+
+       wdt.id = id;
+       return rc;
 }
 
 static int xen_wdt_resume(struct platform_device *dev)
 {
+       if (!wdt.id)
+               return 0;
+       wdt.id = 0;
        return xen_wdt_start();
 }