]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Apr 2021 08:05:26 +0000 (10:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Apr 2021 08:05:26 +0000 (10:05 +0200)
added patches:
cdc-acm-fix-break-rx-code-path-adding-necessary-calls.patch
usb-cdc-acm-downgrade-message-to-debug.patch
usb-cdc-acm-fix-use-after-free-after-probe-failure.patch
usb-musb-fix-suspend-with-devices-connected-for-a64.patch
usb-quirks-ignore-remote-wake-up-on-fibocom-l850-gl-lte-modem.patch
usb-xhci-mtk-fix-broken-streams-issue-on-0.96-xhci.patch

queue-4.9/cdc-acm-fix-break-rx-code-path-adding-necessary-calls.patch [new file with mode: 0644]
queue-4.9/series
queue-4.9/usb-cdc-acm-downgrade-message-to-debug.patch [new file with mode: 0644]
queue-4.9/usb-cdc-acm-fix-use-after-free-after-probe-failure.patch [new file with mode: 0644]
queue-4.9/usb-musb-fix-suspend-with-devices-connected-for-a64.patch [new file with mode: 0644]
queue-4.9/usb-quirks-ignore-remote-wake-up-on-fibocom-l850-gl-lte-modem.patch [new file with mode: 0644]
queue-4.9/usb-xhci-mtk-fix-broken-streams-issue-on-0.96-xhci.patch [new file with mode: 0644]

diff --git a/queue-4.9/cdc-acm-fix-break-rx-code-path-adding-necessary-calls.patch b/queue-4.9/cdc-acm-fix-break-rx-code-path-adding-necessary-calls.patch
new file mode 100644 (file)
index 0000000..45b40d6
--- /dev/null
@@ -0,0 +1,35 @@
+From 08dff274edda54310d6f1cf27b62fddf0f8d146e Mon Sep 17 00:00:00 2001
+From: Oliver Neukum <oneukum@suse.com>
+Date: Thu, 11 Mar 2021 14:37:14 +0100
+Subject: cdc-acm: fix BREAK rx code path adding necessary calls
+
+From: Oliver Neukum <oneukum@suse.com>
+
+commit 08dff274edda54310d6f1cf27b62fddf0f8d146e upstream.
+
+Counting break events is nice but we should actually report them to
+the tty layer.
+
+Fixes: 5a6a62bdb9257 ("cdc-acm: add TIOCMIWAIT")
+Signed-off-by: Oliver Neukum <oneukum@suse.com>
+Link: https://lore.kernel.org/r/20210311133714.31881-1-oneukum@suse.com
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/class/cdc-acm.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/usb/class/cdc-acm.c
++++ b/drivers/usb/class/cdc-acm.c
+@@ -335,8 +335,10 @@ static void acm_ctrl_irq(struct urb *urb
+                       acm->iocount.dsr++;
+               if (difference & ACM_CTRL_DCD)
+                       acm->iocount.dcd++;
+-              if (newctrl & ACM_CTRL_BRK)
++              if (newctrl & ACM_CTRL_BRK) {
+                       acm->iocount.brk++;
++                      tty_insert_flip_char(&acm->port, 0, TTY_BREAK);
++              }
+               if (newctrl & ACM_CTRL_RI)
+                       acm->iocount.rng++;
+               if (newctrl & ACM_CTRL_FRAMING)
index 8b41f24052300d194c37b3ed09fa7b2ba8e9861d..ff1dd443b3cf2d25b6bd0e84a1905a7e2f4386f8 100644 (file)
@@ -24,3 +24,9 @@ reiserfs-update-reiserfs_xattrs_initialized-condition.patch
 pinctrl-rockchip-fix-restore-error-in-resume.patch
 extcon-fix-error-handling-in-extcon_dev_register.patch
 firewire-nosy-fix-a-use-after-free-bug-in-nosy_ioctl.patch
+usb-quirks-ignore-remote-wake-up-on-fibocom-l850-gl-lte-modem.patch
+usb-musb-fix-suspend-with-devices-connected-for-a64.patch
+usb-xhci-mtk-fix-broken-streams-issue-on-0.96-xhci.patch
+cdc-acm-fix-break-rx-code-path-adding-necessary-calls.patch
+usb-cdc-acm-downgrade-message-to-debug.patch
+usb-cdc-acm-fix-use-after-free-after-probe-failure.patch
diff --git a/queue-4.9/usb-cdc-acm-downgrade-message-to-debug.patch b/queue-4.9/usb-cdc-acm-downgrade-message-to-debug.patch
new file mode 100644 (file)
index 0000000..abedf41
--- /dev/null
@@ -0,0 +1,33 @@
+From e4c77070ad45fc940af1d7fb1e637c349e848951 Mon Sep 17 00:00:00 2001
+From: Oliver Neukum <oneukum@suse.com>
+Date: Thu, 11 Mar 2021 14:01:26 +0100
+Subject: USB: cdc-acm: downgrade message to debug
+
+From: Oliver Neukum <oneukum@suse.com>
+
+commit e4c77070ad45fc940af1d7fb1e637c349e848951 upstream.
+
+This failure is so common that logging an error here amounts
+to spamming log files.
+
+Reviewed-by: Bruno Thomsen <bruno.thomsen@gmail.com>
+Signed-off-by: Oliver Neukum <oneukum@suse.com>
+Cc: stable <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20210311130126.15972-2-oneukum@suse.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/class/cdc-acm.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/usb/class/cdc-acm.c
++++ b/drivers/usb/class/cdc-acm.c
+@@ -543,7 +543,8 @@ static void acm_port_dtr_rts(struct tty_
+       res = acm_set_control(acm, val);
+       if (res && (acm->ctrl_caps & USB_CDC_CAP_LINE))
+-              dev_err(&acm->control->dev, "failed to set dtr/rts\n");
++              /* This is broken in too many devices to spam the logs */
++              dev_dbg(&acm->control->dev, "failed to set dtr/rts\n");
+ }
+ static int acm_port_activate(struct tty_port *port, struct tty_struct *tty)
diff --git a/queue-4.9/usb-cdc-acm-fix-use-after-free-after-probe-failure.patch b/queue-4.9/usb-cdc-acm-fix-use-after-free-after-probe-failure.patch
new file mode 100644 (file)
index 0000000..2cd5c3b
--- /dev/null
@@ -0,0 +1,39 @@
+From 4e49bf376c0451ad2eae2592e093659cde12be9a Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan@kernel.org>
+Date: Mon, 22 Mar 2021 16:53:12 +0100
+Subject: USB: cdc-acm: fix use-after-free after probe failure
+
+From: Johan Hovold <johan@kernel.org>
+
+commit 4e49bf376c0451ad2eae2592e093659cde12be9a upstream.
+
+If tty-device registration fails the driver would fail to release the
+data interface. When the device is later disconnected, the disconnect
+callback would still be called for the data interface and would go about
+releasing already freed resources.
+
+Fixes: c93d81955005 ("usb: cdc-acm: fix error handling in acm_probe()")
+Cc: stable@vger.kernel.org      # 3.9
+Cc: Alexey Khoroshilov <khoroshilov@ispras.ru>
+Acked-by: Oliver Neukum <oneukum@suse.com>
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Link: https://lore.kernel.org/r/20210322155318.9837-3-johan@kernel.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/class/cdc-acm.c |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/drivers/usb/class/cdc-acm.c
++++ b/drivers/usb/class/cdc-acm.c
+@@ -1460,6 +1460,11 @@ skip_countries:
+       return 0;
+ alloc_fail8:
++      if (!acm->combined_interfaces) {
++              /* Clear driver data so that disconnect() returns early. */
++              usb_set_intfdata(data_interface, NULL);
++              usb_driver_release_interface(&acm_driver, data_interface);
++      }
+       if (acm->country_codes) {
+               device_remove_file(&acm->control->dev,
+                               &dev_attr_wCountryCodes);
diff --git a/queue-4.9/usb-musb-fix-suspend-with-devices-connected-for-a64.patch b/queue-4.9/usb-musb-fix-suspend-with-devices-connected-for-a64.patch
new file mode 100644 (file)
index 0000000..dc822ca
--- /dev/null
@@ -0,0 +1,49 @@
+From 92af4fc6ec331228aca322ca37c8aea7b150a151 Mon Sep 17 00:00:00 2001
+From: Tony Lindgren <tony@atomide.com>
+Date: Wed, 24 Mar 2021 09:11:41 +0200
+Subject: usb: musb: Fix suspend with devices connected for a64
+
+From: Tony Lindgren <tony@atomide.com>
+
+commit 92af4fc6ec331228aca322ca37c8aea7b150a151 upstream.
+
+Pinephone running on Allwinner A64 fails to suspend with USB devices
+connected as reported by Bhushan Shah <bshah@kde.org>. Reverting
+commit 5fbf7a253470 ("usb: musb: fix idling for suspend after
+disconnect interrupt") fixes the issue.
+
+Let's add suspend checks also for suspend after disconnect interrupt
+quirk handling like we already do elsewhere.
+
+Fixes: 5fbf7a253470 ("usb: musb: fix idling for suspend after disconnect interrupt")
+Reported-by: Bhushan Shah <bshah@kde.org>
+Tested-by: Bhushan Shah <bshah@kde.org>
+Signed-off-by: Tony Lindgren <tony@atomide.com>
+Link: https://lore.kernel.org/r/20210324071142.42264-1-tony@atomide.com
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/musb/musb_core.c |   12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+--- a/drivers/usb/musb/musb_core.c
++++ b/drivers/usb/musb/musb_core.c
+@@ -1858,10 +1858,14 @@ static void musb_pm_runtime_check_sessio
+               MUSB_DEVCTL_HR;
+       switch (devctl & ~s) {
+       case MUSB_QUIRK_B_DISCONNECT_99:
+-              musb_dbg(musb, "Poll devctl in case of suspend after disconnect\n");
+-              schedule_delayed_work(&musb->irq_work,
+-                                    msecs_to_jiffies(1000));
+-              break;
++              if (musb->quirk_retries && !musb->flush_irq_work) {
++                      musb_dbg(musb, "Poll devctl in case of suspend after disconnect\n");
++                      schedule_delayed_work(&musb->irq_work,
++                                            msecs_to_jiffies(1000));
++                      musb->quirk_retries--;
++                      break;
++              }
++              fallthrough;
+       case MUSB_QUIRK_B_INVALID_VBUS_91:
+               if (musb->quirk_retries--) {
+                       musb_dbg(musb,
diff --git a/queue-4.9/usb-quirks-ignore-remote-wake-up-on-fibocom-l850-gl-lte-modem.patch b/queue-4.9/usb-quirks-ignore-remote-wake-up-on-fibocom-l850-gl-lte-modem.patch
new file mode 100644 (file)
index 0000000..e124fb1
--- /dev/null
@@ -0,0 +1,42 @@
+From 0bd860493f81eb2a46173f6f5e44cc38331c8dbd Mon Sep 17 00:00:00 2001
+From: Vincent Palatin <vpalatin@chromium.org>
+Date: Fri, 19 Mar 2021 13:48:02 +0100
+Subject: USB: quirks: ignore remote wake-up on Fibocom L850-GL LTE modem
+
+From: Vincent Palatin <vpalatin@chromium.org>
+
+commit 0bd860493f81eb2a46173f6f5e44cc38331c8dbd upstream.
+
+This LTE modem (M.2 card) has a bug in its power management:
+there is some kind of race condition for U3 wake-up between the host and
+the device. The modem firmware sometimes crashes/locks when both events
+happen at the same time and the modem fully drops off the USB bus (and
+sometimes re-enumerates, sometimes just gets stuck until the next
+reboot).
+
+Tested with the modem wired to the XHCI controller on an AMD 3015Ce
+platform. Without the patch, the modem dropped of the USB bus 5 times in
+3 days. With the quirk, it stayed connected for a week while the
+'runtime_suspended_time' counter incremented as excepted.
+
+Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
+Link: https://lore.kernel.org/r/20210319124802.2315195-1-vpalatin@chromium.org
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/core/quirks.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/usb/core/quirks.c
++++ b/drivers/usb/core/quirks.c
+@@ -321,6 +321,10 @@ static const struct usb_device_id usb_qu
+       /* DJI CineSSD */
+       { USB_DEVICE(0x2ca3, 0x0031), .driver_info = USB_QUIRK_NO_LPM },
++      /* Fibocom L850-GL LTE Modem */
++      { USB_DEVICE(0x2cb7, 0x0007), .driver_info =
++                      USB_QUIRK_IGNORE_REMOTE_WAKEUP },
++
+       /* INTEL VALUE SSD */
+       { USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME },
diff --git a/queue-4.9/usb-xhci-mtk-fix-broken-streams-issue-on-0.96-xhci.patch b/queue-4.9/usb-xhci-mtk-fix-broken-streams-issue-on-0.96-xhci.patch
new file mode 100644 (file)
index 0000000..bbee4d7
--- /dev/null
@@ -0,0 +1,49 @@
+From 6f978a30c9bb12dab1302d0f06951ee290f5e600 Mon Sep 17 00:00:00 2001
+From: Chunfeng Yun <chunfeng.yun@mediatek.com>
+Date: Tue, 23 Mar 2021 15:02:46 +0800
+Subject: usb: xhci-mtk: fix broken streams issue on 0.96 xHCI
+
+From: Chunfeng Yun <chunfeng.yun@mediatek.com>
+
+commit 6f978a30c9bb12dab1302d0f06951ee290f5e600 upstream.
+
+The MediaTek 0.96 xHCI controller on some platforms does not
+support bulk stream even HCCPARAMS says supporting, due to MaxPSASize
+is set a default value 1 by mistake, here use XHCI_BROKEN_STREAMS
+quirk to fix it.
+
+Fixes: 94a631d91ad3 ("usb: xhci-mtk: check hcc_params after adding primary hcd")
+Cc: stable <stable@vger.kernel.org>
+Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
+Link: https://lore.kernel.org/r/1616482975-17841-4-git-send-email-chunfeng.yun@mediatek.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/host/xhci-mtk.c |   10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+--- a/drivers/usb/host/xhci-mtk.c
++++ b/drivers/usb/host/xhci-mtk.c
+@@ -470,6 +470,13 @@ static void xhci_mtk_quirks(struct devic
+       xhci->quirks |= XHCI_SPURIOUS_SUCCESS;
+       if (mtk->lpm_support)
+               xhci->quirks |= XHCI_LPM_SUPPORT;
++
++      /*
++       * MTK xHCI 0.96: PSA is 1 by default even if doesn't support stream,
++       * and it's 3 when support it.
++       */
++      if (xhci->hci_version < 0x100 && HCC_MAX_PSA(xhci->hcc_params) == 4)
++              xhci->quirks |= XHCI_BROKEN_STREAMS;
+ }
+ /* called during probe() after chip reset completes */
+@@ -636,7 +643,8 @@ static int xhci_mtk_probe(struct platfor
+       if (ret)
+               goto put_usb3_hcd;
+-      if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
++      if (HCC_MAX_PSA(xhci->hcc_params) >= 4 &&
++          !(xhci->quirks & XHCI_BROKEN_STREAMS))
+               xhci->shared_hcd->can_do_streams = 1;
+       ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);