From 4822c81f4f06cde9b59b9cd53136a2f7c1c146dc Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 16 Nov 2008 22:18:56 -0800 Subject: [PATCH] more .27 patches --- queue-2.6.27/series | 5 + ...sive-lock-in-acm_start_wb-error-path.patch | 95 ++++++++++ .../usb-fix-ps3-usb-shutdown-problems.patch | 60 +++++++ .../usb-gadget-cdc-acm-deadlock-fix.patch | 43 +++++ ...gs-in-isp1760-fixing-runtime-warning.patch | 163 ++++++++++++++++++ ...or-argosy-usb-mass-storage-interface.patch | 36 ++++ 6 files changed, 402 insertions(+) create mode 100644 queue-2.6.27/usb-cdc-acm.c-fix-recursive-lock-in-acm_start_wb-error-path.patch create mode 100644 queue-2.6.27/usb-fix-ps3-usb-shutdown-problems.patch create mode 100644 queue-2.6.27/usb-gadget-cdc-acm-deadlock-fix.patch create mode 100644 queue-2.6.27/usb-remove-optional-bus-bindings-in-isp1760-fixing-runtime-warning.patch create mode 100644 queue-2.6.27/usb-unusual_devs-entry-for-argosy-usb-mass-storage-interface.patch diff --git a/queue-2.6.27/series b/queue-2.6.27/series index 2a832f2d11a..bc42dd5c288 100644 --- a/queue-2.6.27/series +++ b/queue-2.6.27/series @@ -31,3 +31,8 @@ scsi-qla2xxx-do-not-honour-max_vports-from-firmware-for-2g-isps-and-below.patch scsi-qla2xxx-correct-atmel-flash-part-handling.patch scsi-dpt_i2o-fix-transferred-data-length-for-scsi_set_resid.patch dm-raid1-flush-workqueue-before-destruction.patch +usb-remove-optional-bus-bindings-in-isp1760-fixing-runtime-warning.patch +usb-gadget-cdc-acm-deadlock-fix.patch +usb-unusual_devs-entry-for-argosy-usb-mass-storage-interface.patch +usb-fix-ps3-usb-shutdown-problems.patch +usb-cdc-acm.c-fix-recursive-lock-in-acm_start_wb-error-path.patch diff --git a/queue-2.6.27/usb-cdc-acm.c-fix-recursive-lock-in-acm_start_wb-error-path.patch b/queue-2.6.27/usb-cdc-acm.c-fix-recursive-lock-in-acm_start_wb-error-path.patch new file mode 100644 index 00000000000..e7b44be0e69 --- /dev/null +++ b/queue-2.6.27/usb-cdc-acm.c-fix-recursive-lock-in-acm_start_wb-error-path.patch @@ -0,0 +1,95 @@ +From ad0b65efd12d020b046cde8d6f474e37bb98dd73 Mon Sep 17 00:00:00 2001 +From: Brandon Philips +Date: Thu, 6 Nov 2008 11:19:11 -0800 +Subject: USB: cdc-acm.c: fix recursive lock in acm_start_wb error path + +From: Brandon Philips + +commit ad0b65efd12d020b046cde8d6f474e37bb98dd73 upstream. + +Fixes an obvious bug in cdc-acm by avoiding a recursive lock on +acm_start_wb()'s error path. Should apply towards 2.6.27 stable and +2.6.28. + +============================================= +[ INFO: possible recursive locking detected ] +2.6.27-2-pae #109 +--------------------------------------------- +python/31449 is trying to acquire lock: + (&acm->write_lock){++..}, at: [] acm_start_wb+0x5c/0x7b [cdc_acm] + +but task is already holding lock: + (&acm->write_lock){++..}, at: [] acm_tty_write+0xe1/0x167 [cdc_acm] + +other info that might help us debug this: +2 locks held by python/31449: + #0: (&tty->atomic_write_lock){--..}, at: [] tty_write_lock+0x14/0x3b + #1: (&acm->write_lock){++..}, at: [] acm_tty_write+0xe1/0x167 [cdc_acm] + +stack backtrace: +Pid: 31449, comm: python Not tainted 2.6.27-2-pae #109 + [] ? printk+0xf/0x18 + [] __lock_acquire+0xc7b/0x1316 + [] lock_acquire+0x70/0x97 + [] ? acm_start_wb+0x5c/0x7b [cdc_acm] + [] _spin_lock_irqsave+0x37/0x47 + [] ? acm_start_wb+0x5c/0x7b [cdc_acm] + [] acm_start_wb+0x5c/0x7b [cdc_acm] + [] acm_tty_write+0x143/0x167 [cdc_acm] + [] write_chan+0x1cd/0x297 + [] ? default_wake_function+0x0/0xd + [] tty_write+0x149/0x1b9 + [] ? write_chan+0x0/0x297 + [] ? rw_verify_area+0x76/0x98 + [] ? tty_write+0x0/0x1b9 + [] vfs_write+0x8c/0x136 + [] sys_write+0x3b/0x60 + [] sysenter_do_call+0x12/0x3f + ======================= + +Signed-off-by: Brandon Philips +Cc: Oliver Neukum +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/class/cdc-acm.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +--- a/drivers/usb/class/cdc-acm.c ++++ b/drivers/usb/class/cdc-acm.c +@@ -158,16 +158,12 @@ static int acm_wb_is_avail(struct acm *a + } + + /* +- * Finish write. ++ * Finish write. Caller must hold acm->write_lock + */ + static void acm_write_done(struct acm *acm, struct acm_wb *wb) + { +- unsigned long flags; +- +- spin_lock_irqsave(&acm->write_lock, flags); + wb->use = 0; + acm->transmitting--; +- spin_unlock_irqrestore(&acm->write_lock, flags); + } + + /* +@@ -482,6 +478,7 @@ static void acm_write_bulk(struct urb *u + { + struct acm_wb *wb = urb->context; + struct acm *acm = wb->instance; ++ unsigned long flags; + + if (verbose || urb->status + || (urb->actual_length != urb->transfer_buffer_length)) +@@ -490,7 +487,9 @@ static void acm_write_bulk(struct urb *u + urb->transfer_buffer_length, + urb->status); + ++ spin_lock_irqsave(&acm->write_lock, flags); + acm_write_done(acm, wb); ++ spin_unlock_irqrestore(&acm->write_lock, flags); + if (ACM_READY(acm)) + schedule_work(&acm->work); + else diff --git a/queue-2.6.27/usb-fix-ps3-usb-shutdown-problems.patch b/queue-2.6.27/usb-fix-ps3-usb-shutdown-problems.patch new file mode 100644 index 00000000000..112c2d66bde --- /dev/null +++ b/queue-2.6.27/usb-fix-ps3-usb-shutdown-problems.patch @@ -0,0 +1,60 @@ +From ddcb01ff9bf49c4dbbb058423559f7bc90b89374 Mon Sep 17 00:00:00 2001 +From: Geoff Levand +Date: Fri, 31 Oct 2008 13:52:54 -0700 +Subject: USB: Fix PS3 USB shutdown problems + +From: Geoff Levand + +commit ddcb01ff9bf49c4dbbb058423559f7bc90b89374 upstream. + +Add ehci_shutdown() or ohci_shutdown() calls to the USB +PS3 bus glue. ehci_shutdown() and ohci_shutdown() do some +controller specific cleanups not done by usb_remove_hcd(). + +Fixes errors on shutdown or reboot similar to these: + + ps3-ehci-driver sb_07: HC died; cleaning up + irq 51: nobody cared (try booting with the "irqpoll" option) + +Related bugzilla reports: + + http://bugzilla.kernel.org/show_bug.cgi?id=11819 + http://bugzilla.terrasoftsolutions.com/show_bug.cgi?id=317 + +Signed-off-by: Geoff Levand +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/ehci-ps3.c | 1 + + drivers/usb/host/ohci-ps3.c | 3 ++- + 2 files changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/usb/host/ehci-ps3.c ++++ b/drivers/usb/host/ehci-ps3.c +@@ -205,6 +205,7 @@ static int ps3_ehci_remove(struct ps3_sy + + tmp = hcd->irq; + ++ ehci_shutdown(hcd); + usb_remove_hcd(hcd); + + ps3_system_bus_set_driver_data(dev, NULL); +--- a/drivers/usb/host/ohci-ps3.c ++++ b/drivers/usb/host/ohci-ps3.c +@@ -192,7 +192,7 @@ fail_start: + return result; + } + +-static int ps3_ohci_remove (struct ps3_system_bus_device *dev) ++static int ps3_ohci_remove(struct ps3_system_bus_device *dev) + { + unsigned int tmp; + struct usb_hcd *hcd = +@@ -205,6 +205,7 @@ static int ps3_ohci_remove (struct ps3_s + + tmp = hcd->irq; + ++ ohci_shutdown(hcd); + usb_remove_hcd(hcd); + + ps3_system_bus_set_driver_data(dev, NULL); diff --git a/queue-2.6.27/usb-gadget-cdc-acm-deadlock-fix.patch b/queue-2.6.27/usb-gadget-cdc-acm-deadlock-fix.patch new file mode 100644 index 00000000000..fc73b362fc9 --- /dev/null +++ b/queue-2.6.27/usb-gadget-cdc-acm-deadlock-fix.patch @@ -0,0 +1,43 @@ +From e50ae572b33646656fa7037541613834dcadedfb Mon Sep 17 00:00:00 2001 +From: David Brownell +Date: Wed, 12 Nov 2008 11:35:13 -0800 +Subject: USB: gadget: cdc-acm deadlock fix + +From: David Brownell + +commit e50ae572b33646656fa7037541613834dcadedfb upstream. + +This fixes a deadlock appearing with some USB peripheral drivers +when running CDC ACM gadget code. + +The newish (2.6.27) CDC ACM event notification mechanism sends +messages (IN to the host) which are short enough to fit in most +FIFOs. That means that with some peripheral controller drivers +(evidently not the ones used to verify the notification code!!) +the completion callback can be issued before queue() returns. + +The deadlock would come because the completion callback and the +event-issuing code shared a spinlock. Fix is trivial: drop +that lock while queueing the message. + +Signed-off-by: David Brownell +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/gadget/f_acm.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/usb/gadget/f_acm.c ++++ b/drivers/usb/gadget/f_acm.c +@@ -463,7 +463,11 @@ static int acm_cdc_notify(struct f_acm * + notify->wLength = cpu_to_le16(length); + memcpy(buf, data, length); + ++ /* ep_queue() can complete immediately if it fills the fifo... */ ++ spin_unlock(&acm->lock); + status = usb_ep_queue(ep, req, GFP_ATOMIC); ++ spin_lock(&acm->lock); ++ + if (status < 0) { + ERROR(acm->port.func.config->cdev, + "acm ttyGS%d can't notify serial state, %d\n", diff --git a/queue-2.6.27/usb-remove-optional-bus-bindings-in-isp1760-fixing-runtime-warning.patch b/queue-2.6.27/usb-remove-optional-bus-bindings-in-isp1760-fixing-runtime-warning.patch new file mode 100644 index 00000000000..de3fea1d63e --- /dev/null +++ b/queue-2.6.27/usb-remove-optional-bus-bindings-in-isp1760-fixing-runtime-warning.patch @@ -0,0 +1,163 @@ +From ff30bf1ca4b548c0928dae6bfce89458b95e5bf4 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Sun, 2 Nov 2008 15:25:42 +0100 +Subject: USB: remove optional bus bindings in isp1760, fixing runtime warning + +From: Sebastian Andrzej Siewior + +commit ff30bf1ca4b548c0928dae6bfce89458b95e5bf4 upstream. + +Roland Reported the following: +| kmem_cache_create: duplicate cache isp1760_qtd +| Pid: 461, comm: modprobe Tainted: G W 2.6.28-rc2-git3-default #4 +| Call Trace: +| [] kmem_cache_create+0xc9/0x3a3 +| [] free_pages_bulk+0x16c/0x1c9 +| [] isp1760_init+0x0/0xb [isp1760] +| [] init_kmem_once+0x18/0x5f [isp1760] +| [] isp1760_init+0x5/0xb [isp1760] +| [] _stext+0x4d/0x148 +| [] load_module+0x12cd/0x142e +| [] kmem_cache_destroy+0x0/0xd7 +| [] sys_init_module+0x87/0x176 +| [] sysenter_do_call+0x12/0x2f + +The reason, is that ret is initialized with ENODEV instead of 0 _or_ +the kmem cache is not freed in error case with no bus binding. + +The difference between OF+PCI and OF only is +| 15148 804 32 15984 3e70 isp1760-of-pci.o +| 13748 676 8 14432 3860 isp1760-of.o + +about 1.5 KiB. + +Until there is a checkbox where the user *must* select atleast one item, +and may select multiple entries I don't make it selectable anymore. +Having a driver which can't be used under any circumstances is broken +anyway and I've seen distros shipping it that way. + +Reported-by: Roland Kletzing +Signed-off-by: Sebastian Andrzej Siewior a +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/Kconfig | 23 ++++++----------------- + drivers/usb/host/isp1760-if.c | 22 +++++++++++----------- + 2 files changed, 17 insertions(+), 28 deletions(-) + +--- a/drivers/usb/host/isp1760-if.c ++++ b/drivers/usb/host/isp1760-if.c +@@ -14,16 +14,16 @@ + #include "../core/hcd.h" + #include "isp1760-hcd.h" + +-#ifdef CONFIG_USB_ISP1760_OF ++#ifdef CONFIG_PPC_OF + #include + #include + #endif + +-#ifdef CONFIG_USB_ISP1760_PCI ++#ifdef CONFIG_PCI + #include + #endif + +-#ifdef CONFIG_USB_ISP1760_OF ++#ifdef CONFIG_PPC_OF + static int of_isp1760_probe(struct of_device *dev, + const struct of_device_id *match) + { +@@ -128,7 +128,7 @@ static struct of_platform_driver isp1760 + }; + #endif + +-#ifdef CONFIG_USB_ISP1760_PCI ++#ifdef CONFIG_PCI + static u32 nxp_pci_io_base; + static u32 iolength; + static u32 pci_mem_phy0; +@@ -287,28 +287,28 @@ static struct pci_driver isp1761_pci_dri + + static int __init isp1760_init(void) + { +- int ret = -ENODEV; ++ int ret; + + init_kmem_once(); + +-#ifdef CONFIG_USB_ISP1760_OF ++#ifdef CONFIG_PPC_OF + ret = of_register_platform_driver(&isp1760_of_driver); + if (ret) { + deinit_kmem_cache(); + return ret; + } + #endif +-#ifdef CONFIG_USB_ISP1760_PCI ++#ifdef CONFIG_PCI + ret = pci_register_driver(&isp1761_pci_driver); + if (ret) + goto unreg_of; + #endif + return ret; + +-#ifdef CONFIG_USB_ISP1760_PCI ++#ifdef CONFIG_PCI + unreg_of: + #endif +-#ifdef CONFIG_USB_ISP1760_OF ++#ifdef CONFIG_PPC_OF + of_unregister_platform_driver(&isp1760_of_driver); + #endif + deinit_kmem_cache(); +@@ -318,10 +318,10 @@ module_init(isp1760_init); + + static void __exit isp1760_exit(void) + { +-#ifdef CONFIG_USB_ISP1760_OF ++#ifdef CONFIG_PPC_OF + of_unregister_platform_driver(&isp1760_of_driver); + #endif +-#ifdef CONFIG_USB_ISP1760_PCI ++#ifdef CONFIG_PCI + pci_unregister_driver(&isp1761_pci_driver); + #endif + deinit_kmem_cache(); +--- a/drivers/usb/host/Kconfig ++++ b/drivers/usb/host/Kconfig +@@ -110,29 +110,18 @@ config USB_ISP116X_HCD + + config USB_ISP1760_HCD + tristate "ISP 1760 HCD support" +- depends on USB && EXPERIMENTAL ++ depends on USB && EXPERIMENTAL && (PCI || PPC_OF) + ---help--- + The ISP1760 chip is a USB 2.0 host controller. + + This driver does not support isochronous transfers or OTG. ++ This USB controller is usually attached to a non-DMA-Master ++ capable bus. NXP's eval kit brings this chip on PCI card ++ where the chip itself is behind a PLB to simulate such ++ a bus. + + To compile this driver as a module, choose M here: the +- module will be called isp1760-hcd. +- +-config USB_ISP1760_PCI +- bool "Support for the PCI bus" +- depends on USB_ISP1760_HCD && PCI +- ---help--- +- Enables support for the device present on the PCI bus. +- This should only be required if you happen to have the eval kit from +- NXP and you are going to test it. +- +-config USB_ISP1760_OF +- bool "Support for the OF platform bus" +- depends on USB_ISP1760_HCD && PPC_OF +- ---help--- +- Enables support for the device present on the PowerPC +- OpenFirmware platform bus. ++ module will be called isp1760. + + config USB_OHCI_HCD + tristate "OHCI HCD support" diff --git a/queue-2.6.27/usb-unusual_devs-entry-for-argosy-usb-mass-storage-interface.patch b/queue-2.6.27/usb-unusual_devs-entry-for-argosy-usb-mass-storage-interface.patch new file mode 100644 index 00000000000..37704cce61a --- /dev/null +++ b/queue-2.6.27/usb-unusual_devs-entry-for-argosy-usb-mass-storage-interface.patch @@ -0,0 +1,36 @@ +From 8010e06cc90367b4d3fba3b0ec3ced32360ac890 Mon Sep 17 00:00:00 2001 +From: Alan Stern +Date: Tue, 4 Nov 2008 11:33:35 -0500 +Subject: USB: unusual_devs entry for Argosy USB mass-storage interface + +From: Alan Stern + +commit 8010e06cc90367b4d3fba3b0ec3ced32360ac890 upstream. + +This patch (as1162) adds an unusual_devs entry for Argosy's USB-IDE +interface. This fixes Bugzilla #11843. + +Signed-off-by: Alan Stern +Tested-by: Luciano Rocha +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/storage/unusual_devs.h | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/usb/storage/unusual_devs.h ++++ b/drivers/usb/storage/unusual_devs.h +@@ -1251,6 +1251,13 @@ UNUSUAL_DEV( 0x0839, 0x000a, 0x0001, 0x0 + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_FIX_INQUIRY), + ++/* Reported by Luciano Rocha */ ++UNUSUAL_DEV( 0x0840, 0x0082, 0x0001, 0x0001, ++ "Argosy", ++ "Storage", ++ US_SC_DEVICE, US_PR_DEVICE, NULL, ++ US_FL_FIX_CAPACITY), ++ + /* Entry and supporting patch by Theodore Kilgore . + * Flag will support Bulk devices which use a standards-violating 32-byte + * Command Block Wrapper. Here, the "DC2MEGA" cameras (several brands) with -- 2.47.3