aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/hcd.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-03 21:29:08 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-03 21:29:13 -0700
commitbf9127c36341573dc47a9c2fc003dcf13bbbf246 (patch)
treebd225092dbdd05b8738e6ac811f4f8d06aea8b22 /drivers/usb/core/hcd.c
parentb620754bfeb8b0e0c6622b03d5ee2f1af1d3082f (diff)
parentb89cbb81aec2015b4020221564ced1569e1a8900 (diff)
downloadkernel_samsung_smdk4412-bf9127c36341573dc47a9c2fc003dcf13bbbf246.tar.gz
kernel_samsung_smdk4412-bf9127c36341573dc47a9c2fc003dcf13bbbf246.tar.bz2
kernel_samsung_smdk4412-bf9127c36341573dc47a9c2fc003dcf13bbbf246.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: USB: adding comment for ipaq forcing number of ports USB: fix Oops on loading ipaq module since 2.6.26 USB: add a pl2303 device id USB: another option device id USB: don't lose disconnections during suspend USB: fix interrupt disabling for HCDs with shared interrupt handlers USB: New device ID for ftdi_sio driver sisusbvga: Fix oops on disconnect. USB: mass storage: new id for US_SC_CYP_ATACB USB: ohci - record data toggle after unlink USB: ehci - fix timer regression USB: fix cdc-acm resume() OHCI: Fix problem if SM501 and another platform driver is selected
Diffstat (limited to 'drivers/usb/core/hcd.c')
-rw-r--r--drivers/usb/core/hcd.c38
1 files changed, 28 insertions, 10 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 09a53e7f332..7158dbb6e4b 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1684,19 +1684,30 @@ EXPORT_SYMBOL_GPL(usb_bus_start_enum);
irqreturn_t usb_hcd_irq (int irq, void *__hcd)
{
struct usb_hcd *hcd = __hcd;
- int start = hcd->state;
+ unsigned long flags;
+ irqreturn_t rc;
- if (unlikely(start == HC_STATE_HALT ||
- !test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)))
- return IRQ_NONE;
- if (hcd->driver->irq (hcd) == IRQ_NONE)
- return IRQ_NONE;
+ /* IRQF_DISABLED doesn't work correctly with shared IRQs
+ * when the first handler doesn't use it. So let's just
+ * assume it's never used.
+ */
+ local_irq_save(flags);
- set_bit(HCD_FLAG_SAW_IRQ, &hcd->flags);
+ if (unlikely(hcd->state == HC_STATE_HALT ||
+ !test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))) {
+ rc = IRQ_NONE;
+ } else if (hcd->driver->irq(hcd) == IRQ_NONE) {
+ rc = IRQ_NONE;
+ } else {
+ set_bit(HCD_FLAG_SAW_IRQ, &hcd->flags);
- if (unlikely(hcd->state == HC_STATE_HALT))
- usb_hc_died (hcd);
- return IRQ_HANDLED;
+ if (unlikely(hcd->state == HC_STATE_HALT))
+ usb_hc_died(hcd);
+ rc = IRQ_HANDLED;
+ }
+
+ local_irq_restore(flags);
+ return rc;
}
/*-------------------------------------------------------------------------*/
@@ -1860,6 +1871,13 @@ int usb_add_hcd(struct usb_hcd *hcd,
/* enable irqs just before we start the controller */
if (hcd->driver->irq) {
+
+ /* IRQF_DISABLED doesn't work as advertised when used together
+ * with IRQF_SHARED. As usb_hcd_irq() will always disable
+ * interrupts we can remove it here.
+ */
+ irqflags &= ~IRQF_DISABLED;
+
snprintf(hcd->irq_descr, sizeof(hcd->irq_descr), "%s:usb%d",
hcd->driver->description, hcd->self.busnum);
if ((retval = request_irq(irqnum, &usb_hcd_irq, irqflags,