]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
USB: fix interrupt disabling for HCDs with shared interrupt handlers
authorStefan Becker <Stefan.Becker@nokia.com>
Fri, 4 Jul 2008 05:20:27 +0000 (05:20 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 24 Jul 2008 16:14:04 +0000 (09:14 -0700)
commit81eea6171b6683ca824dd4b0144f37c2684ac54a
treed52b91614ec362705bdb1c79fb4c912b101829ab
parent5886d647e65a89f75a5a5506481e5385857cac4c
USB: fix interrupt disabling for HCDs with shared interrupt handlers

commit de85422b94ddb23c021126815ea49414047c13dc upstream

As has been discussed several times on LKML, IRQF_SHARED | IRQF_DISABLED
doesn't work reliably, i.e. a shared interrupt handler CAN'T be certain to
be called with interrupts disabled. Most USB HCD handlers use IRQF_DISABLED
and therefore havoc can break out if they share their interrupt with a
handler that doesn't use it.

On my test machine the yenta_socket interrupt handler (no IRQF_DISABLED)
was registered before ehci_hcd and one uhci_hcd instance. Therefore all
usb_hcd_irq() invocations for ehci_hcd and for one uhci_hcd instance
happened with interrupts enabled. That led to random lockups as USB core
HCD functions that acquire the same spinlock could be called twice
from interrupt handlers.

This patch updates usb_hcd_irq() to always disable/restore interrupts.
usb_add_hcd() will silently remove any IRQF_DISABLED requested from HCD code.

Signed-off-by: Stefan Becker <stefan.becker@nokia.com>
Acked-by: David Brownell <david-b@pacbell.net>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/hcd.c