From: Greg Kroah-Hartman Date: Sat, 30 Mar 2019 20:35:29 +0000 (+0100) Subject: 4.14-stable patches X-Git-Tag: v3.18.138~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b4c97e0fdd2c11ce54bdbf595d03d40811587b77;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: usb-cdc-acm-fix-race-during-wakeup-blocking-tx-traffic.patch usb-host-xhci-rcar-add-xhci_trust_tx_length-quirk.patch xhci-fix-port-resume-done-detection-for-ss-ports-with-lpm-enabled.patch --- diff --git a/queue-4.14/series b/queue-4.14/series index 7dd9fba6bfe..ebf5dc24928 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -94,3 +94,6 @@ phy-sun4i-usb-support-set_mode-to-usb_host-for-non-otg-phys.patch usb-mtu3-fix-extcon-dependency.patch usb-gadget-f_hid-fix-deadlock-in-f_hidg_write.patch usb-common-consider-only-available-nodes-for-dr_mode.patch +usb-host-xhci-rcar-add-xhci_trust_tx_length-quirk.patch +xhci-fix-port-resume-done-detection-for-ss-ports-with-lpm-enabled.patch +usb-cdc-acm-fix-race-during-wakeup-blocking-tx-traffic.patch diff --git a/queue-4.14/usb-cdc-acm-fix-race-during-wakeup-blocking-tx-traffic.patch b/queue-4.14/usb-cdc-acm-fix-race-during-wakeup-blocking-tx-traffic.patch new file mode 100644 index 00000000000..cee3a87aff5 --- /dev/null +++ b/queue-4.14/usb-cdc-acm-fix-race-during-wakeup-blocking-tx-traffic.patch @@ -0,0 +1,46 @@ +From 93e1c8a638308980309e009cc40b5a57ef87caf1 Mon Sep 17 00:00:00 2001 +From: Romain Izard +Date: Fri, 22 Mar 2019 16:53:02 +0100 +Subject: usb: cdc-acm: fix race during wakeup blocking TX traffic + +From: Romain Izard + +commit 93e1c8a638308980309e009cc40b5a57ef87caf1 upstream. + +When the kernel is compiled with preemption enabled, the URB completion +handler can run in parallel with the work responsible for waking up the +tty layer. If the URB handler sets the EVENT_TTY_WAKEUP bit during the +call to tty_port_tty_wakeup() to signal that there is room for additional +input, it will be cleared at the end of this call. As a result, TX traffic +on the upper layer will be blocked. + +This can be seen with a kernel configured with CONFIG_PREEMPT, and a fast +modem connected with PPP running over a USB CDC-ACM port. + +Use test_and_clear_bit() instead, which ensures that each wakeup requested +by the URB completion code will trigger a call to tty_port_tty_wakeup(). + +Fixes: 1aba579f3cf5 cdc-acm: handle read pipe errors +Signed-off-by: Romain Izard +Cc: stable +Acked-by: Oliver Neukum +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/class/cdc-acm.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +--- a/drivers/usb/class/cdc-acm.c ++++ b/drivers/usb/class/cdc-acm.c +@@ -570,10 +570,8 @@ static void acm_softint(struct work_stru + clear_bit(EVENT_RX_STALL, &acm->flags); + } + +- if (test_bit(EVENT_TTY_WAKEUP, &acm->flags)) { ++ if (test_and_clear_bit(EVENT_TTY_WAKEUP, &acm->flags)) + tty_port_tty_wakeup(&acm->port); +- clear_bit(EVENT_TTY_WAKEUP, &acm->flags); +- } + } + + /* diff --git a/queue-4.14/usb-host-xhci-rcar-add-xhci_trust_tx_length-quirk.patch b/queue-4.14/usb-host-xhci-rcar-add-xhci_trust_tx_length-quirk.patch new file mode 100644 index 00000000000..bca5c930968 --- /dev/null +++ b/queue-4.14/usb-host-xhci-rcar-add-xhci_trust_tx_length-quirk.patch @@ -0,0 +1,38 @@ +From 40fc165304f0faaae78b761f8ee30b5d216b1850 Mon Sep 17 00:00:00 2001 +From: Yasushi Asano +Date: Mon, 18 Feb 2019 11:26:34 +0100 +Subject: usb: host: xhci-rcar: Add XHCI_TRUST_TX_LENGTH quirk + +From: Yasushi Asano + +commit 40fc165304f0faaae78b761f8ee30b5d216b1850 upstream. + +When plugging BUFFALO LUA4-U3-AGT USB3.0 to Gigabit Ethernet LAN +Adapter, warning messages filled up dmesg. + +[ 101.098287] xhci-hcd ee000000.usb: WARN Successful completion on short TX for slot 1 ep 4: needs XHCI_TRUST_TX_LENGTH quirk? +[ 101.117463] xhci-hcd ee000000.usb: WARN Successful completion on short TX for slot 1 ep 4: needs XHCI_TRUST_TX_LENGTH quirk? +[ 101.136513] xhci-hcd ee000000.usb: WARN Successful completion on short TX for slot 1 ep 4: needs XHCI_TRUST_TX_LENGTH quirk? + +Adding the XHCI_TRUST_TX_LENGTH quirk resolves the issue. + +Signed-off-by: Yasushi Asano +Signed-off-by: Spyridon Papageorgiou +Acked-by: Yoshihiro Shimoda +Cc: stable +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/host/xhci-rcar.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/host/xhci-rcar.c ++++ b/drivers/usb/host/xhci-rcar.c +@@ -236,6 +236,7 @@ int xhci_rcar_init_quirk(struct usb_hcd + xhci_rcar_is_gen3(hcd->self.controller)) + xhci->quirks |= XHCI_NO_64BIT_SUPPORT; + ++ xhci->quirks |= XHCI_TRUST_TX_LENGTH; + return xhci_rcar_download_firmware(hcd); + } + diff --git a/queue-4.14/xhci-fix-port-resume-done-detection-for-ss-ports-with-lpm-enabled.patch b/queue-4.14/xhci-fix-port-resume-done-detection-for-ss-ports-with-lpm-enabled.patch new file mode 100644 index 00000000000..10665092e49 --- /dev/null +++ b/queue-4.14/xhci-fix-port-resume-done-detection-for-ss-ports-with-lpm-enabled.patch @@ -0,0 +1,47 @@ +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 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +--- a/drivers/usb/host/xhci-ring.c ++++ b/drivers/usb/host/xhci-ring.c +@@ -1715,10 +1715,13 @@ static void handle_port_status(struct xh + } + } + +- if ((portsc & PORT_PLC) && (portsc & PORT_PLS_MASK) == XDEV_U0 && +- DEV_SUPERSPEED_ANY(portsc)) { ++ if ((portsc & PORT_PLC) && ++ DEV_SUPERSPEED_ANY(portsc) && ++ ((portsc & PORT_PLS_MASK) == XDEV_U0 || ++ (portsc & PORT_PLS_MASK) == XDEV_U1 || ++ (portsc & 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,