PATCH: 2.6.26-rc8: Fix IRQF_DISABLED for shared interrupts

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-kernel@...>, <linux-usb@...>
Cc: ext David Brownell <david-b@...>, ext Alan Stern <stern@...>
Date: Sunday, June 29, 2008 - 10:57 am

Hi David,

[I'm not subscribed to the list. So please CC: me in your reply]

ext David Brownell wrote:

I was starting to wonder about that too after I had sent the message and 
it led me straight to the root cause. This also explains why I was 
unable to reproduce the problem with defconfig: yenta_socket is not 
included in the default configuration.


The problem is caused by this code in handle_IRQ_event():

	if (!(action->flags & IRQF_DISABLED))
		local_irq_enable_in_hardirq();

	do {
		ret = action->handler(irq, action->dev_id);
         ...
		action = action->next;
	} while (action);

For shared interrupts IRQF_DISABLED will only take effect if the first 
registered handler sets it.


The attached changes fix the problem for me. Feel free to update them if 
they are not up to usual Linux kernel quality standards. I also attached 
the new config I used for testing: defconfig + the minimum additional 
stuff to enable the problem.

There are of course two other options to fix the problem:

  - add IRQF_DISBALED to yenta_socket. But this will fix it only for 
this case...

  - enable/disable interrupts depending on actions IRQF_DISABLED in the 
loop in handle_IRQ_event(). But that would mean more CPU cycles are 
spent in that function...

Regards,

	Stefan

---
Stefan Becker
E-Mail: Stefan.Becker@nokia.com
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
BUG in 2.6.26-rc8 interrupt handling, Becker Stefan (Nokia-D/Salo)..., (Sat Jun 28, 3:34 pm)
Re: BUG in 2.6.26-rc8 interrupt handling, David Brownell, (Sat Jun 28, 3:51 pm)
PATCH: 2.6.26-rc8: Fix IRQF_DISABLED for shared interrupts, Stefan Becker, (Sun Jun 29, 10:57 am)
Re: [PATCH] USB: fix interrupt disabling for HCDs with share..., Leonardo Chiquitto, (Tue Jul 1, 10:19 am)
Re: PATCH: 2.6.26-rc8: Fix IRQF_DISABLED for shared interrupts, Henrique de Moraes Holschuh..., (Mon Jun 30, 10:28 am)