diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-12-14 17:01:41 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-12-14 17:01:41 -0800 |
| commit | b2536a9ff918d0208cbb8ff547b760d29b7daf96 (patch) | |
| tree | 8efd3fafb40624bc1f024a50a652c3a1469e5688 /usb | |
| parent | a4b2fa6d1401e32711d7fcddc3ec81624d2a4095 (diff) | |
| download | patches-b2536a9ff918d0208cbb8ff547b760d29b7daf96.tar.gz | |
pci and usb patches
Diffstat (limited to 'usb')
8 files changed, 373 insertions, 4 deletions
diff --git a/usb/usb-at91_udc-correct-hanging-while-disconnecting-usb-cable.patch b/usb/usb-at91_udc-correct-hanging-while-disconnecting-usb-cable.patch new file mode 100644 index 00000000000000..15f6ce3af166f8 --- /dev/null +++ b/usb/usb-at91_udc-correct-hanging-while-disconnecting-usb-cable.patch @@ -0,0 +1,47 @@ +From akpm@linux-foundation.org Thu Dec 13 15:53:12 2007 +From: Nicolas Ferre <nicolas.ferre@atmel.com> +Date: Thu, 13 Dec 2007 15:52:58 -0800 +Subject: USB: at91_udc: correct hanging while disconnecting usb cable +To: greg@kroah.com +Cc: akpm@linux-foundation.org, nicolas.ferre@atmel.com, david-b@pacbell.net, nicolas.ferre@rfo.atmel.com +Message-ID: <200712132352.lBDNqxCf024783@imap1.linux-foundation.org> + + +From: Nicolas Ferre <nicolas.ferre@atmel.com> + +Correct hanging while disconnecting the USB device cable. Prevent a race +between vbus and UDP interrupts. This bug was tracked on at91sam9260ek +boards. + +A usb resume interrupt was firing after the vbus interrupt : the IP was +then already stoped and not able to deal with it (no more clock). A simple +interrupt disabling is ok as the "end of bus reset" irq is non maskable and +ok to resume the USB device IP. + +Signed-off-by: Nicolas Ferre <nicolas.ferre@rfo.atmel.com> +Acked-by: David Brownell <david-b@pacbell.net> +Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/gadget/at91_udc.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/gadget/at91_udc.c ++++ b/drivers/usb/gadget/at91_udc.c +@@ -887,6 +887,7 @@ static void pullup(struct at91_udc *udc, + + if (is_on) { + clk_on(udc); ++ at91_udp_write(udc, AT91_UDP_ICR, AT91_UDP_RXRSM); + at91_udp_write(udc, AT91_UDP_TXVC, 0); + if (cpu_is_at91rm9200()) + at91_set_gpio_value(udc->board.pullup_pin, 1); +@@ -904,6 +905,7 @@ static void pullup(struct at91_udc *udc, + } + } else { + stop_activity(udc); ++ at91_udp_write(udc, AT91_UDP_IDR, AT91_UDP_RXRSM); + at91_udp_write(udc, AT91_UDP_TXVC, AT91_UDP_TXVC_TXVDIS); + if (cpu_is_at91rm9200()) + at91_set_gpio_value(udc->board.pullup_pin, 0); diff --git a/usb/usb-convert-ohci-debug-files-to-use-debugfs-instead-of-sysfs.patch b/usb/usb-convert-ohci-debug-files-to-use-debugfs-instead-of-sysfs.patch index 0a7748052887a2..a6312364bf626b 100644 --- a/usb/usb-convert-ohci-debug-files-to-use-debugfs-instead-of-sysfs.patch +++ b/usb/usb-convert-ohci-debug-files-to-use-debugfs-instead-of-sysfs.patch @@ -327,7 +327,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> #include <asm/io.h> #include <asm/irq.h> -@@ -1065,6 +1066,18 @@ static int __init ohci_hcd_mod_init(void +@@ -1068,6 +1069,18 @@ static int __init ohci_hcd_mod_init(void pr_debug ("%s: block sizes: ed %Zd td %Zd\n", hcd_name, sizeof (struct ed), sizeof (struct td)); @@ -346,7 +346,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> #ifdef PS3_SYSTEM_BUS_DRIVER retval = ps3_ohci_driver_register(&PS3_SYSTEM_BUS_DRIVER); if (retval < 0) -@@ -1127,6 +1140,11 @@ static int __init ohci_hcd_mod_init(void +@@ -1130,6 +1143,11 @@ static int __init ohci_hcd_mod_init(void ps3_ohci_driver_unregister(&PS3_SYSTEM_BUS_DRIVER); error_ps3: #endif @@ -358,7 +358,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> return retval; } module_init(ohci_hcd_mod_init); -@@ -1151,6 +1169,9 @@ static void __exit ohci_hcd_mod_exit(voi +@@ -1154,6 +1172,9 @@ static void __exit ohci_hcd_mod_exit(voi #ifdef PS3_SYSTEM_BUS_DRIVER ps3_ohci_driver_unregister(&PS3_SYSTEM_BUS_DRIVER); #endif diff --git a/usb/usb-fix-locking-loop-by-avoiding-flush_scheduled_work.patch b/usb/usb-fix-locking-loop-by-avoiding-flush_scheduled_work.patch new file mode 100644 index 00000000000000..24a7ae3a0d1466 --- /dev/null +++ b/usb/usb-fix-locking-loop-by-avoiding-flush_scheduled_work.patch @@ -0,0 +1,38 @@ +From linux-usb-owner@vger.kernel.org Tue Dec 11 13:02:30 2007 +From: Alan Stern <stern@rowland.harvard.edu> +Date: Tue, 11 Dec 2007 16:02:23 -0500 (EST) +Subject: USB: fix locking loop by avoiding flush_scheduled_work +To: Greg KH <greg@kroah.com> +Cc: David Brownell <david-b@pacbell.net>, USB list <linux-usb@vger.kernel.org>, USB development list <linux-usb-devel@lists.sourceforge.net> +Message-ID: <Pine.LNX.4.44L0.0712111436550.6548-100000@iolanthe.rowland.org> + + +This patch (as1027) replaces a call to flush_scheduled_work() -- a +dangerous routine to invoke, especially while holding any sort of lock +-- with calls to cancel_work_sync() and cancel_delayed_work_sync(). + +This fixes Bugzilla #9532. + +Signed-off-by: Alan Stern <stern@rowland.harvard.edu> +CC: David Brownell <david-b@pacbell.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/core/hub.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -522,9 +522,9 @@ static void hub_quiesce(struct usb_hub * + /* (blocking) stop khubd and related activity */ + usb_kill_urb(hub->urb); + if (hub->has_indicators) +- cancel_delayed_work(&hub->leds); +- if (hub->has_indicators || hub->tt.hub) +- flush_scheduled_work(); ++ cancel_delayed_work_sync(&hub->leds); ++ if (hub->tt.hub) ++ cancel_work_sync(&hub->tt.kevent); + } + + static void hub_activate(struct usb_hub *hub) diff --git a/usb/usb-remove-broken-optimisation-in-ohci-irq-handler.patch b/usb/usb-remove-broken-optimisation-in-ohci-irq-handler.patch new file mode 100644 index 00000000000000..11333975101c21 --- /dev/null +++ b/usb/usb-remove-broken-optimisation-in-ohci-irq-handler.patch @@ -0,0 +1,71 @@ +From david-b@pacbell.net Thu Dec 6 13:29:54 2007 +From: Benjamin Herrenschmidt <benh@kernel.crashing.org> +Date: Thu, 6 Dec 2007 13:28:25 -0800 +Subject: usb: Remove broken optimisation in OHCI IRQ handler +To: Greg KH <greg@kroah.com> +Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>, linux-usb-devel@lists.sourceforge.net, linuxppc-dev@ozlabs.org +Message-ID: <200712061328.26235.david-b@pacbell.net> +Content-Disposition: inline + +From: Benjamin Herrenschmidt <benh@kernel.crashing.org> + +Subject: [PATCH 1/2] usb: Remove broken optimisation in OHCI IRQ handler + +The OHCI IRQ handler has an optimisation that avoids reading some +chip registers when the controller reports that the interrupt was +triggered *only* because completed requests were written into the +controller's "done list" and handed to the host. + +This mechanism can't be used on some controllers. Among others, it +fails for the SA1111 and the AMCC 440EP PowerPC processor. + +This patch removes the optimisation and makes the code clearer. + +Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/ohci-hcd.c | 23 +++++++++++++---------- + 1 file changed, 13 insertions(+), 10 deletions(-) + +--- a/drivers/usb/host/ohci-hcd.c ++++ b/drivers/usb/host/ohci-hcd.c +@@ -732,24 +732,27 @@ static irqreturn_t ohci_irq (struct usb_ + struct ohci_regs __iomem *regs = ohci->regs; + int ints; + +- /* we can eliminate a (slow) ohci_readl() +- * if _only_ WDH caused this irq ++ /* Read interrupt status (and flush pending writes). We ignore the ++ * optimization of checking the LSB of hcca->done_head; it doesn't ++ * work on all systems (edge triggering for OHCI can be a factor). + */ +- if ((ohci->hcca->done_head != 0) +- && ! (hc32_to_cpup (ohci, &ohci->hcca->done_head) +- & 0x01)) { +- ints = OHCI_INTR_WDH; ++ ints = ohci_readl(ohci, ®s->intrstatus); + +- /* cardbus/... hardware gone before remove() */ +- } else if ((ints = ohci_readl (ohci, ®s->intrstatus)) == ~(u32)0) { ++ /* Check for an all 1's result which is a typical consequence ++ * of dead, unclocked, or unplugged (CardBus...) devices ++ */ ++ if (ints == ~(u32)0) { + disable (ohci); + ohci_dbg (ohci, "device removed!\n"); + return IRQ_HANDLED; ++ } ++ ++ /* We only care about interrupts that are enabled */ ++ ints &= ohci_readl(ohci, ®s->intrenable); + + /* interrupt for some other device? */ +- } else if ((ints &= ohci_readl (ohci, ®s->intrenable)) == 0) { ++ if (ints == 0) + return IRQ_NOTMINE; +- } + + if (ints & OHCI_INTR_UE) { + // e.g. due to PCI Master/Target Abort diff --git a/usb/usb-remove-ohci-useless-masking-unmasking-of-wdh-interrupt.patch b/usb/usb-remove-ohci-useless-masking-unmasking-of-wdh-interrupt.patch new file mode 100644 index 00000000000000..da89528c069296 --- /dev/null +++ b/usb/usb-remove-ohci-useless-masking-unmasking-of-wdh-interrupt.patch @@ -0,0 +1,45 @@ +From david-b@pacbell.net Thu Dec 6 13:29:54 2007 +From: Benjamin Herrenschmidt <benh@kernel.crashing.org> +Date: Thu, 6 Dec 2007 13:29:46 -0800 +Subject: usb: Remove OHCI useless masking/unmasking of WDH interrupt +To: Greg KH <greg@kroah.com> +Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>, linux-usb-devel@lists.sourceforge.net, linuxppc-dev@ozlabs.org +Message-ID: <200712061329.47591.david-b@pacbell.net> +Content-Disposition: inline + + +From: Benjamin Herrenschmidt <benh@kernel.crashing.org> + +Subject: [PATCH 2/2] usb: Remove OHCI useless masking/unmasking of WDH interrupt + +The OHCI driver's IRQ handler, while processing a WDH interrupt, masks +and unmasks it. I believe this is both broken (the write may still be +posted during the donelist processing it's trying to safeguard) and +useless as this IRQ may not be reissued until it's acked (unless this +legacy code is an uncommented workaround for some chip erratum). + +Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> +Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/usb/host/ohci-hcd.c | 4 ---- + 1 file changed, 4 deletions(-) + +--- a/drivers/usb/host/ohci-hcd.c ++++ b/drivers/usb/host/ohci-hcd.c +@@ -810,13 +810,9 @@ static irqreturn_t ohci_irq (struct usb_ + } + + if (ints & OHCI_INTR_WDH) { +- if (HC_IS_RUNNING(hcd->state)) +- ohci_writel (ohci, OHCI_INTR_WDH, ®s->intrdisable); + spin_lock (&ohci->lock); + dl_done_list (ohci); + spin_unlock (&ohci->lock); +- if (HC_IS_RUNNING(hcd->state)) +- ohci_writel (ohci, OHCI_INTR_WDH, ®s->intrenable); + } + + if (quirk_zfmicro(ohci) && (ints & OHCI_INTR_SF)) { diff --git a/usb/usb-revert-portions-of-unusual_dev-sync-up-some-reported-devices-from-ubuntu.patch b/usb/usb-revert-portions-of-unusual_dev-sync-up-some-reported-devices-from-ubuntu.patch new file mode 100644 index 00000000000000..efd736f397c961 --- /dev/null +++ b/usb/usb-revert-portions-of-unusual_dev-sync-up-some-reported-devices-from-ubuntu.patch @@ -0,0 +1,42 @@ +From 67fa10627ec0d8aa16f1cf38cf527e67d8097d3c Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman <gregkh@suse.de> +Date: Fri, 14 Dec 2007 19:18:31 -0500 +Subject: USB: revert portions of "UNUSUAL_DEV: Sync up some reported devices from Ubuntu" + +From: Greg Kroah-Hartman <gregkh@suse.de> + +This reverts one change from 67fa10627ec0d8aa16f1cf38cf527e67d8097d3c +that prevented userspace from seing the "driver disk" lun in a san disk +device. The kernel shouldn't do this, it's up to userspace to handle +this properly, if it somehow wants to filter this away. + + +Cc: Ben Collins <bcollins@ubuntu.com> +Cc: Alan Stern <stern@rowland.harvard.edu> +Cc: Phil Dibowitz <phil@ipom.com> +Cc: Kyle McMartin <kyle@mcmartin.ca> +Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net> +Cc: Hans de Goede <j.w.r.degoede@hhs.nl> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/storage/unusual_devs.h | 8 -------- + 1 file changed, 8 deletions(-) + +--- a/drivers/usb/storage/unusual_devs.h ++++ b/drivers/usb/storage/unusual_devs.h +@@ -1265,14 +1265,6 @@ UNUSUAL_DEV( 0x0ace, 0x20ff, 0x0101, 0x0 + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_IGNORE_DEVICE ), + +-/* SanDisk that has a second LUN for a driver ISO, reported by +- * Ben Collins <bcollins@ubuntu.com> */ +-UNUSUAL_DEV( 0x0781, 0x5406, 0x0000, 0xffff, +- "SanDisk", +- "U3 Cruzer Micro driver ISO", +- US_SC_DEVICE, US_PR_DEVICE, NULL, +- US_FL_SINGLE_LUN ), +- + #ifdef CONFIG_USB_STORAGE_ISD200 + UNUSUAL_DEV( 0x0bf6, 0xa001, 0x0100, 0x0110, + "ATI", diff --git a/usb/usb-usb-peripheral-controller-driver-oops-avoidance.patch b/usb/usb-usb-peripheral-controller-driver-oops-avoidance.patch index 0e47741440db28..4d1befe3e4d1a9 100644 --- a/usb/usb-usb-peripheral-controller-driver-oops-avoidance.patch +++ b/usb/usb-usb-peripheral-controller-driver-oops-avoidance.patch @@ -41,7 +41,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> /* set SD */ --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c -@@ -1614,6 +1614,8 @@ int usb_gadget_unregister_driver (struct +@@ -1616,6 +1616,8 @@ int usb_gadget_unregister_driver (struct local_irq_enable(); driver->unbind(&udc->gadget); diff --git a/usb/usb-use-irqf_disabled-for-hcd-interrupt-handlers.patch b/usb/usb-use-irqf_disabled-for-hcd-interrupt-handlers.patch new file mode 100644 index 00000000000000..1d9a76e7713331 --- /dev/null +++ b/usb/usb-use-irqf_disabled-for-hcd-interrupt-handlers.patch @@ -0,0 +1,126 @@ +From linux-usb-owner@vger.kernel.org Thu Dec 6 11:48:39 2007 +From: Alan Stern <stern@rowland.harvard.edu> +Date: Thu, 6 Dec 2007 14:47:08 -0500 (EST) +Subject: USB: use IRQF_DISABLED for HCD interrupt handlers +To: Greg KH <greg@kroah.com> +Cc: USB list <linux-usb@vger.kernel.org>, USB development list <linux-usb-devel@lists.sourceforge.net> +Message-ID: <Pine.LNX.4.44L0.0712061252210.4308-100000@iolanthe.rowland.org> + +From: Alan Stern <stern@rowland.harvard.edu> + +Host controller IRQs are supposed to be serviced with interrupts +disabled. This patch (as1026) adds an IRQF_DISABLED flag to all the +controller drivers that lack it. It also replaces the +spin_lock_irqsave() and spin_unlock_irqrestore() calls in uhci_irq() +with simple spin_lock() and spin_unlock(). + +This fixes Bugzilla #9335. + +Signed-off-by: Alan Stern <stern@rowland.harvard.edu> +Acked-by: David Brownell <david-b@pacbell.net> +Signed-off-by: Andrew Morton <akpm@linux-foundation.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/core/hcd-pci.c | 2 +- + drivers/usb/host/ehci-fsl.c | 2 +- + drivers/usb/host/ohci-ppc-of.c | 2 +- + drivers/usb/host/ohci-ssb.c | 2 +- + drivers/usb/host/r8a66597-hcd.c | 2 +- + drivers/usb/host/uhci-hcd.c | 9 ++++----- + 6 files changed, 9 insertions(+), 10 deletions(-) + +--- a/drivers/usb/core/hcd-pci.c ++++ b/drivers/usb/core/hcd-pci.c +@@ -125,7 +125,7 @@ int usb_hcd_pci_probe (struct pci_dev *d + + pci_set_master (dev); + +- retval = usb_add_hcd (hcd, dev->irq, IRQF_SHARED); ++ retval = usb_add_hcd(hcd, dev->irq, IRQF_DISABLED | IRQF_SHARED); + if (retval != 0) + goto err4; + return retval; +--- a/drivers/usb/host/ehci-fsl.c ++++ b/drivers/usb/host/ehci-fsl.c +@@ -122,7 +122,7 @@ int usb_hcd_fsl_probe(const struct hc_dr + temp = in_le32(hcd->regs + 0x1a8); + out_le32(hcd->regs + 0x1a8, temp | 0x3); + +- retval = usb_add_hcd(hcd, irq, IRQF_SHARED); ++ retval = usb_add_hcd(hcd, irq, IRQF_DISABLED | IRQF_SHARED); + if (retval != 0) + goto err4; + return retval; +--- a/drivers/usb/host/ohci-ppc-of.c ++++ b/drivers/usb/host/ohci-ppc-of.c +@@ -142,7 +142,7 @@ ohci_hcd_ppc_of_probe(struct of_device * + + ohci_hcd_init(ohci); + +- rv = usb_add_hcd(hcd, irq, 0); ++ rv = usb_add_hcd(hcd, irq, IRQF_DISABLED); + if (rv == 0) + return 0; + +--- a/drivers/usb/host/ohci-ssb.c ++++ b/drivers/usb/host/ohci-ssb.c +@@ -160,7 +160,7 @@ static int ssb_ohci_attach(struct ssb_de + hcd->regs = ioremap_nocache(hcd->rsrc_start, hcd->rsrc_len); + if (!hcd->regs) + goto err_put_hcd; +- err = usb_add_hcd(hcd, dev->irq, IRQF_SHARED); ++ err = usb_add_hcd(hcd, dev->irq, IRQF_DISABLED | IRQF_SHARED); + if (err) + goto err_iounmap; + +--- a/drivers/usb/host/r8a66597-hcd.c ++++ b/drivers/usb/host/r8a66597-hcd.c +@@ -2197,7 +2197,7 @@ static int __init r8a66597_probe(struct + INIT_LIST_HEAD(&r8a66597->child_device); + + hcd->rsrc_start = res->start; +- ret = usb_add_hcd(hcd, irq, 0); ++ ret = usb_add_hcd(hcd, irq, IRQF_DISABLED); + if (ret != 0) { + err("Failed to add hcd"); + goto clean_up; +--- a/drivers/usb/host/uhci-hcd.c ++++ b/drivers/usb/host/uhci-hcd.c +@@ -378,7 +378,6 @@ static irqreturn_t uhci_irq(struct usb_h + { + struct uhci_hcd *uhci = hcd_to_uhci(hcd); + unsigned short status; +- unsigned long flags; + + /* + * Read the interrupt status, and write it back to clear the +@@ -398,7 +397,7 @@ static irqreturn_t uhci_irq(struct usb_h + dev_err(uhci_dev(uhci), "host controller process " + "error, something bad happened!\n"); + if (status & USBSTS_HCH) { +- spin_lock_irqsave(&uhci->lock, flags); ++ spin_lock(&uhci->lock); + if (uhci->rh_state >= UHCI_RH_RUNNING) { + dev_err(uhci_dev(uhci), + "host controller halted, " +@@ -415,16 +414,16 @@ static irqreturn_t uhci_irq(struct usb_h + * pending unlinks */ + mod_timer(&hcd->rh_timer, jiffies); + } +- spin_unlock_irqrestore(&uhci->lock, flags); ++ spin_unlock(&uhci->lock); + } + } + + if (status & USBSTS_RD) + usb_hcd_poll_rh_status(hcd); + else { +- spin_lock_irqsave(&uhci->lock, flags); ++ spin_lock(&uhci->lock); + uhci_scan_schedule(uhci); +- spin_unlock_irqrestore(&uhci->lock, flags); ++ spin_unlock(&uhci->lock); + } + + return IRQ_HANDLED; |
