diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-07-07 02:01:26 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-07 02:01:26 -0400 |
commit | 032f82786f9be4635acaa5f77feca175a4ac5fe1 (patch) | |
tree | 11ce43c1086d3dec43c92b0a2cc740240b338fb7 /drivers/usb/core | |
parent | 46ac22bab42cc868b9c1d0e915ddbc8e8065a44d (diff) | |
parent | b7279469d66b55119784b8b9529c99c1955fe747 (diff) |
Merge commit 'v2.6.26-rc9' into sched/devel
Diffstat (limited to 'drivers/usb/core')
-rw-r--r-- | drivers/usb/core/hcd.c | 38 | ||||
-rw-r--r-- | drivers/usb/core/hub.c | 15 |
2 files changed, 32 insertions, 21 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 09a53e7f3327..7158dbb6e4b4 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -1684,19 +1684,30 @@ EXPORT_SYMBOL_GPL(usb_bus_start_enum); | |||
1684 | irqreturn_t usb_hcd_irq (int irq, void *__hcd) | 1684 | irqreturn_t usb_hcd_irq (int irq, void *__hcd) |
1685 | { | 1685 | { |
1686 | struct usb_hcd *hcd = __hcd; | 1686 | struct usb_hcd *hcd = __hcd; |
1687 | int start = hcd->state; | 1687 | unsigned long flags; |
1688 | irqreturn_t rc; | ||
1688 | 1689 | ||
1689 | if (unlikely(start == HC_STATE_HALT || | 1690 | /* IRQF_DISABLED doesn't work correctly with shared IRQs |
1690 | !test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))) | 1691 | * when the first handler doesn't use it. So let's just |
1691 | return IRQ_NONE; | 1692 | * assume it's never used. |
1692 | if (hcd->driver->irq (hcd) == IRQ_NONE) | 1693 | */ |
1693 | return IRQ_NONE; | 1694 | local_irq_save(flags); |
1694 | 1695 | ||
1695 | set_bit(HCD_FLAG_SAW_IRQ, &hcd->flags); | 1696 | if (unlikely(hcd->state == HC_STATE_HALT || |
1697 | !test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags))) { | ||
1698 | rc = IRQ_NONE; | ||
1699 | } else if (hcd->driver->irq(hcd) == IRQ_NONE) { | ||
1700 | rc = IRQ_NONE; | ||
1701 | } else { | ||
1702 | set_bit(HCD_FLAG_SAW_IRQ, &hcd->flags); | ||
1696 | 1703 | ||
1697 | if (unlikely(hcd->state == HC_STATE_HALT)) | 1704 | if (unlikely(hcd->state == HC_STATE_HALT)) |
1698 | usb_hc_died (hcd); | 1705 | usb_hc_died(hcd); |
1699 | return IRQ_HANDLED; | 1706 | rc = IRQ_HANDLED; |
1707 | } | ||
1708 | |||
1709 | local_irq_restore(flags); | ||
1710 | return rc; | ||
1700 | } | 1711 | } |
1701 | 1712 | ||
1702 | /*-------------------------------------------------------------------------*/ | 1713 | /*-------------------------------------------------------------------------*/ |
@@ -1860,6 +1871,13 @@ int usb_add_hcd(struct usb_hcd *hcd, | |||
1860 | 1871 | ||
1861 | /* enable irqs just before we start the controller */ | 1872 | /* enable irqs just before we start the controller */ |
1862 | if (hcd->driver->irq) { | 1873 | if (hcd->driver->irq) { |
1874 | |||
1875 | /* IRQF_DISABLED doesn't work as advertised when used together | ||
1876 | * with IRQF_SHARED. As usb_hcd_irq() will always disable | ||
1877 | * interrupts we can remove it here. | ||
1878 | */ | ||
1879 | irqflags &= ~IRQF_DISABLED; | ||
1880 | |||
1863 | snprintf(hcd->irq_descr, sizeof(hcd->irq_descr), "%s:usb%d", | 1881 | snprintf(hcd->irq_descr, sizeof(hcd->irq_descr), "%s:usb%d", |
1864 | hcd->driver->description, hcd->self.busnum); | 1882 | hcd->driver->description, hcd->self.busnum); |
1865 | if ((retval = request_irq(irqnum, &usb_hcd_irq, irqflags, | 1883 | if ((retval = request_irq(irqnum, &usb_hcd_irq, irqflags, |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 94789be54ca3..512d2d57d41e 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -713,18 +713,11 @@ static void hub_restart(struct usb_hub *hub, int type) | |||
713 | } | 713 | } |
714 | 714 | ||
715 | /* Was the power session lost while we were suspended? */ | 715 | /* Was the power session lost while we were suspended? */ |
716 | switch (type) { | 716 | status = hub_port_status(hub, port1, &portstatus, &portchange); |
717 | case HUB_RESET_RESUME: | ||
718 | portstatus = 0; | ||
719 | portchange = USB_PORT_STAT_C_CONNECTION; | ||
720 | break; | ||
721 | 717 | ||
722 | case HUB_RESET: | 718 | /* If the device is gone, khubd will handle it later */ |
723 | case HUB_RESUME: | 719 | if (status == 0 && !(portstatus & USB_PORT_STAT_CONNECTION)) |
724 | status = hub_port_status(hub, port1, | 720 | continue; |
725 | &portstatus, &portchange); | ||
726 | break; | ||
727 | } | ||
728 | 721 | ||
729 | /* For "USB_PERSIST"-enabled children we must | 722 | /* For "USB_PERSIST"-enabled children we must |
730 | * mark the child device for reset-resume and | 723 | * mark the child device for reset-resume and |