Skip to contentSkip to conversation

microblaze: scheduling with interrupts disabled

BUG? Steven J. Magnani 1 participant 1 message Mar 5, 2010

lore
Share & tools
lore
#0 lore raw

I ran across the following code in kernel/entry-nommu.S:

work_pending:

	andi	r11, r19, _TIF_NEED_RESCHED
	beqi	r11, 1f
	bralid	r15, schedule
	nop
1:	andi	r11, r19, _TIF_SIGPENDING
	beqi	r11, no_work_pending
	addk	r5, r1, r0
	addik	r7, r0, 1
	bralid	r15, do_signal
	addk	r6, r0, r0
	bri	no_work_pending

ENTRY(ret_to_user)
disable_irq

swi r4, r1, PT_R4 /* return val */
swi r3, r1, PT_R3 /* return val */

lwi r6, r31, TS_THREAD_INFO /* get thread info */
lwi r19, r6, TI_FLAGS /* get flags in thread info */
bnei r19, work_pending
no_work_pending:
disable_irq

If I am reading this correctly, it looks like schedule() and do_signal() can get called with interrupts disabled. This looks like a bug to me. I would propose to fix it by putting an enable_irq at work_pending.

Comments?
------------------------------------------------------------------------
Steven J. Magnani "I claim this network for MARS!
www.digidescorp.com Earthling, return my space modulator!"

#include <standard.disclaimer>