Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24646bd2 authored by Akira Takeuchi's avatar Akira Takeuchi Committed by Linus Torvalds
Browse files

MN10300: Fix the preemption resume_kernel() routine



Fix the preemption resume_kernel() routine by inverting the test to see
whether interrupts are off (IM7 is all enabled, not all disabled).

Furthermore, interrupts should be disabled on entry to resume_kernel() so that
they're correctly set for jumping to restore_all() and doing the need
reschedule test.

Signed-off-by: default avatarAkira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a8893fb3
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -180,6 +180,7 @@ ENTRY(resume_userspace)


#ifdef CONFIG_PREEMPT
#ifdef CONFIG_PREEMPT
ENTRY(resume_kernel)
ENTRY(resume_kernel)
	__cli
	mov	(TI_preempt_count,a2),d0	# non-zero preempt_count ?
	mov	(TI_preempt_count,a2),d0	# non-zero preempt_count ?
	cmp	0,d0
	cmp	0,d0
	bne	restore_all
	bne	restore_all
@@ -190,7 +191,7 @@ need_resched:
	mov	(REG_EPSW,fp),d0
	mov	(REG_EPSW,fp),d0
	and	EPSW_IM,d0
	and	EPSW_IM,d0
	cmp	EPSW_IM_7,d0		# interrupts off (exception path) ?
	cmp	EPSW_IM_7,d0		# interrupts off (exception path) ?
	beq	restore_all
	bne	restore_all
	call	preempt_schedule_irq[],0
	call	preempt_schedule_irq[],0
	jmp	need_resched
	jmp	need_resched
#endif
#endif