From: Greg Kroah-Hartman Date: Thu, 24 May 2012 19:19:23 +0000 (+0900) Subject: 3.4-stable patches X-Git-Tag: v3.0.33~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=77abb8e92fecfba57253fdd68d8e5667cb2125e5;p=thirdparty%2Fkernel%2Fstable-queue.git 3.4-stable patches added patches: 8250.c-less-than-2400-baud-fix.patch 8250_pci-fix-pch-uart-matching.patch add-missing-call-to-uart_update_timeout.patch md-using-gfp_noio-to-allocate-bio-for-flush-request.patch mm-mempolicy-let-vma_merge-and-vma_split-handle.patch tty-allow-uart_register-unregister-register.patch usb-cdc-wdm-cannot-use-dev_printk-when-device-is-gone.patch usb-cdc-wdm-fix-memory-leak.patch usb-cdc-wdm-poll-must-return-pollhup-if-device-is-gone.patch usb-cdc-wdm-remove-from-device-list-on-disconnect.patch usb-cdc-wdm-sanitize-error-returns.patch usb-ehci-omap-finish-ehci-omap-phy-reset-cycle-before-adding-hcd.patch usb-ehci-platform-remove-update_device.patch usb-ffs-test-fix-length-argument-of-out-function-call.patch usb-ftdi-sio-add-support-for-physik-instrumente-e-861.patch usb-gpio_vbus-provide-an-appropriate-debounce-interval.patch usb-serial-ftdi_sio-fix-oops-during-autosuspend.patch usb-storage-unusual_devs-entry-for-yarvik-pmp400-mp4-player.patch usb-usbtest-two-super-speed-fixes-for-usbtest.patch workqueue-skip-nr_running-sanity-check-in-worker_enter_idle-if-trustee-is-active.patch --- diff --git a/queue-3.4/8250.c-less-than-2400-baud-fix.patch b/queue-3.4/8250.c-less-than-2400-baud-fix.patch new file mode 100644 index 00000000000..3bdbc6d2673 --- /dev/null +++ b/queue-3.4/8250.c-less-than-2400-baud-fix.patch @@ -0,0 +1,47 @@ +From f9a9111b540fd67db5dab332f4b83d86c90e27b1 Mon Sep 17 00:00:00 2001 +From: Christian Melki +Date: Mon, 30 Apr 2012 11:21:26 +0200 +Subject: 8250.c: less than 2400 baud fix. + +From: Christian Melki + +commit f9a9111b540fd67db5dab332f4b83d86c90e27b1 upstream. + +We noticed that we were loosing data at speed less than 2400 baud. +It turned out our (TI16750 compatible) uart with 64 byte outgoing fifo +was truncated to 16 byte (bit 5 sets fifo len) when modifying the fcr +reg. +The input code still fills the buffer with 64 bytes if I remember +correctly and thus data is lost. +Our fix was to remove whiping of the fcr content and just add the +TRIGGER_1 which we want for latency. +I can't see why this would not work on less than 2400 always, for all +uarts ... +Otherwise one would have to make sure the filling of the fifo re-checks +the current state of available fifo size (urrk). + +Signed-off-by: Christian Melki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/serial/8250/8250.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +--- a/drivers/tty/serial/8250/8250.c ++++ b/drivers/tty/serial/8250/8250.c +@@ -2280,10 +2280,11 @@ serial8250_do_set_termios(struct uart_po + quot++; + + if (up->capabilities & UART_CAP_FIFO && port->fifosize > 1) { +- if (baud < 2400) +- fcr = UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_1; +- else +- fcr = uart_config[port->type].fcr; ++ fcr = uart_config[port->type].fcr; ++ if (baud < 2400) { ++ fcr &= ~UART_FCR_TRIGGER_MASK; ++ fcr |= UART_FCR_TRIGGER_1; ++ } + } + + /* diff --git a/queue-3.4/8250_pci-fix-pch-uart-matching.patch b/queue-3.4/8250_pci-fix-pch-uart-matching.patch new file mode 100644 index 00000000000..eb44ae8f7ee --- /dev/null +++ b/queue-3.4/8250_pci-fix-pch-uart-matching.patch @@ -0,0 +1,99 @@ +From aaa10eb1d0034eccc096f583fe308f0921617598 Mon Sep 17 00:00:00 2001 +From: Arnaud Patard +Date: Wed, 25 Apr 2012 12:17:24 +0200 +Subject: 8250_pci: fix pch uart matching + +From: Arnaud Patard + +commit aaa10eb1d0034eccc096f583fe308f0921617598 upstream. + +The rules used to make 8250_pci "ignore" the PCH uarts are lacking pci subids +entries, preventing it to match and thus is breaking serial port support for +theses systems. + +This has been tested on a nanoETXexpress-TT, which has a specifici uart clock. + +Tested-by: Erwan Velu +[stable@: please apply to 3.0-stable, 3.2-stable and 3.3-stable] +Signed-off-by: Arnaud Patard +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/serial/8250/8250_pci.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +--- a/drivers/tty/serial/8250/8250_pci.c ++++ b/drivers/tty/serial/8250/8250_pci.c +@@ -1609,54 +1609,72 @@ static struct pci_serial_quirk pci_seria + { + .vendor = PCI_VENDOR_ID_INTEL, + .device = 0x8811, ++ .subvendor = PCI_ANY_ID, ++ .subdevice = PCI_ANY_ID, + .init = pci_eg20t_init, + .setup = pci_default_setup, + }, + { + .vendor = PCI_VENDOR_ID_INTEL, + .device = 0x8812, ++ .subvendor = PCI_ANY_ID, ++ .subdevice = PCI_ANY_ID, + .init = pci_eg20t_init, + .setup = pci_default_setup, + }, + { + .vendor = PCI_VENDOR_ID_INTEL, + .device = 0x8813, ++ .subvendor = PCI_ANY_ID, ++ .subdevice = PCI_ANY_ID, + .init = pci_eg20t_init, + .setup = pci_default_setup, + }, + { + .vendor = PCI_VENDOR_ID_INTEL, + .device = 0x8814, ++ .subvendor = PCI_ANY_ID, ++ .subdevice = PCI_ANY_ID, + .init = pci_eg20t_init, + .setup = pci_default_setup, + }, + { + .vendor = 0x10DB, + .device = 0x8027, ++ .subvendor = PCI_ANY_ID, ++ .subdevice = PCI_ANY_ID, + .init = pci_eg20t_init, + .setup = pci_default_setup, + }, + { + .vendor = 0x10DB, + .device = 0x8028, ++ .subvendor = PCI_ANY_ID, ++ .subdevice = PCI_ANY_ID, + .init = pci_eg20t_init, + .setup = pci_default_setup, + }, + { + .vendor = 0x10DB, + .device = 0x8029, ++ .subvendor = PCI_ANY_ID, ++ .subdevice = PCI_ANY_ID, + .init = pci_eg20t_init, + .setup = pci_default_setup, + }, + { + .vendor = 0x10DB, + .device = 0x800C, ++ .subvendor = PCI_ANY_ID, ++ .subdevice = PCI_ANY_ID, + .init = pci_eg20t_init, + .setup = pci_default_setup, + }, + { + .vendor = 0x10DB, + .device = 0x800D, ++ .subvendor = PCI_ANY_ID, ++ .subdevice = PCI_ANY_ID, + .init = pci_eg20t_init, + .setup = pci_default_setup, + }, diff --git a/queue-3.4/add-missing-call-to-uart_update_timeout.patch b/queue-3.4/add-missing-call-to-uart_update_timeout.patch new file mode 100644 index 00000000000..7be9131520f --- /dev/null +++ b/queue-3.4/add-missing-call-to-uart_update_timeout.patch @@ -0,0 +1,33 @@ +From 8b979f7c6bf13a57e7b6002f1175312a44773960 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lothar=20Wa=C3=9Fmann?= +Date: Thu, 3 May 2012 11:37:12 +0200 +Subject: Add missing call to uart_update_timeout() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Lothar Waßmann + +commit 8b979f7c6bf13a57e7b6002f1175312a44773960 upstream. + +This patch fixes a problem reported here: +http://article.gmane.org/gmane.linux.ports.arm.kernel/155242/match=auart + +Signed-off-by: Lothar Waßmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/serial/mxs-auart.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/tty/serial/mxs-auart.c ++++ b/drivers/tty/serial/mxs-auart.c +@@ -369,6 +369,8 @@ static void mxs_auart_settermios(struct + + writel(ctrl, u->membase + AUART_LINECTRL); + writel(ctrl2, u->membase + AUART_CTRL2); ++ ++ uart_update_timeout(u, termios->c_cflag, baud); + } + + static irqreturn_t mxs_auart_irq_handle(int irq, void *context) diff --git a/queue-3.4/md-using-gfp_noio-to-allocate-bio-for-flush-request.patch b/queue-3.4/md-using-gfp_noio-to-allocate-bio-for-flush-request.patch new file mode 100644 index 00000000000..66bfece93e9 --- /dev/null +++ b/queue-3.4/md-using-gfp_noio-to-allocate-bio-for-flush-request.patch @@ -0,0 +1,35 @@ +From b5e1b8cee7ad58a15d2fa79bcd7946acb592602d Mon Sep 17 00:00:00 2001 +From: Shaohua Li +Date: Mon, 21 May 2012 09:26:59 +1000 +Subject: md: using GFP_NOIO to allocate bio for flush request + +From: Shaohua Li + +commit b5e1b8cee7ad58a15d2fa79bcd7946acb592602d upstream. + +A flush request is usually issued in transaction commit code path, so +using GFP_KERNEL to allocate memory for flush request bio falls into +the classic deadlock issue. + +This is suitable for any -stable kernel to which it applies as it +avoids a possible deadlock. + +Signed-off-by: Shaohua Li +Signed-off-by: NeilBrown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/md/md.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/md/md.c ++++ b/drivers/md/md.c +@@ -452,7 +452,7 @@ static void submit_flushes(struct work_s + atomic_inc(&rdev->nr_pending); + atomic_inc(&rdev->nr_pending); + rcu_read_unlock(); +- bi = bio_alloc_mddev(GFP_KERNEL, 0, mddev); ++ bi = bio_alloc_mddev(GFP_NOIO, 0, mddev); + bi->bi_end_io = md_end_flush; + bi->bi_private = rdev; + bi->bi_bdev = rdev->bdev; diff --git a/queue-3.4/mm-mempolicy-let-vma_merge-and-vma_split-handle.patch b/queue-3.4/mm-mempolicy-let-vma_merge-and-vma_split-handle.patch new file mode 100644 index 00000000000..a005aa38e33 --- /dev/null +++ b/queue-3.4/mm-mempolicy-let-vma_merge-and-vma_split-handle.patch @@ -0,0 +1,131 @@ +From 05f144a0d5c2207a0349348127f996e104ad7404 Mon Sep 17 00:00:00 2001 +From: Mel Gorman +Date: Wed, 23 May 2012 12:48:13 +0100 +Subject: mm: mempolicy: Let vma_merge and vma_split handle + vma->vm_policy linkages + +From: Mel Gorman + +commit 05f144a0d5c2207a0349348127f996e104ad7404 upstream. + +Dave Jones' system call fuzz testing tool "trinity" triggered the +following bug error with slab debugging enabled + + ============================================================================= + BUG numa_policy (Not tainted): Poison overwritten + ----------------------------------------------------------------------------- + + INFO: 0xffff880146498250-0xffff880146498250. First byte 0x6a instead of 0x6b + INFO: Allocated in mpol_new+0xa3/0x140 age=46310 cpu=6 pid=32154 + __slab_alloc+0x3d3/0x445 + kmem_cache_alloc+0x29d/0x2b0 + mpol_new+0xa3/0x140 + sys_mbind+0x142/0x620 + system_call_fastpath+0x16/0x1b + INFO: Freed in __mpol_put+0x27/0x30 age=46268 cpu=6 pid=32154 + __slab_free+0x2e/0x1de + kmem_cache_free+0x25a/0x260 + __mpol_put+0x27/0x30 + remove_vma+0x68/0x90 + exit_mmap+0x118/0x140 + mmput+0x73/0x110 + exit_mm+0x108/0x130 + do_exit+0x162/0xb90 + do_group_exit+0x4f/0xc0 + sys_exit_group+0x17/0x20 + system_call_fastpath+0x16/0x1b + INFO: Slab 0xffffea0005192600 objects=27 used=27 fp=0x (null) flags=0x20000000004080 + INFO: Object 0xffff880146498250 @offset=592 fp=0xffff88014649b9d0 + +This implied a reference counting bug and the problem happened during +mbind(). + +mbind() applies a new memory policy to a range and uses mbind_range() to +merge existing VMAs or split them as necessary. In the event of splits, +mpol_dup() will allocate a new struct mempolicy and maintain existing +reference counts whose rules are documented in +Documentation/vm/numa_memory_policy.txt . + +The problem occurs with shared memory policies. The vm_op->set_policy +increments the reference count if necessary and split_vma() and +vma_merge() have already handled the existing reference counts. +However, policy_vma() screws it up by replacing an existing +vma->vm_policy with one that potentially has the wrong reference count +leading to a premature free. This patch removes the damage caused by +policy_vma(). + +With this patch applied Dave's trinity tool runs an mbind test for 5 +minutes without error. /proc/slabinfo reported that there are no +numa_policy or shared_policy_node objects allocated after the test +completed and the shared memory region was deleted. + +Signed-off-by: Mel Gorman +Cc: Dave Jones +Cc: KOSAKI Motohiro +Cc: Stephen Wilson +Cc: Christoph Lameter +Cc: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + mm/mempolicy.c | 41 +++++++++++++++++------------------------ + 1 file changed, 17 insertions(+), 24 deletions(-) + +--- a/mm/mempolicy.c ++++ b/mm/mempolicy.c +@@ -607,27 +607,6 @@ check_range(struct mm_struct *mm, unsign + return first; + } + +-/* Apply policy to a single VMA */ +-static int policy_vma(struct vm_area_struct *vma, struct mempolicy *new) +-{ +- int err = 0; +- struct mempolicy *old = vma->vm_policy; +- +- pr_debug("vma %lx-%lx/%lx vm_ops %p vm_file %p set_policy %p\n", +- vma->vm_start, vma->vm_end, vma->vm_pgoff, +- vma->vm_ops, vma->vm_file, +- vma->vm_ops ? vma->vm_ops->set_policy : NULL); +- +- if (vma->vm_ops && vma->vm_ops->set_policy) +- err = vma->vm_ops->set_policy(vma, new); +- if (!err) { +- mpol_get(new); +- vma->vm_policy = new; +- mpol_put(old); +- } +- return err; +-} +- + /* Step 2: apply policy to a range and do splits. */ + static int mbind_range(struct mm_struct *mm, unsigned long start, + unsigned long end, struct mempolicy *new_pol) +@@ -676,9 +655,23 @@ static int mbind_range(struct mm_struct + if (err) + goto out; + } +- err = policy_vma(vma, new_pol); +- if (err) +- goto out; ++ ++ /* ++ * Apply policy to a single VMA. The reference counting of ++ * policy for vma_policy linkages has already been handled by ++ * vma_merge and split_vma as necessary. If this is a shared ++ * policy then ->set_policy will increment the reference count ++ * for an sp node. ++ */ ++ pr_debug("vma %lx-%lx/%lx vm_ops %p vm_file %p set_policy %p\n", ++ vma->vm_start, vma->vm_end, vma->vm_pgoff, ++ vma->vm_ops, vma->vm_file, ++ vma->vm_ops ? vma->vm_ops->set_policy : NULL); ++ if (vma->vm_ops && vma->vm_ops->set_policy) { ++ err = vma->vm_ops->set_policy(vma, new_pol); ++ if (err) ++ goto out; ++ } + } + + out: diff --git a/queue-3.4/series b/queue-3.4/series index 5ea1ba31f7b..c075586b8d2 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -28,3 +28,23 @@ um-fix-__swp_type.patch um-implement-a-custom-pte_same-function.patch persistent_ram-fix-buffer-size-clamping-during-writes.patch docs-update-howto-for-2.6.x-3.x-versioning.patch +usb-cdc-wdm-sanitize-error-returns.patch +usb-cdc-wdm-fix-memory-leak.patch +usb-cdc-wdm-poll-must-return-pollhup-if-device-is-gone.patch +usb-cdc-wdm-cannot-use-dev_printk-when-device-is-gone.patch +usb-cdc-wdm-remove-from-device-list-on-disconnect.patch +workqueue-skip-nr_running-sanity-check-in-worker_enter_idle-if-trustee-is-active.patch +mm-mempolicy-let-vma_merge-and-vma_split-handle.patch +md-using-gfp_noio-to-allocate-bio-for-flush-request.patch +add-missing-call-to-uart_update_timeout.patch +8250.c-less-than-2400-baud-fix.patch +8250_pci-fix-pch-uart-matching.patch +tty-allow-uart_register-unregister-register.patch +usb-ftdi-sio-add-support-for-physik-instrumente-e-861.patch +usb-serial-ftdi_sio-fix-oops-during-autosuspend.patch +usb-storage-unusual_devs-entry-for-yarvik-pmp400-mp4-player.patch +usb-ffs-test-fix-length-argument-of-out-function-call.patch +usb-usbtest-two-super-speed-fixes-for-usbtest.patch +usb-ehci-platform-remove-update_device.patch +usb-ehci-omap-finish-ehci-omap-phy-reset-cycle-before-adding-hcd.patch +usb-gpio_vbus-provide-an-appropriate-debounce-interval.patch diff --git a/queue-3.4/tty-allow-uart_register-unregister-register.patch b/queue-3.4/tty-allow-uart_register-unregister-register.patch new file mode 100644 index 00000000000..1ed50a854d8 --- /dev/null +++ b/queue-3.4/tty-allow-uart_register-unregister-register.patch @@ -0,0 +1,30 @@ +From 1e66cded334e6cea596c72f6f650eec351b1e959 Mon Sep 17 00:00:00 2001 +From: Alan Cox +Date: Mon, 14 May 2012 14:51:22 +0100 +Subject: tty: Allow uart_register/unregister/register + +From: Alan Cox + +commit 1e66cded334e6cea596c72f6f650eec351b1e959 upstream. + +This is legitimate but because we don't clear the drv->state pointer in the +unregister code causes a bogus BUG(). + +Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=42880 +Signed-off-by: Alan Cox +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/serial/serial_core.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/tty/serial/serial_core.c ++++ b/drivers/tty/serial/serial_core.c +@@ -2282,6 +2282,7 @@ void uart_unregister_driver(struct uart_ + tty_unregister_driver(p); + put_tty_driver(p); + kfree(drv->state); ++ drv->state = NULL; + drv->tty_driver = NULL; + } + diff --git a/queue-3.4/usb-cdc-wdm-cannot-use-dev_printk-when-device-is-gone.patch b/queue-3.4/usb-cdc-wdm-cannot-use-dev_printk-when-device-is-gone.patch new file mode 100644 index 00000000000..6474ab30a10 --- /dev/null +++ b/queue-3.4/usb-cdc-wdm-cannot-use-dev_printk-when-device-is-gone.patch @@ -0,0 +1,64 @@ +From 6b0b79d38806481c1c8fffa7c5842f3c83679a42 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= +Date: Wed, 9 May 2012 13:53:22 +0200 +Subject: USB: cdc-wdm: cannot use dev_printk when device is gone +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Bjørn Mork + +commit 6b0b79d38806481c1c8fffa7c5842f3c83679a42 upstream. + +We cannot dereference a removed USB interface for +dev_printk. Use pr_debug instead where necessary. + +Flush errors are expected if device is unplugged and are +therefore best ingored at this point. + +Move the kill_urbs() call in wdm_release with dev_dbg() +for the non disconnect, as we know it has already been +called if WDM_DISCONNECTING is set. This does not +actually fix anything, but keeps the code more consistent. + +Cc: Oliver Neukum +Signed-off-by: Bjørn Mork +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/class/cdc-wdm.c | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +--- a/drivers/usb/class/cdc-wdm.c ++++ b/drivers/usb/class/cdc-wdm.c +@@ -530,7 +530,9 @@ static int wdm_flush(struct file *file, + struct wdm_device *desc = file->private_data; + + wait_event(desc->wait, !test_bit(WDM_IN_USE, &desc->flags)); +- if (desc->werr < 0) ++ ++ /* cannot dereference desc->intf if WDM_DISCONNECTING */ ++ if (desc->werr < 0 && !test_bit(WDM_DISCONNECTING, &desc->flags)) + dev_err(&desc->intf->dev, "Error in flush path: %d\n", + desc->werr); + +@@ -621,12 +623,15 @@ static int wdm_release(struct inode *ino + mutex_unlock(&desc->wlock); + + if (!desc->count) { +- dev_dbg(&desc->intf->dev, "wdm_release: cleanup"); +- kill_urbs(desc); +- if (!test_bit(WDM_DISCONNECTING, &desc->flags)) ++ if (!test_bit(WDM_DISCONNECTING, &desc->flags)) { ++ dev_dbg(&desc->intf->dev, "wdm_release: cleanup"); ++ kill_urbs(desc); + desc->manage_power(desc->intf, 0); +- else ++ } else { ++ /* must avoid dev_printk here as desc->intf is invalid */ ++ pr_debug(KBUILD_MODNAME " %s: device gone - cleaning up\n", __func__); + cleanup(desc); ++ } + } + mutex_unlock(&wdm_mutex); + return 0; diff --git a/queue-3.4/usb-cdc-wdm-fix-memory-leak.patch b/queue-3.4/usb-cdc-wdm-fix-memory-leak.patch new file mode 100644 index 00000000000..04971832e1f --- /dev/null +++ b/queue-3.4/usb-cdc-wdm-fix-memory-leak.patch @@ -0,0 +1,31 @@ +From 2f338c8a1904e2e7aa5a8bd12fb0cf2422d17da4 Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Fri, 27 Apr 2012 14:36:37 +0200 +Subject: USB: cdc-wdm: fix memory leak + +From: Oliver Neukum + +commit 2f338c8a1904e2e7aa5a8bd12fb0cf2422d17da4 upstream. + +cleanup() is not called if the last close() comes after +disconnect(). That leads to a memory leak. Rectified +by checking for an earlier disconnect() in release() + +Signed-off-by: Oliver Neukum +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/class/cdc-wdm.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/class/cdc-wdm.c ++++ b/drivers/usb/class/cdc-wdm.c +@@ -625,6 +625,8 @@ static int wdm_release(struct inode *ino + kill_urbs(desc); + if (!test_bit(WDM_DISCONNECTING, &desc->flags)) + desc->manage_power(desc->intf, 0); ++ else ++ cleanup(desc); + } + mutex_unlock(&wdm_mutex); + return 0; diff --git a/queue-3.4/usb-cdc-wdm-poll-must-return-pollhup-if-device-is-gone.patch b/queue-3.4/usb-cdc-wdm-poll-must-return-pollhup-if-device-is-gone.patch new file mode 100644 index 00000000000..52bb59f0c8d --- /dev/null +++ b/queue-3.4/usb-cdc-wdm-poll-must-return-pollhup-if-device-is-gone.patch @@ -0,0 +1,34 @@ +From 616b6937e348ef2b4c6ea5fef2cd3c441145efb0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= +Date: Wed, 9 May 2012 13:53:21 +0200 +Subject: USB: cdc-wdm: poll must return POLLHUP if device is gone +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Bjørn Mork + +commit 616b6937e348ef2b4c6ea5fef2cd3c441145efb0 upstream. + +Else the poll will be restarted indefinitely in a tight loop, +preventing final device cleanup. + +Cc: Oliver Neukum +Signed-off-by: Bjørn Mork +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/class/cdc-wdm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/class/cdc-wdm.c ++++ b/drivers/usb/class/cdc-wdm.c +@@ -545,7 +545,7 @@ static unsigned int wdm_poll(struct file + + spin_lock_irqsave(&desc->iuspin, flags); + if (test_bit(WDM_DISCONNECTING, &desc->flags)) { +- mask = POLLERR; ++ mask = POLLHUP | POLLERR; + spin_unlock_irqrestore(&desc->iuspin, flags); + goto desc_out; + } diff --git a/queue-3.4/usb-cdc-wdm-remove-from-device-list-on-disconnect.patch b/queue-3.4/usb-cdc-wdm-remove-from-device-list-on-disconnect.patch new file mode 100644 index 00000000000..aee88eec14f --- /dev/null +++ b/queue-3.4/usb-cdc-wdm-remove-from-device-list-on-disconnect.patch @@ -0,0 +1,65 @@ +From 6286d85e8efdb59252d1ceb99a56fa6b0b11526c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= +Date: Wed, 9 May 2012 13:53:23 +0200 +Subject: USB: cdc-wdm: remove from device list on disconnect +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Bjørn Mork + +commit 6286d85e8efdb59252d1ceb99a56fa6b0b11526c upstream. + +Prevents dereferencing an invalid struct usb_interface +pointer. + +Always delete entry from device list whether or not the +rest of the device state cleanup is postponed. The device +list uses desc->intf as key, and wdm_open will dereference +this key while searching for a matching device. A device +should not appear in the list unless probe() has succeeded +and disconnect() has not finished. + +Cc: Oliver Neukum +Signed-off-by: Bjørn Mork +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/class/cdc-wdm.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +--- a/drivers/usb/class/cdc-wdm.c ++++ b/drivers/usb/class/cdc-wdm.c +@@ -309,9 +309,6 @@ static void free_urbs(struct wdm_device + + static void cleanup(struct wdm_device *desc) + { +- spin_lock(&wdm_device_list_lock); +- list_del(&desc->device_list); +- spin_unlock(&wdm_device_list_lock); + kfree(desc->sbuf); + kfree(desc->inbuf); + kfree(desc->orq); +@@ -778,6 +775,9 @@ static int wdm_create(struct usb_interfa + out: + return rv; + err: ++ spin_lock(&wdm_device_list_lock); ++ list_del(&desc->device_list); ++ spin_unlock(&wdm_device_list_lock); + cleanup(desc); + return rv; + } +@@ -903,6 +903,12 @@ static void wdm_disconnect(struct usb_in + cancel_work_sync(&desc->rxwork); + mutex_unlock(&desc->wlock); + mutex_unlock(&desc->rlock); ++ ++ /* the desc->intf pointer used as list key is now invalid */ ++ spin_lock(&wdm_device_list_lock); ++ list_del(&desc->device_list); ++ spin_unlock(&wdm_device_list_lock); ++ + if (!desc->count) + cleanup(desc); + mutex_unlock(&wdm_mutex); diff --git a/queue-3.4/usb-cdc-wdm-sanitize-error-returns.patch b/queue-3.4/usb-cdc-wdm-sanitize-error-returns.patch new file mode 100644 index 00000000000..7b2d22e93fd --- /dev/null +++ b/queue-3.4/usb-cdc-wdm-sanitize-error-returns.patch @@ -0,0 +1,30 @@ +From 24a85bae5da2b43fed423859c09c5a81ab359473 Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Fri, 27 Apr 2012 14:23:54 +0200 +Subject: USB: cdc-wdm: sanitize error returns + +From: Oliver Neukum + +commit 24a85bae5da2b43fed423859c09c5a81ab359473 upstream. + +wdm_flush() returns unsanitized USB error codes. +They must be cleaned up to before being anded to user space + +Signed-off-by: Oliver Neukum +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/class/cdc-wdm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/class/cdc-wdm.c ++++ b/drivers/usb/class/cdc-wdm.c +@@ -534,7 +534,7 @@ static int wdm_flush(struct file *file, + dev_err(&desc->intf->dev, "Error in flush path: %d\n", + desc->werr); + +- return desc->werr; ++ return usb_translate_errors(desc->werr); + } + + static unsigned int wdm_poll(struct file *file, struct poll_table_struct *wait) diff --git a/queue-3.4/usb-ehci-omap-finish-ehci-omap-phy-reset-cycle-before-adding-hcd.patch b/queue-3.4/usb-ehci-omap-finish-ehci-omap-phy-reset-cycle-before-adding-hcd.patch new file mode 100644 index 00000000000..3e8054af441 --- /dev/null +++ b/queue-3.4/usb-ehci-omap-finish-ehci-omap-phy-reset-cycle-before-adding-hcd.patch @@ -0,0 +1,58 @@ +From 3aa2ae74ba630ec9b98736d64aea8e4cb490861d Mon Sep 17 00:00:00 2001 +From: Russ Dill +Date: Fri, 4 May 2012 04:24:47 -0700 +Subject: USB: EHCI: OMAP: Finish ehci omap phy reset cycle before adding hcd. + +From: Russ Dill + +commit 3aa2ae74ba630ec9b98736d64aea8e4cb490861d upstream. + +'ARM: OMAP3: USB: Fix the EHCI ULPI PHY reset issue' (1fcb57d0f) created a regression +with Beagleboard xM if booting the kernel after running 'usb start' under u-boot. + +Finishing the reset before calling 'usb_add_hcd' fixes the regression. This is most likely due to +usb_add_hcd calling the driver's reset and init functions which expect the hardware to be +up and running. + +Signed-off-by: Russ Dill +Acked-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/ehci-omap.c | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +--- a/drivers/usb/host/ehci-omap.c ++++ b/drivers/usb/host/ehci-omap.c +@@ -242,15 +242,6 @@ static int ehci_hcd_omap_probe(struct pl + + ehci_reset(omap_ehci); + +- ret = usb_add_hcd(hcd, irq, IRQF_SHARED); +- if (ret) { +- dev_err(dev, "failed to add hcd with err %d\n", ret); +- goto err_add_hcd; +- } +- +- /* root ports should always stay powered */ +- ehci_port_power(omap_ehci, 1); +- + if (pdata->phy_reset) { + /* Hold the PHY in RESET for enough time till + * PHY is settled and ready +@@ -264,6 +255,15 @@ static int ehci_hcd_omap_probe(struct pl + gpio_set_value(pdata->reset_gpio_port[1], 1); + } + ++ ret = usb_add_hcd(hcd, irq, IRQF_SHARED); ++ if (ret) { ++ dev_err(dev, "failed to add hcd with err %d\n", ret); ++ goto err_add_hcd; ++ } ++ ++ /* root ports should always stay powered */ ++ ehci_port_power(omap_ehci, 1); ++ + return 0; + + err_add_hcd: diff --git a/queue-3.4/usb-ehci-platform-remove-update_device.patch b/queue-3.4/usb-ehci-platform-remove-update_device.patch new file mode 100644 index 00000000000..e76bd213509 --- /dev/null +++ b/queue-3.4/usb-ehci-platform-remove-update_device.patch @@ -0,0 +1,31 @@ +From 8377c94f627f7943da9a7eefdb21fd2e9e7ec629 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Fri, 18 May 2012 20:29:56 +0200 +Subject: USB: ehci-platform: remove update_device + +From: Hauke Mehrtens + +commit 8377c94f627f7943da9a7eefdb21fd2e9e7ec629 upstream. + +The update_device callback is not needed and the function used here is +from the pci ehci driver. Without this patch we get a compile error if +ehci-platform is compiled without ehci-pci. + +Signed-off-by: Hauke Mehrtens +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/ehci-platform.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/drivers/usb/host/ehci-platform.c ++++ b/drivers/usb/host/ehci-platform.c +@@ -75,8 +75,6 @@ static const struct hc_driver ehci_platf + .relinquish_port = ehci_relinquish_port, + .port_handed_over = ehci_port_handed_over, + +- .update_device = ehci_update_device, +- + .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, + }; + diff --git a/queue-3.4/usb-ffs-test-fix-length-argument-of-out-function-call.patch b/queue-3.4/usb-ffs-test-fix-length-argument-of-out-function-call.patch new file mode 100644 index 00000000000..7314c86c4b5 --- /dev/null +++ b/queue-3.4/usb-ffs-test-fix-length-argument-of-out-function-call.patch @@ -0,0 +1,32 @@ +From eb9c5836384cd2a276254df6254ed71117983626 Mon Sep 17 00:00:00 2001 +From: Matthias Fend +Date: Mon, 7 May 2012 14:37:30 +0200 +Subject: USB: ffs-test: fix length argument of out function call + +From: Matthias Fend + +commit eb9c5836384cd2a276254df6254ed71117983626 upstream. + +The out functions should only handle actual available data instead of the complete buffer. +Otherwise for example the ep0_consume function will report ghost events since it tries to decode +the complete buffer - which may contain partly invalid data. + +Signed-off-by: Matthias Fend +Acked-by: Michal Nazarewicz +Signed-off-by: Greg Kroah-Hartman + +--- + tools/usb/ffs-test.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/tools/usb/ffs-test.c ++++ b/tools/usb/ffs-test.c +@@ -297,7 +297,7 @@ static void *start_thread_helper(void *a + + ret = t->in(t, t->buf, t->buf_size); + if (ret > 0) { +- ret = t->out(t, t->buf, t->buf_size); ++ ret = t->out(t, t->buf, ret); + name = out_name; + op = "write"; + } else { diff --git a/queue-3.4/usb-ftdi-sio-add-support-for-physik-instrumente-e-861.patch b/queue-3.4/usb-ftdi-sio-add-support-for-physik-instrumente-e-861.patch new file mode 100644 index 00000000000..a382ad8811a --- /dev/null +++ b/queue-3.4/usb-ftdi-sio-add-support-for-physik-instrumente-e-861.patch @@ -0,0 +1,52 @@ +From b69cc672052540e8efb1368420f10d7d4d8b8a3d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=89ric=20Piel?= +Date: Mon, 7 May 2012 12:37:54 +0200 +Subject: USB: ftdi-sio: add support for Physik Instrumente E-861 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Éric Piel + +commit b69cc672052540e8efb1368420f10d7d4d8b8a3d upstream. + +This adds VID/PID for the PI E-861. Without it, I had to do: +modprobe -q ftdi-sio product=0x1008 vendor=0x1a72 + +http://www.physikinstrumente.com/en/products/prdetail.php?sortnr=900610 + +Signed-off-by: Éric Piel +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/ftdi_sio.c | 1 + + drivers/usb/serial/ftdi_sio_ids.h | 8 ++++++++ + 2 files changed, 9 insertions(+) + +--- a/drivers/usb/serial/ftdi_sio.c ++++ b/drivers/usb/serial/ftdi_sio.c +@@ -809,6 +809,7 @@ static struct usb_device_id id_table_com + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, + { USB_DEVICE(LARSENBRUSGAARD_VID, LB_ALTITRACK_PID) }, + { USB_DEVICE(GN_OTOMETRICS_VID, AURICAL_USB_PID) }, ++ { USB_DEVICE(PI_VID, PI_E861_PID) }, + { USB_DEVICE(BAYER_VID, BAYER_CONTOUR_CABLE_PID) }, + { USB_DEVICE(FTDI_VID, MARVELL_OPENRD_PID), + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, +--- a/drivers/usb/serial/ftdi_sio_ids.h ++++ b/drivers/usb/serial/ftdi_sio_ids.h +@@ -785,6 +785,14 @@ + #define RTSYSTEMS_SERIAL_VX7_PID 0x9e52 /* Serial converter for VX-7 Radios using FT232RL */ + #define RTSYSTEMS_CT29B_PID 0x9e54 /* CT29B Radio Cable */ + ++ ++/* ++ * Physik Instrumente ++ * http://www.physikinstrumente.com/en/products/ ++ */ ++#define PI_VID 0x1a72 /* Vendor ID */ ++#define PI_E861_PID 0x1008 /* E-861 piezo controller USB connection */ ++ + /* + * Bayer Ascensia Contour blood glucose meter USB-converter cable. + * http://winglucofacts.com/cables/ diff --git a/queue-3.4/usb-gpio_vbus-provide-an-appropriate-debounce-interval.patch b/queue-3.4/usb-gpio_vbus-provide-an-appropriate-debounce-interval.patch new file mode 100644 index 00000000000..2c6736d6b60 --- /dev/null +++ b/queue-3.4/usb-gpio_vbus-provide-an-appropriate-debounce-interval.patch @@ -0,0 +1,67 @@ +From 934ccec4da14dc0586dfe08b36166364bdd2181b Mon Sep 17 00:00:00 2001 +From: Shinya Kuribayashi +Date: Thu, 10 May 2012 10:31:21 +0900 +Subject: USB: gpio_vbus: provide an appropriate debounce interval + +From: Shinya Kuribayashi + +commit 934ccec4da14dc0586dfe08b36166364bdd2181b upstream. + +In commit c2344f13b59e007d782a3e591ebc551bc583a8b7 (USB: gpio_vbus: +add delayed vbus_session calls, 2009-01-24), usb_gadget_vbus_connect() +and ...disconnect() were extracted from the interrupt handler, so to +allow vbus_session handlers to deal with msleep() calls. + +This patch takes the approach one step further. + +USB2.0 specification (7.1.7.3 Connect and Disconnect Signaling) says +that the USB system software (shall) provide a debounce interval with +a minimum duration of 100 ms, which ensures that the electrical and +mechanical connection is stable before software attempts to reset +the attached device. + +Signed-off-by: Shinya Kuribayashi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/otg/gpio_vbus.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/usb/otg/gpio_vbus.c ++++ b/drivers/usb/otg/gpio_vbus.c +@@ -37,7 +37,7 @@ struct gpio_vbus_data { + struct regulator *vbus_draw; + int vbus_draw_enabled; + unsigned mA; +- struct work_struct work; ++ struct delayed_work work; + }; + + +@@ -94,7 +94,7 @@ static int is_vbus_powered(struct gpio_v + static void gpio_vbus_work(struct work_struct *work) + { + struct gpio_vbus_data *gpio_vbus = +- container_of(work, struct gpio_vbus_data, work); ++ container_of(work, struct gpio_vbus_data, work.work); + struct gpio_vbus_mach_info *pdata = gpio_vbus->dev->platform_data; + int gpio, status; + +@@ -152,7 +152,7 @@ static irqreturn_t gpio_vbus_irq(int irq + otg->gadget ? otg->gadget->name : "none"); + + if (otg->gadget) +- schedule_work(&gpio_vbus->work); ++ schedule_delayed_work(&gpio_vbus->work, msecs_to_jiffies(100)); + + return IRQ_HANDLED; + } +@@ -300,7 +300,7 @@ static int __init gpio_vbus_probe(struct + + ATOMIC_INIT_NOTIFIER_HEAD(&gpio_vbus->phy.notifier); + +- INIT_WORK(&gpio_vbus->work, gpio_vbus_work); ++ INIT_DELAYED_WORK(&gpio_vbus->work, gpio_vbus_work); + + gpio_vbus->vbus_draw = regulator_get(&pdev->dev, "vbus_draw"); + if (IS_ERR(gpio_vbus->vbus_draw)) { diff --git a/queue-3.4/usb-serial-ftdi_sio-fix-oops-during-autosuspend.patch b/queue-3.4/usb-serial-ftdi_sio-fix-oops-during-autosuspend.patch new file mode 100644 index 00000000000..ab625f3f5e5 --- /dev/null +++ b/queue-3.4/usb-serial-ftdi_sio-fix-oops-during-autosuspend.patch @@ -0,0 +1,73 @@ +From 5cbe61c5aff0a8ada691eb8b07dbfb55c303f640 Mon Sep 17 00:00:00 2001 +From: Alan Stern +Date: Mon, 7 May 2012 11:20:06 -0400 +Subject: usb-serial: ftdi_sio: fix oops during autosuspend +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Alan Stern + +commit 5cbe61c5aff0a8ada691eb8b07dbfb55c303f640 upstream. + +This patch (as1550) fixes a bug in the usb-serial core that affects +the ftdi_sio driver and most likely others as well. The core +implements suspend and resume routines, but it doesn't store pointers +to those routines in the usb_driver structures that it registers, +even though it does set those drivers' supports_autosuspend flag. The +end result is that when one of these devices is autosuspended, we try +to call through a NULL pointer. + +The patch fixes the problem by setting the suspend and resume method +pointers to the appropriate routines in the USB serial core, along +with the supports_autosuspend field, in each driver as it is +registered. + +This should be back-ported to all the stable kernels that have the new +usb_serial_register_drivers() interface. + +Signed-off-by: Alan Stern +Reported-and-tested-by: Frank Schäfer +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/serial/usb-serial.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +--- a/drivers/usb/serial/usb-serial.c ++++ b/drivers/usb/serial/usb-serial.c +@@ -1338,7 +1338,6 @@ static int usb_serial_register(struct us + driver->description); + return -EINVAL; + } +- driver->usb_driver->supports_autosuspend = 1; + + /* Add this device to our list of devices */ + mutex_lock(&table_lock); +@@ -1373,7 +1372,7 @@ static void usb_serial_deregister(struct + * @serial_drivers: NULL-terminated array of pointers to drivers to be registered + * + * Registers @udriver and all the drivers in the @serial_drivers array. +- * Automatically fills in the .no_dynamic_id field in @udriver and ++ * Automatically fills in the .no_dynamic_id and PM fields in @udriver and + * the .usb_driver field in each serial driver. + */ + int usb_serial_register_drivers(struct usb_driver *udriver, +@@ -1392,11 +1391,17 @@ int usb_serial_register_drivers(struct u + * the serial drivers are registered, because the probe would + * simply fail for lack of a matching serial driver. + * Therefore save off udriver's id_table until we are all set. ++ * ++ * Suspend/resume support is implemented in the usb-serial core, ++ * so fill in the PM-related fields in udriver. + */ + saved_id_table = udriver->id_table; + udriver->id_table = NULL; + + udriver->no_dynamic_id = 1; ++ udriver->supports_autosuspend = 1; ++ udriver->suspend = usb_serial_suspend; ++ udriver->resume = usb_serial_resume; + rc = usb_register(udriver); + if (rc) + return rc; diff --git a/queue-3.4/usb-storage-unusual_devs-entry-for-yarvik-pmp400-mp4-player.patch b/queue-3.4/usb-storage-unusual_devs-entry-for-yarvik-pmp400-mp4-player.patch new file mode 100644 index 00000000000..0df45975cf1 --- /dev/null +++ b/queue-3.4/usb-storage-unusual_devs-entry-for-yarvik-pmp400-mp4-player.patch @@ -0,0 +1,37 @@ +From df767b71e5816692134d59c0c17e0f77cd73333d Mon Sep 17 00:00:00 2001 +From: Alan Stern +Date: Tue, 8 May 2012 15:15:25 -0400 +Subject: usb-storage: unusual_devs entry for Yarvik PMP400 MP4 player + +From: Alan Stern + +commit df767b71e5816692134d59c0c17e0f77cd73333d upstream. + +This patch (as1553) adds an unusual_dev entrie for the Yarvik PMP400 +MP4 music player. + +Signed-off-by: Alan Stern +Reported-by: Jesse Feddema +Tested-by: Jesse Feddema +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 +@@ -1885,6 +1885,13 @@ UNUSUAL_DEV( 0x1652, 0x6600, 0x0201, 0x + USB_SC_DEVICE, USB_PR_DEVICE, NULL, + US_FL_IGNORE_RESIDUE ), + ++/* Reported by Jesse Feddema */ ++UNUSUAL_DEV( 0x177f, 0x0400, 0x0000, 0x0000, ++ "Yarvik", ++ "PMP400", ++ USB_SC_DEVICE, USB_PR_DEVICE, NULL, ++ US_FL_BULK_IGNORE_TAG | US_FL_MAX_SECTORS_64 ), ++ + /* Reported by Hans de Goede + * These Appotech controllers are found in Picture Frames, they provide a + * (buggy) emulation of a cdrom drive which contains the windows software diff --git a/queue-3.4/usb-usbtest-two-super-speed-fixes-for-usbtest.patch b/queue-3.4/usb-usbtest-two-super-speed-fixes-for-usbtest.patch new file mode 100644 index 00000000000..03fd7ac48e3 --- /dev/null +++ b/queue-3.4/usb-usbtest-two-super-speed-fixes-for-usbtest.patch @@ -0,0 +1,57 @@ +From 6a23ccd216b6a8ba2c67a9f9d8969b4431ad2920 Mon Sep 17 00:00:00 2001 +From: Paul Zimmerman +Date: Mon, 16 Apr 2012 14:19:07 -0700 +Subject: usb: usbtest: two super speed fixes for usbtest + +From: Paul Zimmerman + +commit 6a23ccd216b6a8ba2c67a9f9d8969b4431ad2920 upstream. + +bMaxPacketSize0 field for super speed is a power of 2, not a count. +The size itself is always 512. + +Max packet size for a super speed bulk endpoint is 1024, so +allocate the urb size in halt_simple() accordingly. + +Signed-off-by: Paul Zimmerman +Acked-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/misc/usbtest.c | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +--- a/drivers/usb/misc/usbtest.c ++++ b/drivers/usb/misc/usbtest.c +@@ -1028,7 +1028,10 @@ test_ctrl_queue(struct usbtest_dev *dev, + case 13: /* short read, resembling case 10 */ + req.wValue = cpu_to_le16((USB_DT_CONFIG << 8) | 0); + /* last data packet "should" be DATA1, not DATA0 */ +- len = 1024 - udev->descriptor.bMaxPacketSize0; ++ if (udev->speed == USB_SPEED_SUPER) ++ len = 1024 - 512; ++ else ++ len = 1024 - udev->descriptor.bMaxPacketSize0; + expected = -EREMOTEIO; + break; + case 14: /* short read; try to fill the last packet */ +@@ -1387,11 +1390,15 @@ static int test_halt(struct usbtest_dev + + static int halt_simple(struct usbtest_dev *dev) + { +- int ep; +- int retval = 0; +- struct urb *urb; ++ int ep; ++ int retval = 0; ++ struct urb *urb; ++ struct usb_device *udev = testdev_to_usbdev(dev); + +- urb = simple_alloc_urb(testdev_to_usbdev(dev), 0, 512); ++ if (udev->speed == USB_SPEED_SUPER) ++ urb = simple_alloc_urb(udev, 0, 1024); ++ else ++ urb = simple_alloc_urb(udev, 0, 512); + if (urb == NULL) + return -ENOMEM; + diff --git a/queue-3.4/workqueue-skip-nr_running-sanity-check-in-worker_enter_idle-if-trustee-is-active.patch b/queue-3.4/workqueue-skip-nr_running-sanity-check-in-worker_enter_idle-if-trustee-is-active.patch new file mode 100644 index 00000000000..fbea27594cb --- /dev/null +++ b/queue-3.4/workqueue-skip-nr_running-sanity-check-in-worker_enter_idle-if-trustee-is-active.patch @@ -0,0 +1,48 @@ +From 544ecf310f0e7f51fa057ac2a295fc1b3b35a9d3 Mon Sep 17 00:00:00 2001 +From: Tejun Heo +Date: Mon, 14 May 2012 15:04:50 -0700 +Subject: workqueue: skip nr_running sanity check in worker_enter_idle() if trustee is active + +From: Tejun Heo + +commit 544ecf310f0e7f51fa057ac2a295fc1b3b35a9d3 upstream. + +worker_enter_idle() has WARN_ON_ONCE() which triggers if nr_running +isn't zero when every worker is idle. This can trigger spuriously +while a cpu is going down due to the way trustee sets %WORKER_ROGUE +and zaps nr_running. + +It first sets %WORKER_ROGUE on all workers without updating +nr_running, releases gcwq->lock, schedules, regrabs gcwq->lock and +then zaps nr_running. If the last running worker enters idle +inbetween, it would see stale nr_running which hasn't been zapped yet +and trigger the WARN_ON_ONCE(). + +Fix it by performing the sanity check iff the trustee is idle. + +Signed-off-by: Tejun Heo +Reported-by: "Paul E. McKenney" +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/workqueue.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +--- a/kernel/workqueue.c ++++ b/kernel/workqueue.c +@@ -1210,8 +1210,13 @@ static void worker_enter_idle(struct wor + } else + wake_up_all(&gcwq->trustee_wait); + +- /* sanity check nr_running */ +- WARN_ON_ONCE(gcwq->nr_workers == gcwq->nr_idle && ++ /* ++ * Sanity check nr_running. Because trustee releases gcwq->lock ++ * between setting %WORKER_ROGUE and zapping nr_running, the ++ * warning may trigger spuriously. Check iff trustee is idle. ++ */ ++ WARN_ON_ONCE(gcwq->trustee_state == TRUSTEE_DONE && ++ gcwq->nr_workers == gcwq->nr_idle && + atomic_read(get_gcwq_nr_running(gcwq->cpu))); + } +