From: Greg Kroah-Hartman Date: Wed, 26 Sep 2012 22:38:00 +0000 (-0700) Subject: 3.5-stable patches X-Git-Tag: v3.0.44~63 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e72191bea641c69487bb7394d2269525bb83d638;p=thirdparty%2Fkernel%2Fstable-queue.git 3.5-stable patches added patches: usb-host-xhci-fix-compilation-error-for-non-pci-based-stacks.patch usb-host-xhci-plat-use-ioremap_nocache.patch xhci-fix-a-logical-vs-bitwise-and-bug.patch xhci-make-handover-code-more-robust.patch xhci-recognize-usb-3.0-devices-as-superspeed-at-powerup.patch --- diff --git a/queue-3.5/series b/queue-3.5/series index 60171138559..12798c4baee 100644 --- a/queue-3.5/series +++ b/queue-3.5/series @@ -163,3 +163,8 @@ usb-add-device-quirk-for-joss-optical-touchboard.patch rt2800usb-added-rx-packet-length-validity-check.patch usb-host-xhci-fix-compliance-mode-on-sn65lvpe502cp-hardware.patch intel-xhci-only-switch-the-switchable-ports.patch +usb-host-xhci-plat-use-ioremap_nocache.patch +xhci-fix-a-logical-vs-bitwise-and-bug.patch +xhci-make-handover-code-more-robust.patch +xhci-recognize-usb-3.0-devices-as-superspeed-at-powerup.patch +usb-host-xhci-fix-compilation-error-for-non-pci-based-stacks.patch diff --git a/queue-3.5/usb-host-xhci-fix-compilation-error-for-non-pci-based-stacks.patch b/queue-3.5/usb-host-xhci-fix-compilation-error-for-non-pci-based-stacks.patch new file mode 100644 index 00000000000..523a34b38d7 --- /dev/null +++ b/queue-3.5/usb-host-xhci-fix-compilation-error-for-non-pci-based-stacks.patch @@ -0,0 +1,44 @@ +From 296365781903226a3fb8758901eaeec09d2798e4 Mon Sep 17 00:00:00 2001 +From: Moiz Sonasath +Date: Wed, 5 Sep 2012 08:34:26 +0300 +Subject: usb: host: xhci: fix compilation error for non-PCI based stacks + +From: Moiz Sonasath + +commit 296365781903226a3fb8758901eaeec09d2798e4 upstream. + +For non PCI-based stacks, this function call +usb_disable_xhci_ports(to_pci_dev(hcd->self.controller)); +made from xhci_shutdown is not applicable. + +Ideally, we wouldn't have any PCI-specific code on +a generic driver such as the xHCI stack, but it looks +like we should just stub usb_disable_xhci_ports() out +for non-PCI devices. + +[ balbi@ti.com: slight improvement to commit log ] + +This patch should be backported to kernels as old as 3.0, since the +commit it fixes (e95829f474f0db3a4d940cae1423783edd966027 "xhci: Switch +PPT ports to EHCI on shutdown.") was marked for stable. + +Signed-off-by: Moiz Sonasath +Signed-off-by: Ruchika Kharwar +Signed-off-by: Felipe Balbi +Signed-off-by: Sarah Sharp +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/pci-quirks.h | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/host/pci-quirks.h ++++ b/drivers/usb/host/pci-quirks.h +@@ -15,6 +15,7 @@ void usb_disable_xhci_ports(struct pci_d + static inline void usb_amd_quirk_pll_disable(void) {} + static inline void usb_amd_quirk_pll_enable(void) {} + static inline void usb_amd_dev_put(void) {} ++static inline void usb_disable_xhci_ports(struct pci_dev *xhci_pdev) {} + #endif /* CONFIG_PCI */ + + #endif /* __LINUX_USB_PCI_QUIRKS_H */ diff --git a/queue-3.5/usb-host-xhci-plat-use-ioremap_nocache.patch b/queue-3.5/usb-host-xhci-plat-use-ioremap_nocache.patch new file mode 100644 index 00000000000..ecb4ac0b8b7 --- /dev/null +++ b/queue-3.5/usb-host-xhci-plat-use-ioremap_nocache.patch @@ -0,0 +1,36 @@ +From 319acdfc064169023cd9ada5085b434fbcdacec2 Mon Sep 17 00:00:00 2001 +From: Ruchika Kharwar +Date: Fri, 10 Aug 2012 09:58:30 +0300 +Subject: usb: host: xhci-plat: use ioremap_nocache + +From: Ruchika Kharwar + +commit 319acdfc064169023cd9ada5085b434fbcdacec2 upstream. + +Use the ioremap_nocache variant of the ioremap API in +order to make sure our memory will be marked uncachable. + +This patch should be backported to kernels as old as 3.4, that contain +the commit 3429e91a661e1f383aecc86c6bbcf65afb15c892 "usb: host: xhci: +add platform driver support". + +Signed-off-by: Ruchika Kharwar +Signed-off-by: Felipe Balbi +Signed-off-by: Sarah Sharp +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/xhci-plat.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/host/xhci-plat.c ++++ b/drivers/usb/host/xhci-plat.c +@@ -118,7 +118,7 @@ static int xhci_plat_probe(struct platfo + goto put_hcd; + } + +- hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); ++ hcd->regs = ioremap_nocache(hcd->rsrc_start, hcd->rsrc_len); + if (!hcd->regs) { + dev_dbg(&pdev->dev, "error mapping memory\n"); + ret = -EFAULT; diff --git a/queue-3.5/xhci-fix-a-logical-vs-bitwise-and-bug.patch b/queue-3.5/xhci-fix-a-logical-vs-bitwise-and-bug.patch new file mode 100644 index 00000000000..88f06c0d6a5 --- /dev/null +++ b/queue-3.5/xhci-fix-a-logical-vs-bitwise-and-bug.patch @@ -0,0 +1,34 @@ +From 052c7f9ffb0e95843e75448d02664459253f9ff8 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Mon, 13 Aug 2012 19:57:03 +0300 +Subject: xhci: Fix a logical vs bitwise AND bug + +From: Dan Carpenter + +commit 052c7f9ffb0e95843e75448d02664459253f9ff8 upstream. + +The intent was to test whether the flag was set. + +This patch should be backported to stable kernels as old as 3.0, since +it fixes a bug in commit e95829f474f0db3a4d940cae1423783edd966027 "xhci: +Switch PPT ports to EHCI on shutdown.", which was marked for stable. + +Signed-off-by: Dan Carpenter +Signed-off-by: Sarah Sharp +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/xhci.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/host/xhci.c ++++ b/drivers/usb/host/xhci.c +@@ -760,7 +760,7 @@ void xhci_shutdown(struct usb_hcd *hcd) + { + struct xhci_hcd *xhci = hcd_to_xhci(hcd); + +- if (xhci->quirks && XHCI_SPURIOUS_REBOOT) ++ if (xhci->quirks & XHCI_SPURIOUS_REBOOT) + usb_disable_xhci_ports(to_pci_dev(hcd->self.controller)); + + spin_lock_irq(&xhci->lock); diff --git a/queue-3.5/xhci-make-handover-code-more-robust.patch b/queue-3.5/xhci-make-handover-code-more-robust.patch new file mode 100644 index 00000000000..520c9922b5b --- /dev/null +++ b/queue-3.5/xhci-make-handover-code-more-robust.patch @@ -0,0 +1,67 @@ +From e955a1cd086de4d165ae0f4c7be7289d84b63bdc Mon Sep 17 00:00:00 2001 +From: Matthew Garrett +Date: Tue, 14 Aug 2012 16:44:49 -0400 +Subject: xhci: Make handover code more robust + +From: Matthew Garrett + +commit e955a1cd086de4d165ae0f4c7be7289d84b63bdc upstream. + +My test platform (Intel DX79SI) boots reliably under BIOS, but frequently +crashes when booting via UEFI. I finally tracked this down to the xhci +handoff code. It seems that reads from the device occasionally just return +0xff, resulting in xhci_find_next_cap_offset generating a value that's +larger than the resource region. We then oops when attempting to read the +value. Sanity checking that value lets us avoid the crash. + +I've no idea what's causing the underlying problem, and xhci still doesn't +actually *work* even with this, but the machine at least boots which will +probably make further debugging easier. + +This should be backported to kernels as old as 2.6.31, that contain the +commit 66d4eadd8d067269ea8fead1a50fe87c2979a80d "USB: xhci: BIOS handoff +and HW initialization." + +Signed-off-by: Matthew Garrett +Signed-off-by: Sarah Sharp +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/pci-quirks.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +--- a/drivers/usb/host/pci-quirks.c ++++ b/drivers/usb/host/pci-quirks.c +@@ -841,12 +841,12 @@ static void __devinit quirk_usb_handoff_ + void __iomem *op_reg_base; + u32 val; + int timeout; ++ int len = pci_resource_len(pdev, 0); + + if (!mmio_resource_enabled(pdev, 0)) + return; + +- base = ioremap_nocache(pci_resource_start(pdev, 0), +- pci_resource_len(pdev, 0)); ++ base = ioremap_nocache(pci_resource_start(pdev, 0), len); + if (base == NULL) + return; + +@@ -856,9 +856,17 @@ static void __devinit quirk_usb_handoff_ + */ + ext_cap_offset = xhci_find_next_cap_offset(base, XHCI_HCC_PARAMS_OFFSET); + do { ++ if ((ext_cap_offset + sizeof(val)) > len) { ++ /* We're reading garbage from the controller */ ++ dev_warn(&pdev->dev, ++ "xHCI controller failing to respond"); ++ return; ++ } ++ + if (!ext_cap_offset) + /* We've reached the end of the extended capabilities */ + goto hc_init; ++ + val = readl(base + ext_cap_offset); + if (XHCI_EXT_CAPS_ID(val) == XHCI_EXT_CAPS_LEGACY) + break; diff --git a/queue-3.5/xhci-recognize-usb-3.0-devices-as-superspeed-at-powerup.patch b/queue-3.5/xhci-recognize-usb-3.0-devices-as-superspeed-at-powerup.patch new file mode 100644 index 00000000000..63274b7dd0a --- /dev/null +++ b/queue-3.5/xhci-recognize-usb-3.0-devices-as-superspeed-at-powerup.patch @@ -0,0 +1,42 @@ +From 29d214576f936db627ff62afb9ef438eea18bcd2 Mon Sep 17 00:00:00 2001 +From: Manoj Iyer +Date: Wed, 22 Aug 2012 11:53:18 -0500 +Subject: xhci: Recognize USB 3.0 devices as superspeed at powerup + +From: Manoj Iyer + +commit 29d214576f936db627ff62afb9ef438eea18bcd2 upstream. + +On Intel Panther Point chipset USB 3.0 devices show up as +high-speed devices on powerup, but after an s3 cycle they are +correctly recognized as SuperSpeed. At powerup switch the port +to xHCI so that USB 3.0 devices are correctly recognized. + +BugLink: http://bugs.launchpad.net/bugs/1000424 + +This patch should be backported to kernels as old as 3.0, that contain +commit ID 69e848c2090aebba5698a1620604c7dccb448684 "Intel xhci: Support +EHCI/xHCI port switching." + +Signed-off-by: Manoj Iyer +Signed-off-by: Sarah Sharp +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/pci-quirks.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/usb/host/pci-quirks.c ++++ b/drivers/usb/host/pci-quirks.c +@@ -897,9 +897,10 @@ static void __devinit quirk_usb_handoff_ + /* Disable any BIOS SMIs and clear all SMI events*/ + writel(val, base + ext_cap_offset + XHCI_LEGACY_CONTROL_OFFSET); + ++hc_init: + if (usb_is_intel_switchable_xhci(pdev)) + usb_enable_xhci_ports(pdev); +-hc_init: ++ + op_reg_base = base + XHCI_HC_LENGTH(readl(base)); + + /* Wait for the host controller to be ready before writing any