]> git.baikalelectronics.ru Git - kernel.git/commit
Separate handling of irq type flags variable from the irq_flags request_irq variable
authorShyam Iyer <shyam.iyer.t@gmail.com>
Thu, 14 Jul 2011 15:00:32 +0000 (15:00 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Jul 2011 15:08:26 +0000 (08:08 -0700)
commit90527a99d72a33de35f70d6af2eb2b6d3c5f15e9
treeeac25a78502e3949fbe97c5e7bd6ed80fc9324ed
parent151405fa782db32503a9d1e47c8167cc3e5e925c
Separate handling of irq type flags variable from the irq_flags request_irq variable

Commit c58c8c4c92540a2e6e666b8a6ef6864ecbb61a5e does not completely
fix the problem of handling allocations with irqs disabled..  The
below patch on top of it fixes the problem completely.

Based on review by "Ivan Vecera" <ivecera@redhat.com>..
"
Small note, the root of the problem was that non-atomic allocation was requested with IRQs disabled. Your patch description does not contain wwhy were the IRQs disabled.

The function bnad_mbox_irq_alloc incorrectly uses 'flags' var for two different things, 1) to save current CPU flags and 2) for request_irq
call.
First the spin_lock_irqsave disables the IRQs and saves _all_ CPU flags (including one that enables/disables interrupts) to 'flags'. Then the 'flags' is overwritten by 0 or 0x80 (IRQF_SHARED). Finally the spin_unlock_irqrestore should restore saved flags, but these flags are now either 0x00 or 0x80. The interrupt bit value in flags register on x86 arch is 0x100.
This means that the interrupt bit is zero (IRQs disabled) after spin_unlock_irqrestore so the request_irq function is called with disabled interrupts.
"

Signed-off-by: Shyam Iyer <shyam_iyer@dell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bna/bnad.c