svn commit: r225875 - head/sys/powerpc/powerpc

Alexander Motin mav at FreeBSD.org
Thu Sep 29 14:19:35 UTC 2011


Author: mav
Date: Thu Sep 29 14:19:34 2011
New Revision: 225875
URL: http://svn.freebsd.org/changeset/base/225875

Log:
  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
  MFC after:	3 days

Modified:
  head/sys/powerpc/powerpc/cpu.c

Modified: head/sys/powerpc/powerpc/cpu.c
==============================================================================
--- head/sys/powerpc/powerpc/cpu.c	Thu Sep 29 10:42:51 2011	(r225874)
+++ head/sys/powerpc/powerpc/cpu.c	Thu Sep 29 14:19:34 2011	(r225875)
@@ -553,6 +553,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 +588,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