Subject: 2.6.11 preemption fix

From: Atsushi Nemoto <[email-masked]>
Date: Fri, 04 Mar 2005 19:43:41 +0900 (JST)

It seems 2.6.11 preemption kernel is broken.

The preempt_schedule_irq() expects preempt_count is 0.  Also trailing
branch instructino have been lost.  How about this fix?

--- linux-mips/arch/mips/kernel/entry.S	2005-02-10 11:27:50.000000000 +0900
+++ linux/arch/mips/kernel/entry.S	2005-03-04 17:09:53.000000000 +0900
@@ -58,9 +58,8 @@
 	LONG_L	t0, PT_STATUS(sp)		# Interrupts off?
 	andi	t0, 1
 	beqz	t0, restore_all
-	li	t0, PREEMPT_ACTIVE
-	sw	t0, TI_PRE_COUNT($28)
 	jal	preempt_schedule_irq
+	b	need_resched
 #endif
 
 FEXPORT(ret_from_fork)

---
Atsushi Nemoto

---

From: Ralf Baechle <[email-masked]>
Date: Fri, 4 Mar 2005 12:36:09 +0000

> branch instructino have been lost.  How about this fix?

Looking good. Applied,

  Ralf