svn commit: r225917 - stable/9/sys/powerpc/powerpc

Alexander Motin mav at FreeBSD.org
Sun Oct 2 11:13:29 UTC 2011


Author: mav
Date: Sun Oct  2 11:13:28 2011
New Revision: 225917
URL: http://svn.freebsd.org/changeset/base/225917

Log:
  MFC r225875, r225877:
  Handle the race in cpu_idle() when due to the critical section CPU could
  get into sleep after receiving interrupt, delaying interrupt thread
  execution indefinitely until the next interrupt arrive.
  
  Reviewed by:    nwhitehorn
  Approved by:	re (kib)

Modified:
  stable/9/sys/powerpc/powerpc/cpu.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/powerpc/powerpc/cpu.c
==============================================================================
--- stable/9/sys/powerpc/powerpc/cpu.c	Sun Oct  2 09:44:28 2011	(r225916)
+++ stable/9/sys/powerpc/powerpc/cpu.c	Sun Oct  2 11:13:28 2011	(r225917)
@@ -65,6 +65,7 @@
 #include <sys/cpu.h>
 #include <sys/kernel.h>
 #include <sys/proc.h>
+#include <sys/sched.h>
 #include <sys/sysctl.h>
 
 #include <machine/bus.h>
@@ -553,6 +554,11 @@ cpu_idle_60x(void)
 	vers = mfpvr() >> 16;
 
 #ifdef AIM
+	mtmsr(msr & ~PSL_EE);
+	if (sched_runnable()) {
+		mtmsr(msr);
+		return;
+	}
 	switch (vers) {
 	case IBM970:
 	case IBM970FX:
@@ -583,6 +589,11 @@ cpu_idle_e500(void)
 	msr = mfmsr();
 
 #ifdef E500
+	mtmsr(msr & ~PSL_EE);
+	if (sched_runnable()) {
+		mtmsr(msr);
+		return;
+	}
 	/* Freescale E500 core RM section 6.4.1. */
 	__asm __volatile("msync; mtmsr %0; isync" ::
 	    "r" (msr | PSL_WE));


More information about the svn-src-all mailing list