IDE: Touch NMI watchdog during resume from STR
PATCH 1/1 IDE: Touch NMI watchdog during resume from STR
When resuming from suspend-to-RAM, the NMI watchdog detects a lockup in ide_wait_not_busy. Here's a screenshot of the trace taken by a digital camera: http://www.uamt.feec.vutbr.cz/rizeni/pom/DSC03510-2.JPG
Let's touch the NMI watchdog in ide_wait_not_busy. The system then resumes correctly from STR.
drivers/ide/ide-iops.c +0 -0
@@ -23,6 +23,7 @@ #include <linux/delay.h>
#include <linux/hdreg.h>
#include <linux/ide.h>
#include <linux/bitops.h>
+#include <linux/nmi.h>
#include <asm/byteorder.h>
#include <asm/irq.h>
@@ -1243,6 +1244,7 @@ int ide_wait_not_busy(ide_hwif_t *hwif,
if (stat == 0xff) return -ENODEV; touch_softlockup_watchdog(); + touch_nmi_watchdog(); } return -EBUSY; }
Review
Quoted 4 lines · Michal Schmidt
if (stat ==
0xff)(quoted diff) +1
-0return -ENODEV; touch_softlockup_watchdog(); + touch_nmi_watchdog();
You can remove the touch_softlock_watchdog then. It's implied in touch_nmi_watchdog
-Andi
Quoted 6 lines · Andi Kleen
Review
Quoted 4 lines · Michal Schmidt
if (stat ==
0xff)(quoted diff) +1
-0return -ENODEV; touch_softlockup_watchdog(); + touch_nmi_watchdog();You can remove the
touch_softlock_watchdogthen. It's implied intouch_nmi_watchdog
I don't think that's always true. There are architectures where touch_nmi_watchdog is a NOP. This is in include/linux/nmi.h:
#ifdef ARCH_HAS_NMI_WATCHDOG
extern void touch_nmi_watchdog(void);
#else
# define touch_nmi_watchdog() do { } while(0)
#endifMichal
Quoted 9 lines · Michal Schmidt
Quoted 7 lines · Andi Kleen
Review
Quoted 4 lines · Michal Schmidt
if (stat ==
0xff)(quoted diff) +1
-0return -ENODEV; touch_softlockup_watchdog(); + touch_nmi_watchdog();You can remove the
touch_softlock_watchdogthen. It's implied intouch_nmi_watchdog
Quoted 8 lines
I don't think that's always true. There are architectures where
touch_nmi_watchdogis a NOP. This is ininclude/linux/nmi.h:#ifdef
ARCH_HAS_NMI_WATCHDOG
extern voidtouch_nmi_watchdog(void);
#else# define touch_nmi_watchdog() do { } while(0) #endif
That's broken code then. It should be defined to touch_softlock_watchdog for the !ARCH_HAS_NMI_WATCHDOG then.
-Andi
PATCH 1/1 Make touch_nmi_watchdog imply touch_softlockup_watchdog on all archs
touch_nmi_watchdog() calls touch_softlockup_watchdog() on both architectures that implement it (i386 and x86_64). On other architectures it does nothing at all. touch_nmi_watchdog() should imply touch_softlockup_watchdog() on all architectures.
Suggested by Andi Kleen.
include/linux/nmi.h +0 -0
@@ -4,6 +4,7 @@
#ifndef LINUX_NMI_H
#define LINUX_NMI_H
+#include <linux/sched.h>
#include <asm/irq.h>
/**
@@ -16,7 +17,7 @@ #include <asm/irq.h>
#ifdef ARCH_HAS_NMI_WATCHDOG
extern void touch_nmi_watchdog(void);
#else
-# define touch_nmi_watchdog() do { } while(0)
+# define touch_nmi_watchdog() touch_softlockup_watchdog() #endif
#endif
Re: [PATCH] Make touch_nmi_watchdog imply touch_softlockup_watchdog on all archs
Quoted 7 lines · Michal Schmidt
touch_nmi_watchdog()callstouch_softlockup_watchdog()on both architectures that implement it (i386 andx86_64). On other architectures it does nothing at all.touch_nmi_watchdog()should implytouch_softlockup_watchdog()on all architectures. Suggested by Andi Kleen.Signed-off-by Michal Schmidt <[email protected]>
although i suspect this could be cleaned up by consolidating both under touch_watchdog(), right?
Ingo
Hi!
Quoted 11 lines
When resuming from suspend-to-RAM, the NMI watchdog detects a lockup in
ide_wait_not_busy. Here's a screenshot of the trace taken by a digital camera:
http://www.uamt.feec.vutbr.cz/rizeni/pom/DSC03510-2.JPGLet's touch the NMI watchdog in
ide_wait_not_busy. The system then resumes correctly from STR.Signed-off-by: Michal Schmidt
<[email protected]>
ACK.
Quoted 14 lines
drivers/ide/ide-iops.c +1
-0@@ -23,6 +23,7 @@ #include <linux/delay.h>#include <linux/hdreg.h> #include <linux/ide.h> #include <linux/bitops.h> +#include <linux/nmi.h> #include <asm/byteorder.h> #include <asm/irq.h>
drivers/ide/ide-iops.c int ide_wait_not_busy(ide_hwif_t · line 1247
Quoted 4 lines
drivers/ide/ide-iops.c +1
-0@@ -1243,6 +1244,7 @@ int ide_wait_not_busy(ide_hwif_t *hwif, if (stat == 0xff) return -ENODEV;touch_softlockup_watchdog (); +touch_nmi_watchdog ();
Perhaps we need touch_all_watchdogs()?
Pavel
Signature · 1 line
Thanks for all the (sleeping) penguins.