Skip to contentSkip to conversation

m68knommu: fix compare race in sched related code

PATCH New Greg Ungerer 1 participant 1 message May 1, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 m68knommu: fix compare race in sched related code

From: Sebastian Siewior <[email protected]>

The interrupts must be disabled before considering the need resched bit of the task struct and they have to be disabled before calling schedule()

---

arch/m68knommu/platform/coldfire/entry.S +2 -0
diff -Naurp linux-2.6.25/arch/m68knommu/platform/coldfire/entry.S linux-2.6.25-uc0/arch/m68knommu/platform/coldfire/entry.S
@@ -103,6 +103,7 @@ ret_from_signal:
 	addql	#4,%sp
 
 ret_from_exception:
+	move	#0x2700,%sr		/* disable intrs */
 	btst	#5,%sp@(PT_SR)		/* check if returning to kernel */
 	jeq	Luser_return		/* if so, skip resched, signals */
 
@@ -140,6 +141,7 @@ Lreturn:
 
 Lwork_to_do:
 	movel	%a0@(TI_FLAGS),%d1	/* get thread_info->flags */
+	move	#0x2000,%sr		/* enable intrs again */
 	btst	#TIF_NEED_RESCHED,%d1
 	jne	reschedule