From: Greg Kroah-Hartman Date: Mon, 1 Apr 2019 12:03:47 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v3.18.138~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3c7c91a4d4bbe5d2d496fa801adc1b50b1242e57;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: revert-usb-core-only-clean-up-what-we-allocated.patch xhci-fix-port-resume-done-detection-for-ss-ports-with-lpm-enabled.patch --- diff --git a/queue-4.4/revert-usb-core-only-clean-up-what-we-allocated.patch b/queue-4.4/revert-usb-core-only-clean-up-what-we-allocated.patch new file mode 100644 index 00000000000..f1e68468f9d --- /dev/null +++ b/queue-4.4/revert-usb-core-only-clean-up-what-we-allocated.patch @@ -0,0 +1,50 @@ +From cf4df407e0d7cde60a45369c2a3414d18e2d4fdd Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman +Date: Wed, 13 Dec 2017 11:59:39 +0100 +Subject: Revert "USB: core: only clean up what we allocated" + +From: Greg Kroah-Hartman + +commit cf4df407e0d7cde60a45369c2a3414d18e2d4fdd upstream. + +This reverts commit 32fd87b3bbf5f7a045546401dfe2894dbbf4d8c3. + +Alan wrote a better fix for this... + +Cc: Andrey Konovalov +Cc: stable +Cc: Nathan Chancellor +Cc: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/core/config.c | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +--- a/drivers/usb/core/config.c ++++ b/drivers/usb/core/config.c +@@ -734,21 +734,18 @@ void usb_destroy_configuration(struct us + return; + + if (dev->rawdescriptors) { +- for (i = 0; i < dev->descriptor.bNumConfigurations && +- i < USB_MAXCONFIG; i++) ++ for (i = 0; i < dev->descriptor.bNumConfigurations; i++) + kfree(dev->rawdescriptors[i]); + + kfree(dev->rawdescriptors); + dev->rawdescriptors = NULL; + } + +- for (c = 0; c < dev->descriptor.bNumConfigurations && +- c < USB_MAXCONFIG; c++) { ++ for (c = 0; c < dev->descriptor.bNumConfigurations; c++) { + struct usb_host_config *cf = &dev->config[c]; + + kfree(cf->string); +- for (i = 0; i < cf->desc.bNumInterfaces && +- i < USB_MAXINTERFACES; i++) { ++ for (i = 0; i < cf->desc.bNumInterfaces; i++) { + if (cf->intf_cache[i]) + kref_put(&cf->intf_cache[i]->ref, + usb_release_interface_cache); diff --git a/queue-4.4/series b/queue-4.4/series index bab470b46fe..83b467a49c4 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -124,3 +124,5 @@ gpio-adnp-fix-testing-wrong-value-in-adnp_gpio_direction_input.patch perf-intel-pt-fix-tsc-slip.patch x86-smp-enforce-config_hotplug_cpu-when-smp-y.patch kvm-reject-device-ioctls-from-processes-other-than-the-vm-s-creator.patch +xhci-fix-port-resume-done-detection-for-ss-ports-with-lpm-enabled.patch +revert-usb-core-only-clean-up-what-we-allocated.patch diff --git a/queue-4.4/xhci-fix-port-resume-done-detection-for-ss-ports-with-lpm-enabled.patch b/queue-4.4/xhci-fix-port-resume-done-detection-for-ss-ports-with-lpm-enabled.patch new file mode 100644 index 00000000000..6dce63b3641 --- /dev/null +++ b/queue-4.4/xhci-fix-port-resume-done-detection-for-ss-ports-with-lpm-enabled.patch @@ -0,0 +1,58 @@ +From 6cbcf596934c8e16d6288c7cc62dfb7ad8eadf15 Mon Sep 17 00:00:00 2001 +From: Mathias Nyman +Date: Fri, 22 Mar 2019 17:50:15 +0200 +Subject: xhci: Fix port resume done detection for SS ports with LPM enabled + +From: Mathias Nyman + +commit 6cbcf596934c8e16d6288c7cc62dfb7ad8eadf15 upstream. + +A suspended SS port in U3 link state will go to U0 when resumed, but +can almost immediately after that enter U1 or U2 link power save +states before host controller driver reads the port status. + +Host controller driver only checks for U0 state, and might miss +the finished resume, leaving flags unclear and skip notifying usb +code of the wake. + +Add U1 and U2 to the possible link states when checking for finished +port resume. + +Cc: stable +Signed-off-by: Mathias Nyman +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/xhci-ring.c | 9 ++++++--- + drivers/usb/host/xhci.h | 1 + + 2 files changed, 7 insertions(+), 3 deletions(-) + +--- a/drivers/usb/host/xhci-ring.c ++++ b/drivers/usb/host/xhci-ring.c +@@ -1642,10 +1642,13 @@ static void handle_port_status(struct xh + } + } + +- if ((temp & PORT_PLC) && (temp & PORT_PLS_MASK) == XDEV_U0 && +- DEV_SUPERSPEED_ANY(temp)) { ++ if ((temp & PORT_PLC) && ++ DEV_SUPERSPEED_ANY(temp) && ++ ((temp & PORT_PLS_MASK) == XDEV_U0 || ++ (temp & PORT_PLS_MASK) == XDEV_U1 || ++ (temp & PORT_PLS_MASK) == XDEV_U2)) { + xhci_dbg(xhci, "resume SS port %d finished\n", port_id); +- /* We've just brought the device into U0 through either the ++ /* We've just brought the device into U0/1/2 through either the + * Resume state after a device remote wakeup, or through the + * U3Exit state after a host-initiated resume. If it's a device + * initiated remote wake, don't pass up the link state change, +--- a/drivers/usb/host/xhci.h ++++ b/drivers/usb/host/xhci.h +@@ -309,6 +309,7 @@ struct xhci_op_regs { + */ + #define PORT_PLS_MASK (0xf << 5) + #define XDEV_U0 (0x0 << 5) ++#define XDEV_U1 (0x1 << 5) + #define XDEV_U2 (0x2 << 5) + #define XDEV_U3 (0x3 << 5) + #define XDEV_INACTIVE (0x6 << 5)