+ x86-nmi-fix.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     x86 nmi fix

has been added to the -mm tree.  Its filename is

     x86-nmi-fix.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: x86 nmi fix
From: Shaohua Li <shaohua.li@xxxxxxxxx>


unchangelogged

Signed-off-by: Shaohua Li <shaohua.li@xxxxxxxxx>
Cc: Don Zickus <dzickus@xxxxxxxxxx>
Cc: Andi Kleen <ak@xxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 arch/i386/kernel/nmi.c       |   14 +++++++++-----
 arch/i386/kernel/smpboot.c   |    3 ++-
 arch/x86_64/kernel/nmi.c     |   14 +++++++++-----
 arch/x86_64/kernel/smpboot.c |    2 ++
 include/asm-i386/nmi.h       |    1 +
 include/asm-x86_64/nmi.h     |    1 +
 6 files changed, 24 insertions(+), 11 deletions(-)

diff -puN arch/i386/kernel/nmi.c~x86-nmi-fix arch/i386/kernel/nmi.c
--- devel/arch/i386/kernel/nmi.c~x86-nmi-fix	2006-06-06 22:03:13.000000000 -0700
+++ devel-akpm/arch/i386/kernel/nmi.c	2006-06-06 22:05:45.000000000 -0700
@@ -65,7 +65,6 @@ struct nmi_watchdog_ctlblk {
 static DEFINE_PER_CPU(struct nmi_watchdog_ctlblk, nmi_watchdog_ctlblk);
 
 /* local prototypes */
-static void stop_apic_nmi_watchdog(void *unused);
 static int unknown_nmi_panic_callback(struct pt_regs *regs, int cpu);
 
 extern void show_registers(struct pt_regs *regs);
@@ -376,15 +375,20 @@ static int nmi_pm_active; /* nmi_active 
 
 static int lapic_nmi_suspend(struct sys_device *dev, pm_message_t state)
 {
+	/* only CPU0 goes here, other CPUs should be offline */
 	nmi_pm_active = atomic_read(&nmi_active);
-	disable_lapic_nmi_watchdog();
+	stop_apic_nmi_watchdog(NULL);
+	BUG_ON(atomic_read(&nmi_active) != 0);
 	return 0;
 }
 
 static int lapic_nmi_resume(struct sys_device *dev)
 {
-	if (nmi_pm_active > 0)
-		enable_lapic_nmi_watchdog();
+	/* only CPU0 goes here, other CPUs should be offline */
+	if (nmi_pm_active > 0) {
+		setup_apic_nmi_watchdog(NULL);
+		touch_nmi_watchdog();
+	}
 	return 0;
 }
 
@@ -786,7 +790,7 @@ void setup_apic_nmi_watchdog (void *unus
 	atomic_inc(&nmi_active);
 }
 
