From: Greg Kroah-Hartman Date: Mon, 19 Jan 2015 13:41:01 +0000 (+0800) Subject: 3.18-stable patches X-Git-Tag: v3.10.66~51 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4ce55e8a949f73acb4f38075155b7fabf1789f2c;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches added patches: xhci-add-broken-streams-quirk-for-fresco-logic-fl1000g-xhci-controllers.patch xhci-check-if-slot-is-already-in-default-state-before-moving-it-there.patch --- diff --git a/queue-3.18/series b/queue-3.18/series index 959b6fa5761..44f16491582 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -52,3 +52,5 @@ arc-move-peripherals-to-match-model-to-fpga.patch cxl-change-contexts_lock-to-a-mutex-to-fix-sleep-while-atomic-bug.patch cxl-add-timeout-to-process-element-commands.patch cxl-unmap-mmio-regions-when-detaching-a-context.patch +xhci-check-if-slot-is-already-in-default-state-before-moving-it-there.patch +xhci-add-broken-streams-quirk-for-fresco-logic-fl1000g-xhci-controllers.patch diff --git a/queue-3.18/xhci-add-broken-streams-quirk-for-fresco-logic-fl1000g-xhci-controllers.patch b/queue-3.18/xhci-add-broken-streams-quirk-for-fresco-logic-fl1000g-xhci-controllers.patch new file mode 100644 index 00000000000..bc4a4d0d987 --- /dev/null +++ b/queue-3.18/xhci-add-broken-streams-quirk-for-fresco-logic-fl1000g-xhci-controllers.patch @@ -0,0 +1,44 @@ +From 7f5c4d631aed243ca89c6673427954210b1628ec Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 5 Dec 2014 11:11:28 +0100 +Subject: xhci: Add broken-streams quirk for Fresco Logic FL1000G xhci controllers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Hans de Goede + +commit 7f5c4d631aed243ca89c6673427954210b1628ec upstream. + +Streams do not work reliabe on Fresco Logic FL1000G xhci controllers, +trying to use them results in errors like this: + +21:37:33 kernel: xhci_hcd 0000:04:00.0: ERROR Transfer event for disabled endpoint or incorrect stream ring +21:37:33 kernel: xhci_hcd 0000:04:00.0: @00000000368b3570 9067b000 00000000 05000000 01078001 +21:37:33 kernel: xhci_hcd 0000:04:00.0: ERROR Transfer event for disabled endpoint or incorrect stream ring +21:37:33 kernel: xhci_hcd 0000:04:00.0: @00000000368b3580 9067b400 00000000 05000000 01038001 + +As always I've ordered a pci-e addon card with a Fresco Logic controller for +myself to see if I can come up with a better fix then the big hammer, in +the mean time this will make uas devices work again (in usb-storage mode) +for FL1000G users. + +Reported-by: Marcin Zajączkowski +Signed-off-by: Hans de Goede +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/xhci-pci.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/host/xhci-pci.c ++++ b/drivers/usb/host/xhci-pci.c +@@ -82,6 +82,8 @@ static void xhci_pci_quirks(struct devic + "must be suspended extra slowly", + pdev->revision); + } ++ if (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK) ++ xhci->quirks |= XHCI_BROKEN_STREAMS; + /* Fresco Logic confirms: all revisions of this chip do not + * support MSI, even though some of them claim to in their PCI + * capabilities. diff --git a/queue-3.18/xhci-check-if-slot-is-already-in-default-state-before-moving-it-there.patch b/queue-3.18/xhci-check-if-slot-is-already-in-default-state-before-moving-it-there.patch new file mode 100644 index 00000000000..0305687b96d --- /dev/null +++ b/queue-3.18/xhci-check-if-slot-is-already-in-default-state-before-moving-it-there.patch @@ -0,0 +1,56 @@ +From f161ead70fa6a62e432dff6e9dab8e3cfbeabea6 Mon Sep 17 00:00:00 2001 +From: Mathias Nyman +Date: Fri, 9 Jan 2015 17:18:28 +0200 +Subject: xhci: Check if slot is already in default state before moving it there + +From: Mathias Nyman + +commit f161ead70fa6a62e432dff6e9dab8e3cfbeabea6 upstream. + +Solves xhci error cases with debug messages: +xhci_hcd 0000:00:14.0: Setup ERROR: setup context command for slot 1. +usb 1-6: hub failed to enable device, error -22 + +xhci will give a context state error if we try to set a slot in default +state to the same default state with a special address device command. + +Turns out this happends in several cases: +- retry reading the device rescriptor in hub_port_init() +- usb_reset_device() is called for a slot in default state +- in resume path, usb_port_resume() calls hub_port_init() + +The default state is usually reached from most states with a reset device +command without any context state errors, but using the address device +command with BSA bit set (block set address) only works from the enabled +state and will otherwise cause context error. + +solve this by checking if we are already in the default state before issuing +a address device BSA=1 command. + +Fixes: 48fc7dbd52c0 ("usb: xhci: change enumeration scheme to 'new scheme'") +Signed-off-by: Mathias Nyman +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/xhci.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- a/drivers/usb/host/xhci.c ++++ b/drivers/usb/host/xhci.c +@@ -3803,6 +3803,15 @@ static int xhci_setup_device(struct usb_ + return -EINVAL; + } + ++ if (setup == SETUP_CONTEXT_ONLY) { ++ slot_ctx = xhci_get_slot_ctx(xhci, virt_dev->out_ctx); ++ if (GET_SLOT_STATE(le32_to_cpu(slot_ctx->dev_state)) == ++ SLOT_STATE_DEFAULT) { ++ xhci_dbg(xhci, "Slot already in default state\n"); ++ return 0; ++ } ++ } ++ + command = xhci_alloc_command(xhci, false, false, GFP_KERNEL); + if (!command) + return -ENOMEM;