]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Feb 2020 08:52:36 +0000 (09:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Feb 2020 08:52:36 +0000 (09:52 +0100)
added patches:
xhci-fix-runtime-pm-enabling-for-quirky-intel-hosts.patch
xhci-force-maximum-packet-size-for-full-speed-bulk-devices-to-valid-range.patch

queue-4.14/series
queue-4.14/xhci-fix-runtime-pm-enabling-for-quirky-intel-hosts.patch [new file with mode: 0644]
queue-4.14/xhci-force-maximum-packet-size-for-full-speed-bulk-devices-to-valid-range.patch [new file with mode: 0644]

index 444e5bd0c24125c7b58ac85cf25a55a983657e3a..815737f003ce7ff2d8efdec75a57c135be0189d2 100644 (file)
@@ -176,3 +176,5 @@ floppy-check-fdc-index-for-errors-before-assigning-it.patch
 vt-selection-handle-pending-signals-in-paste_selection.patch
 staging-android-ashmem-disallow-ashmem-memory-from-being-remapped.patch
 staging-vt6656-fix-sign-of-rx_dbm-to-bb_pre_ed_rssi.patch
+xhci-force-maximum-packet-size-for-full-speed-bulk-devices-to-valid-range.patch
+xhci-fix-runtime-pm-enabling-for-quirky-intel-hosts.patch
diff --git a/queue-4.14/xhci-fix-runtime-pm-enabling-for-quirky-intel-hosts.patch b/queue-4.14/xhci-fix-runtime-pm-enabling-for-quirky-intel-hosts.patch
new file mode 100644 (file)
index 0000000..da74166
--- /dev/null
@@ -0,0 +1,55 @@
+From 024d411e9c5d49eb96c825af52a3ce2682895676 Mon Sep 17 00:00:00 2001
+From: Mathias Nyman <mathias.nyman@linux.intel.com>
+Date: Mon, 10 Feb 2020 15:45:52 +0200
+Subject: xhci: fix runtime pm enabling for quirky Intel hosts
+
+From: Mathias Nyman <mathias.nyman@linux.intel.com>
+
+commit 024d411e9c5d49eb96c825af52a3ce2682895676 upstream.
+
+Intel hosts that need the XHCI_PME_STUCK_QUIRK flag should enable
+runtime pm by calling xhci_pme_acpi_rtd3_enable() before
+usb_hcd_pci_probe() calls pci_dev_run_wake().
+Otherwise usage count for the device won't be decreased, and runtime
+suspend is prevented.
+
+usb_hcd_pci_probe() only decreases the usage count if device can
+generate run-time wake-up events, i.e. when pci_dev_run_wake()
+returns true.
+
+This issue was exposed by pci_dev_run_wake() change in
+commit 8feaec33b986 ("PCI / PM: Always check PME wakeup capability for
+runtime wakeup support")
+and should be backported to kernels with that change
+
+Cc: <stable@vger.kernel.org> # 4.13+
+Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
+Link: https://lore.kernel.org/r/20200210134553.9144-4-mathias.nyman@linux.intel.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/host/xhci-pci.c |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/usb/host/xhci-pci.c
++++ b/drivers/usb/host/xhci-pci.c
+@@ -284,6 +284,9 @@ static int xhci_pci_setup(struct usb_hcd
+       if (!usb_hcd_is_primary_hcd(hcd))
+               return 0;
++      if (xhci->quirks & XHCI_PME_STUCK_QUIRK)
++              xhci_pme_acpi_rtd3_enable(pdev);
++
+       xhci_dbg(xhci, "Got SBRN %u\n", (unsigned int) xhci->sbrn);
+       /* Find any debug ports */
+@@ -344,9 +347,6 @@ static int xhci_pci_probe(struct pci_dev
+                       HCC_MAX_PSA(xhci->hcc_params) >= 4)
+               xhci->shared_hcd->can_do_streams = 1;
+-      if (xhci->quirks & XHCI_PME_STUCK_QUIRK)
+-              xhci_pme_acpi_rtd3_enable(dev);
+-
+       /* USB-2 and USB-3 roothubs initialized, allow runtime pm suspend */
+       pm_runtime_put_noidle(&dev->dev);
diff --git a/queue-4.14/xhci-force-maximum-packet-size-for-full-speed-bulk-devices-to-valid-range.patch b/queue-4.14/xhci-force-maximum-packet-size-for-full-speed-bulk-devices-to-valid-range.patch
new file mode 100644 (file)
index 0000000..07693a5
--- /dev/null
@@ -0,0 +1,51 @@
+From f148b9f402ef002b57bcff3964d45abc8ffb6c3f Mon Sep 17 00:00:00 2001
+From: Mathias Nyman <mathias.nyman@linux.intel.com>
+Date: Mon, 10 Feb 2020 15:45:50 +0200
+Subject: xhci: Force Maximum Packet size for Full-speed bulk devices to valid range.
+
+From: Mathias Nyman <mathias.nyman@linux.intel.com>
+
+commit f148b9f402ef002b57bcff3964d45abc8ffb6c3f upstream.
+
+A Full-speed bulk USB audio device (DJ-Tech CTRL) with a invalid Maximum
+Packet Size of 4 causes a xHC "Parameter Error" at enumeration.
+
+This is because valid Maximum packet sizes for Full-speed bulk endpoints
+are 8, 16, 32 and 64 bytes. Hosts are not required to support other values
+than these. See usb 2 specs section 5.8.3 for details.
+
+The device starts working after forcing the maximum packet size to 8.
+This is most likely the case with other devices as well, so force the
+maximum packet size to a valid range.
+
+Cc: stable@vger.kernel.org
+Reported-by: Rene D Obermueller <cmdrrdo@gmail.com>
+Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
+Link: https://lore.kernel.org/r/20200210134553.9144-2-mathias.nyman@linux.intel.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/host/xhci-mem.c |   12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+--- a/drivers/usb/host/xhci-mem.c
++++ b/drivers/usb/host/xhci-mem.c
+@@ -1479,9 +1479,15 @@ int xhci_endpoint_init(struct xhci_hcd *
+       /* Allow 3 retries for everything but isoc, set CErr = 3 */
+       if (!usb_endpoint_xfer_isoc(&ep->desc))
+               err_count = 3;
+-      /* Some devices get this wrong */
+-      if (usb_endpoint_xfer_bulk(&ep->desc) && udev->speed == USB_SPEED_HIGH)
+-              max_packet = 512;
++      /* HS bulk max packet should be 512, FS bulk supports 8, 16, 32 or 64 */
++      if (usb_endpoint_xfer_bulk(&ep->desc)) {
++              if (udev->speed == USB_SPEED_HIGH)
++                      max_packet = 512;
++              if (udev->speed == USB_SPEED_FULL) {
++                      max_packet = rounddown_pow_of_two(max_packet);
++                      max_packet = clamp_val(max_packet, 8, 64);
++              }
++      }
+       /* xHCI 1.0 and 1.1 indicates that ctrl ep avg TRB Length should be 8 */
+       if (usb_endpoint_xfer_control(&ep->desc) && xhci->hci_version >= 0x100)
+               avg_trb_len = 8;