From 60168d9f71972cd3797fe7a25291f3b6d22b1e09 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 31 Jan 2012 10:37:38 -0800 Subject: [PATCH] 3.0-stable patches added patches: drivers-usb-host-ehci-fsl.c-add-missing-iounmap.patch jsm-fixed-eeh-recovery-error.patch serial-amba-pl011-lock-console-writes-against-interrupts.patch tty-fix-uv-serial-console-regression.patch usb-usbsevseg-fix-max-length.patch vmwgfx-fix-assignment-in-vmw_framebuffer_create_handle.patch xhci-cleanup-isoc-transfer-ring-when-td-length-mismatch-found.patch xhci-fix-usb-3.0-device-restart-on-resume.patch --- ...-host-ehci-fsl.c-add-missing-iounmap.patch | 52 ++++++++++++++ queue-3.0/jsm-fixed-eeh-recovery-error.patch | 51 ++++++++++++++ ...ck-console-writes-against-interrupts.patch | 64 +++++++++++++++++ queue-3.0/series | 8 +++ ...tty-fix-uv-serial-console-regression.patch | 70 +++++++++++++++++++ queue-3.0/usb-usbsevseg-fix-max-length.patch | 32 +++++++++ ...ent-in-vmw_framebuffer_create_handle.patch | 31 ++++++++ ...r-ring-when-td-length-mismatch-found.patch | 37 ++++++++++ ...fix-usb-3.0-device-restart-on-resume.patch | 49 +++++++++++++ 9 files changed, 394 insertions(+) create mode 100644 queue-3.0/drivers-usb-host-ehci-fsl.c-add-missing-iounmap.patch create mode 100644 queue-3.0/jsm-fixed-eeh-recovery-error.patch create mode 100644 queue-3.0/serial-amba-pl011-lock-console-writes-against-interrupts.patch create mode 100644 queue-3.0/tty-fix-uv-serial-console-regression.patch create mode 100644 queue-3.0/usb-usbsevseg-fix-max-length.patch create mode 100644 queue-3.0/vmwgfx-fix-assignment-in-vmw_framebuffer_create_handle.patch create mode 100644 queue-3.0/xhci-cleanup-isoc-transfer-ring-when-td-length-mismatch-found.patch create mode 100644 queue-3.0/xhci-fix-usb-3.0-device-restart-on-resume.patch diff --git a/queue-3.0/drivers-usb-host-ehci-fsl.c-add-missing-iounmap.patch b/queue-3.0/drivers-usb-host-ehci-fsl.c-add-missing-iounmap.patch new file mode 100644 index 00000000000..fa26939ad38 --- /dev/null +++ b/queue-3.0/drivers-usb-host-ehci-fsl.c-add-missing-iounmap.patch @@ -0,0 +1,52 @@ +From 2492c6e6454ff3edb11e273b071a6ea80a199c71 Mon Sep 17 00:00:00 2001 +From: Julia Lawall +Date: Thu, 12 Jan 2012 10:55:13 +0100 +Subject: drivers/usb/host/ehci-fsl.c: add missing iounmap + +From: Julia Lawall + +commit 2492c6e6454ff3edb11e273b071a6ea80a199c71 upstream. + +Add missing iounmap in error handling code, in a case where the function +already preforms iounmap on some other execution path. + +A simplified version of the semantic match that finds this problem is as +follows: (http://coccinelle.lip6.fr/) + +// +@@ +expression e; +statement S,S1; +int ret; +@@ +e = \(ioremap\|ioremap_nocache\)(...) +... when != iounmap(e) +if (<+...e...+>) S +... when any + when != iounmap(e) +*if (...) + { ... when != iounmap(e) + return ...; } +... when any +iounmap(e); +// + +Signed-off-by: Julia Lawall +Acked-by: Alan Stern +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/ehci-fsl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/host/ehci-fsl.c ++++ b/drivers/usb/host/ehci-fsl.c +@@ -125,7 +125,7 @@ static int usb_hcd_fsl_probe(const struc + */ + if (pdata->init && pdata->init(pdev)) { + retval = -ENODEV; +- goto err3; ++ goto err4; + } + + /* Enable USB controller, 83xx or 8536 */ diff --git a/queue-3.0/jsm-fixed-eeh-recovery-error.patch b/queue-3.0/jsm-fixed-eeh-recovery-error.patch new file mode 100644 index 00000000000..2d6d15d7c20 --- /dev/null +++ b/queue-3.0/jsm-fixed-eeh-recovery-error.patch @@ -0,0 +1,51 @@ +From 26aa38cafae0dbef3b2fe75ea487c83313c36d45 Mon Sep 17 00:00:00 2001 +From: Lucas Kannebley Tavares +Date: Mon, 9 Jan 2012 10:58:06 -0200 +Subject: jsm: Fixed EEH recovery error + +From: Lucas Kannebley Tavares + +commit 26aa38cafae0dbef3b2fe75ea487c83313c36d45 upstream. + +There was an error on the jsm driver that would cause it to be unable to +recover after a second error is detected. + +At the first error, the device recovers properly: + +[72521.485691] EEH: Detected PCI bus error on device 0003:02:00.0 +[72521.485695] EEH: This PCI device has failed 1 times in the last hour: +... +[72532.035693] ttyn3 at MMIO 0x0 (irq = 49) is a jsm +[72532.105689] jsm: Port 3 added + +However, at the second error, it cascades until EEH disables the device: + +[72631.229549] Call Trace: +... +[72641.725687] jsm: Port 3 added +[72641.725695] EEH: Detected PCI bus error on device 0003:02:00.0 +[72641.725698] EEH: This PCI device has failed 3 times in the last hour: + +It was caused because the PCI state was not being saved after the first +restore. Therefore, at the second recovery the PCI state would not be +restored. + +Signed-off-by: Lucas Kannebley Tavares +Signed-off-by: Breno Leitao +Acked-by: Thadeu Lima de Souza Cascardo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/serial/jsm/jsm_driver.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/tty/serial/jsm/jsm_driver.c ++++ b/drivers/tty/serial/jsm/jsm_driver.c +@@ -269,6 +269,7 @@ static void jsm_io_resume(struct pci_dev + struct jsm_board *brd = pci_get_drvdata(pdev); + + pci_restore_state(pdev); ++ pci_save_state(pdev); + + jsm_uart_port_init(brd); + } diff --git a/queue-3.0/serial-amba-pl011-lock-console-writes-against-interrupts.patch b/queue-3.0/serial-amba-pl011-lock-console-writes-against-interrupts.patch new file mode 100644 index 00000000000..5f156a05b3a --- /dev/null +++ b/queue-3.0/serial-amba-pl011-lock-console-writes-against-interrupts.patch @@ -0,0 +1,64 @@ +From ef605fdb33883d687cff5ba75095a91b313b4966 Mon Sep 17 00:00:00 2001 +From: Rabin Vincent +Date: Tue, 17 Jan 2012 11:52:28 +0100 +Subject: serial: amba-pl011: lock console writes against interrupts + +From: Rabin Vincent + +commit ef605fdb33883d687cff5ba75095a91b313b4966 upstream. + +Protect against pl011_console_write() and the interrupt for +the console UART running concurrently on different CPUs. + +Otherwise the console_write could spin for a long time +waiting for the UART to become not busy, while the other +CPU continuously services UART interrupts and keeps the +UART busy. + +The checks for sysrq and oops_in_progress are taken +from 8250.c. + +Signed-off-by: Rabin Vincent +Reviewed-by: Srinidhi Kasagar +Reviewed-by: Bibek Basu +Reviewed-by: Shreshtha Kumar Sahu +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/serial/amba-pl011.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/drivers/tty/serial/amba-pl011.c ++++ b/drivers/tty/serial/amba-pl011.c +@@ -1733,9 +1733,19 @@ pl011_console_write(struct console *co, + { + struct uart_amba_port *uap = amba_ports[co->index]; + unsigned int status, old_cr, new_cr; ++ unsigned long flags; ++ int locked = 1; + + clk_enable(uap->clk); + ++ local_irq_save(flags); ++ if (uap->port.sysrq) ++ locked = 0; ++ else if (oops_in_progress) ++ locked = spin_trylock(&uap->port.lock); ++ else ++ spin_lock(&uap->port.lock); ++ + /* + * First save the CR then disable the interrupts + */ +@@ -1755,6 +1765,10 @@ pl011_console_write(struct console *co, + } while (status & UART01x_FR_BUSY); + writew(old_cr, uap->port.membase + UART011_CR); + ++ if (locked) ++ spin_unlock(&uap->port.lock); ++ local_irq_restore(flags); ++ + clk_disable(uap->clk); + } + diff --git a/queue-3.0/series b/queue-3.0/series index 2815267d227..e36c878272c 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -32,3 +32,11 @@ usb-cdc-wdm-updating-desc-length-must-be-protected-by-spin_lock.patch usb-cdc-wdm-use-two-mutexes-to-allow-simultaneous-read-and-write.patch qcaux-add-more-pantech-uml190-and-uml290-ports.patch usb-io_ti-make-edge_remove_sysfs_attrs-the-port_remove-method.patch +tty-fix-uv-serial-console-regression.patch +serial-amba-pl011-lock-console-writes-against-interrupts.patch +jsm-fixed-eeh-recovery-error.patch +vmwgfx-fix-assignment-in-vmw_framebuffer_create_handle.patch +usb-usbsevseg-fix-max-length.patch +drivers-usb-host-ehci-fsl.c-add-missing-iounmap.patch +xhci-fix-usb-3.0-device-restart-on-resume.patch +xhci-cleanup-isoc-transfer-ring-when-td-length-mismatch-found.patch diff --git a/queue-3.0/tty-fix-uv-serial-console-regression.patch b/queue-3.0/tty-fix-uv-serial-console-regression.patch new file mode 100644 index 00000000000..da485c5add8 --- /dev/null +++ b/queue-3.0/tty-fix-uv-serial-console-regression.patch @@ -0,0 +1,70 @@ +From 0eee50af5b13e00b3fb7a5fe8480419a71b8235d Mon Sep 17 00:00:00 2001 +From: Jiri Slaby +Date: Thu, 12 Jan 2012 22:55:15 +0100 +Subject: TTY: fix UV serial console regression + +From: Jiri Slaby + +commit 0eee50af5b13e00b3fb7a5fe8480419a71b8235d upstream. + +Commit 74c2107759d (serial: Use block_til_ready helper) and its fixup +3f582b8c110 (serial: fix termios settings in open) introduced a +regression on UV systems. The serial eventually freezes while being +used. It's completely unpredictable and sometimes needs a heap of +traffic to happen first. + +To reproduce this, yast installation was used as it turned out to be +pretty reliable in reproducing. Especially during installation process +where one doesn't have an SSH daemon running. And no monitor as the HW +is completely headless. So this was fun to find. Given the machine +doesn't boot on vanilla before 2.6.36 final. (And the commits above +are older.) + +Unless there is some bad race in the code, the hardware seems to be +pretty broken. Otherwise pure MSR read should not cause such a bug, +or? + +So to prevent the bug, revert to the old behavior. I.e. read modem +status only if we really have to -- for non-CLOCAL set serials. +Non-CLOCAL works on this hardware OK, I tried. See? I don't. + +And document that shit. + +Signed-off-by: Jiri Slaby +References: https://lkml.org/lkml/2011/12/6/573 +References: https://bugzilla.novell.com/show_bug.cgi?id=718518 +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/tty_port.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +--- a/drivers/tty/tty_port.c ++++ b/drivers/tty/tty_port.c +@@ -227,7 +227,6 @@ int tty_port_block_til_ready(struct tty_ + int do_clocal = 0, retval; + unsigned long flags; + DEFINE_WAIT(wait); +- int cd; + + /* block if port is in the process of being closed */ + if (tty_hung_up_p(filp) || port->flags & ASYNC_CLOSING) { +@@ -284,11 +283,14 @@ int tty_port_block_til_ready(struct tty_ + retval = -ERESTARTSYS; + break; + } +- /* Probe the carrier. For devices with no carrier detect this +- will always return true */ +- cd = tty_port_carrier_raised(port); ++ /* ++ * Probe the carrier. For devices with no carrier detect ++ * tty_port_carrier_raised will always return true. ++ * Never ask drivers if CLOCAL is set, this causes troubles ++ * on some hardware. ++ */ + if (!(port->flags & ASYNC_CLOSING) && +- (do_clocal || cd)) ++ (do_clocal || tty_port_carrier_raised(port))) + break; + if (signal_pending(current)) { + retval = -ERESTARTSYS; diff --git a/queue-3.0/usb-usbsevseg-fix-max-length.patch b/queue-3.0/usb-usbsevseg-fix-max-length.patch new file mode 100644 index 00000000000..e0789afc6ee --- /dev/null +++ b/queue-3.0/usb-usbsevseg-fix-max-length.patch @@ -0,0 +1,32 @@ +From 1097ccebe630170080c41df0edcf88e0626e9c75 Mon Sep 17 00:00:00 2001 +From: Harrison Metzger +Date: Sun, 15 Jan 2012 08:43:24 -0600 +Subject: USB: usbsevseg: fix max length + +From: Harrison Metzger + +commit 1097ccebe630170080c41df0edcf88e0626e9c75 upstream. + +This changes the max length for the usb seven segment delcom device to 8 +from 6. Delcom has both 6 and 8 variants and having 8 works fine with +devices which are only 6. + +Signed-off-by: Harrison Metzger +Signed-off-by: Stuart Pook +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/misc/usbsevseg.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/misc/usbsevseg.c ++++ b/drivers/usb/misc/usbsevseg.c +@@ -24,7 +24,7 @@ + + #define VENDOR_ID 0x0fc5 + #define PRODUCT_ID 0x1227 +-#define MAXLEN 6 ++#define MAXLEN 8 + + /* table of devices that work with this driver */ + static const struct usb_device_id id_table[] = { diff --git a/queue-3.0/vmwgfx-fix-assignment-in-vmw_framebuffer_create_handle.patch b/queue-3.0/vmwgfx-fix-assignment-in-vmw_framebuffer_create_handle.patch new file mode 100644 index 00000000000..8bd7637a132 --- /dev/null +++ b/queue-3.0/vmwgfx-fix-assignment-in-vmw_framebuffer_create_handle.patch @@ -0,0 +1,31 @@ +From bf9c05d5b6d19b3e4c9fe21047694e94f48db89b Mon Sep 17 00:00:00 2001 +From: Ryan Mallon +Date: Sat, 28 Jan 2012 08:51:40 +1100 +Subject: vmwgfx: Fix assignment in vmw_framebuffer_create_handle + +From: Ryan Mallon + +commit bf9c05d5b6d19b3e4c9fe21047694e94f48db89b upstream. + +The assignment of handle in vmw_framebuffer_create_handle doesn't actually do anything useful and is incorrectly assigning an integer value to a pointer argument. It appears that this is a typo and should be dereferencing handle rather than assigning to it directly. This fixes a bug where an undefined handle value is potentially returned to user-space. + +Signed-off-by: Ryan Mallon +Reviewed-by: Jakob Bornecrantz +Signed-off-by: Dave Airlie +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c ++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +@@ -313,7 +313,7 @@ int vmw_framebuffer_create_handle(struct + unsigned int *handle) + { + if (handle) +- handle = 0; ++ *handle = 0; + + return 0; + } diff --git a/queue-3.0/xhci-cleanup-isoc-transfer-ring-when-td-length-mismatch-found.patch b/queue-3.0/xhci-cleanup-isoc-transfer-ring-when-td-length-mismatch-found.patch new file mode 100644 index 00000000000..92702122a2b --- /dev/null +++ b/queue-3.0/xhci-cleanup-isoc-transfer-ring-when-td-length-mismatch-found.patch @@ -0,0 +1,37 @@ +From cf840551a884360841bd3d3ce1ad0868ff0b759a Mon Sep 17 00:00:00 2001 +From: Andiry Xu +Date: Wed, 18 Jan 2012 17:47:12 +0800 +Subject: xHCI: Cleanup isoc transfer ring when TD length mismatch found + +From: Andiry Xu + +commit cf840551a884360841bd3d3ce1ad0868ff0b759a upstream. + +When a TD length mismatch is found during isoc TRB enqueue, it directly +returns -EINVAL. However, isoc transfer is partially enqueued at this time, +and the ring should be cleared. + +This should be backported to kernels as old as 2.6.36, which contain the +commit 522989a27c7badb608155b1f1dea3487ed431f74 "xhci: Fix failed +enqueue in the middle of isoch TD." + +Signed-off-by: Andiry Xu +Signed-off-by: Sarah Sharp +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/xhci-ring.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/usb/host/xhci-ring.c ++++ b/drivers/usb/host/xhci-ring.c +@@ -3382,7 +3382,8 @@ static int xhci_queue_isoc_tx(struct xhc + /* Check TD length */ + if (running_total != td_len) { + xhci_err(xhci, "ISOC TD length unmatch\n"); +- return -EINVAL; ++ ret = -EINVAL; ++ goto cleanup; + } + } + diff --git a/queue-3.0/xhci-fix-usb-3.0-device-restart-on-resume.patch b/queue-3.0/xhci-fix-usb-3.0-device-restart-on-resume.patch new file mode 100644 index 00000000000..aa0c8a31bb6 --- /dev/null +++ b/queue-3.0/xhci-fix-usb-3.0-device-restart-on-resume.patch @@ -0,0 +1,49 @@ +From d0cd5d482b8a6dc92c6c69a5387baf72ea84f23a Mon Sep 17 00:00:00 2001 +From: Sarah Sharp +Date: Mon, 14 Nov 2011 17:51:39 -0800 +Subject: xhci: Fix USB 3.0 device restart on resume. + +From: Sarah Sharp + +commit d0cd5d482b8a6dc92c6c69a5387baf72ea84f23a upstream. + +The xHCI hub port code gets passed a zero-based port number by the USB +core. It then adds one to in order to find a device slot by port number +and device speed by calling xhci_find_slot_id_by_port. That function +clearly states it requires a one-based port number. The xHCI port +status change event handler was using a zero-based port number that it +got from find_faked_portnum_from_hw_portnum, not a one-based port +number. This lead to the doorbells never being rung for a device after +a resume, or worse, a different device with the same speed having its +doorbell rung (which could lead to bad power management in the xHCI host +controller). + +This patch should be backported to kernels as old as 2.6.39. + +Signed-off-by: Sarah Sharp +Acked-by: Andiry Xu +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/xhci-ring.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/usb/host/xhci-ring.c ++++ b/drivers/usb/host/xhci-ring.c +@@ -1218,6 +1218,7 @@ static void handle_vendor_event(struct x + * + * Returns a zero-based port number, which is suitable for indexing into each of + * the split roothubs' port arrays and bus state arrays. ++ * Add one to it in order to call xhci_find_slot_id_by_port. + */ + static unsigned int find_faked_portnum_from_hw_portnum(struct usb_hcd *hcd, + struct xhci_hcd *xhci, u32 port_id) +@@ -1340,7 +1341,7 @@ static void handle_port_status(struct xh + temp |= PORT_LINK_STROBE | XDEV_U0; + xhci_writel(xhci, temp, port_array[faked_port_index]); + slot_id = xhci_find_slot_id_by_port(hcd, xhci, +- faked_port_index); ++ faked_port_index + 1); + if (!slot_id) { + xhci_dbg(xhci, "slot_id is zero\n"); + goto cleanup; -- 2.47.3