Skip to content

Commit a4a251f

Browse files
sgruszkagregkh
authored andcommitted
usb: xhci: do not perform Soft Retry for some xHCI hosts
On some systems rt2800usb and mt7601u devices are unable to operate since commit f8f80be ("xhci: Use soft retry to recover faster from transaction errors") Seems that some xHCI controllers can not perform Soft Retry correctly, affecting those devices. To avoid the problem add xhci->quirks flag that restore pre soft retry xhci behaviour for affected xHCI controllers. Currently those are AMD_PROMONTORYA_4 and AMD_PROMONTORYA_2, since it was confirmed by the users: on those xHCI hosts issue happen and is gone after disabling Soft Retry. [minor commit message rewording for checkpatch -Mathias] Fixes: f8f80be ("xhci: Use soft retry to recover faster from transaction errors") Cc: <stable@vger.kernel.org> # 4.20+ Reported-by: Bernhard <bernhard.gebetsberger@gmx.at> Tested-by: Bernhard <bernhard.gebetsberger@gmx.at> Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202541 Link: https://lore.kernel.org/r/20210311115353.2137560-2-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a949b9e commit a4a251f

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

drivers/usb/host/xhci-pci.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,11 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
295295
pdev->device == 0x9026)
296296
xhci->quirks |= XHCI_RESET_PLL_ON_DISCONNECT;
297297

298+
if (pdev->vendor == PCI_VENDOR_ID_AMD &&
299+
(pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_2 ||
300+
pdev->device == PCI_DEVICE_ID_AMD_PROMONTORYA_4))
301+
xhci->quirks |= XHCI_NO_SOFT_RETRY;
302+
298303
if (xhci->quirks & XHCI_RESET_ON_RESUME)
299304
xhci_dbg_trace(xhci, trace_xhci_dbg_quirks,
300305
"QUIRK: Resetting on resume");

drivers/usb/host/xhci-ring.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2484,7 +2484,8 @@ static int process_bulk_intr_td(struct xhci_hcd *xhci, struct xhci_td *td,
24842484
remaining = 0;
24852485
break;
24862486
case COMP_USB_TRANSACTION_ERROR:
2487-
if ((ep_ring->err_count++ > MAX_SOFT_RETRY) ||
2487+
if (xhci->quirks & XHCI_NO_SOFT_RETRY ||
2488+
(ep_ring->err_count++ > MAX_SOFT_RETRY) ||
24882489
le32_to_cpu(slot_ctx->tt_info) & TT_SLOT)
24892490
break;
24902491

drivers/usb/host/xhci.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,6 +1891,7 @@ struct xhci_hcd {
18911891
#define XHCI_SKIP_PHY_INIT BIT_ULL(37)
18921892
#define XHCI_DISABLE_SPARSE BIT_ULL(38)
18931893
#define XHCI_SG_TRB_CACHE_SIZE_QUIRK BIT_ULL(39)
1894+
#define XHCI_NO_SOFT_RETRY BIT_ULL(40)
18941895

18951896
unsigned int num_active_eps;
18961897
unsigned int limit_active_eps;

0 commit comments

Comments
 (0)