-static void stop_apic_nmi_watchdog(void *unused)
+void stop_apic_nmi_watchdog(void *unused)
 {
 	/* only support LOCAL and IO APICs for now */
 	if ((nmi_watchdog != NMI_LOCAL_APIC) &&
diff -puN arch/i386/kernel/smpboot.c~x86-nmi-fix arch/i386/kernel/smpboot.c
--- devel/arch/i386/kernel/smpboot.c~x86-nmi-fix	2006-06-06 22:03:13.000000000 -0700
+++ devel-akpm/arch/i386/kernel/smpboot.c	2006-06-06 22:03:13.000000000 -0700
@@ -1358,7 +1358,8 @@ int __cpu_disable(void)
 	 */
 	if (cpu == 0)
 		return -EBUSY;
-
+	if (nmi_watchdog == NMI_LOCAL_APIC)
+		stop_apic_nmi_watchdog(NULL);
 	clear_local_APIC();
 	/* Allow any queued timer interrupts to get serviced */
 	local_irq_enable();
diff -puN arch/x86_64/kernel/nmi.c~x86-nmi-fix arch/x86_64/kernel/nmi.c
--- devel/arch/x86_64/kernel/nmi.c~x86-nmi-fix	2006-06-06 22:03:13.000000000 -0700
+++ devel-akpm/arch/x86_64/kernel/nmi.c	2006-06-06 22:05:45.000000000 -0700
@@ -65,7 +65,6 @@ struct nmi_watchdog_ctlblk {
 static DEFINE_PER_CPU(struct nmi_watchdog_ctlblk, nmi_watchdog_ctlblk);
 
 /* local prototypes */
-static void stop_apic_nmi_watchdog(void *unused);
 static int unknown_nmi_panic_callback(struct pt_regs *regs, int cpu);
 
 /* converts an msr to an appropriate reservation bit */
@@ -362,15 +361,20 @@ static int nmi_pm_active; /* nmi_active 
 
 static int lapic_nmi_suspend(struct sys_device *dev, pm_message_t state)
 {
+	/* only CPU0 goes here, other CPUs should be offline */
 	nmi_pm_active = atomic_read(&nmi_active);
-	disable_lapic_nmi_watchdog();
+	stop_apic_nmi_watchdog(NULL);
+	BUG_ON(atomic_read(&nmi_active) != 0);
 	return 0;
 }
 
 static int lapic_nmi_resume(struct sys_device *dev)
 {
-	if (nmi_pm_active > 0)
-		enable_lapic_nmi_watchdog();
+	/* only CPU0 goes here, other CPUs should be offline */
+	if (nmi_pm_active > 0) {
+		setup_apic_nmi_watchdog(NULL);
+		touch_nmi_watchdog();
+	}
 	return 0;
 }
 
@@ -697,7 +701,7 @@ void setup_apic_nmi_watchdog(void *unuse
 	atomic_inc(&nmi_active);
 }
 
-static void stop_apic_nmi_watchdog(void *unused)
+void stop_apic_nmi_watchdog(void *unused)
 {
 	/* only support LOCAL and IO APICs for now */
 	if ((nmi_watchdog != NMI_LOCAL_APIC) &&
diff -puN arch/x86_64/kernel/smpboot.c~x86-nmi-fix arch/x86_64/kernel/smpboot.c
--- devel/arch/x86_64/kernel/smpboot.c~x86-nmi-fix	2006-06-06 22:03:13.000000000 -0700
+++ devel-akpm/arch/x86_64/kernel/smpboot.c	2006-06-06 22:03:13.000000000 -0700
@@ -1229,6 +1229,8 @@ int __cpu_disable(void)
 	if (cpu == 0)
 		return -EBUSY;
 
+	if (nmi_watchdog == NMI_LOCAL_APIC)
+		stop_apic_nmi_watchdog(NULL);
 	clear_local_APIC();
 
 	/*
diff -puN include/asm-i386/nmi.h~x86-nmi-fix include/asm-i386/nmi.h
--- devel/include/asm-i386/nmi.h~x86-nmi-fix	2006-06-06 22:03:13.000000000 -0700
+++ devel-akpm/include/asm-i386/nmi.h	2006-06-06 22:03:13.000000000 -0700
@@ -23,6 +23,7 @@ extern int reserve_evntsel_nmi(unsigned 
 extern void release_evntsel_nmi(unsigned int);
 
 extern void setup_apic_nmi_watchdog (void *);
+extern void stop_apic_nmi_watchdog (void *);
 extern void disable_timer_nmi_watchdog(void);
 extern void enable_timer_nmi_watchdog(void);
 extern int nmi_watchdog_tick (struct pt_regs * regs, unsigned reason);
diff -puN include/asm-x86_64/nmi.h~x86-nmi-fix include/asm-x86_64/nmi.h
--- devel/include/asm-x86_64/nmi.h~x86-nmi-fix	2006-06-06 22:03:13.000000000 -0700
+++ devel-akpm/include/asm-x86_64/nmi.h	2006-06-06 22:03:13.000000000 -0700
@@ -54,6 +54,7 @@ extern int reserve_evntsel_nmi(unsigned 
 extern void release_evntsel_nmi(unsigned int);
 
 extern void setup_apic_nmi_watchdog (void *);
+extern void stop_apic_nmi_watchdog (void *);
 extern void disable_timer_nmi_watchdog(void);
 extern void enable_timer_nmi_watchdog(void);
 extern int nmi_watchdog_tick (struct pt_regs * regs, unsigned reason);
_

Patches currently in -mm which might be from shaohua.li@xxxxxxxxx are

git-acpi.patch
x86-nmi-fix.patch
x86-nmi-fix-2.patch
x86-cpu_init-avoid-gfp_kernel-allocation-while-atomic.patch
swsusp-add-architecture-special-saveable-pages-support.patch
swsusp-i386-mark-special-saveable-unsaveable-pages.patch
swsusp-x86_64-mark-special-saveable-unsaveable-pages.patch
dont-use-flush_tlb_all-in-suspend-time.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux