Skip to content

Commit 5bef4b3

Browse files
oneukumgregkh
authored andcommitted
Revert "xhci: add quirk for host controllers that don't update endpoint DCS"
This reverts commit 5255660. This quirk breaks at least the following hardware: 0b:00.0 0c03: 1106:3483 (rev 01) (prog-if 30 [XHCI]) Subsystem: 1106:3483 Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+ Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- Latency: 0, Cache Line Size: 64 bytes Interrupt: pin A routed to IRQ 66 Region 0: Memory at fb400000 (64-bit, non-prefetchable) [size=4K] Capabilities: [80] Power Management version 3 Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+) Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME- Capabilities: [90] MSI: Enable+ Count=1/4 Maskable- 64bit+ Address: 00000000fee007b8 Data: 0000 Capabilities: [c4] Express (v2) Endpoint, MSI 00 DevCap: MaxPayload 256 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 89W DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq- RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop+ MaxPayload 128 bytes, MaxReadReq 512 bytes DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr+ TransPend- LnkCap: Port #0, Speed 5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s <2us, L1 <16us ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp- LnkCtl: ASPM Disabled; RCB 64 bytes, Disabled- CommClk+ ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt- LnkSta: Speed 5GT/s, Width x1 TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt- DevCap2: Completion Timeout: Range B, TimeoutDis+ NROPrPrP- LTR- 10BitTagComp- 10BitTagReq- OBFF Not Supported, ExtFmt- EETLPPrefix- EmergencyPowerReduction Not Supported, EmergencyPowerReductionInit- FRS- TPHComp- ExtTPHComp- AtomicOpsCap: 32bit- 64bit- 128bitCAS- DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis- LTR- 10BitTagReq- OBFF Disabled, AtomicOpsCtl: ReqEn- LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis- Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS- Compliance Preset/De-emphasis: -6dB de-emphasis, 0dB preshoot LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete- EqualizationPhase1- EqualizationPhase2- EqualizationPhase3- LinkEqualizationRequest- Retimer- 2Retimers- CrosslinkRes: unsupported Capabilities: [100 v1] Advanced Error Reporting UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol- UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol- UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol- CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr- CEMsk: RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+ AERCap: First Error Pointer: 00, ECRCGenCap- ECRCGenEn- ECRCChkCap- ECRCChkEn- MultHdrRecCap- MultHdrRecEn- TLPPfxPres- HdrLogCap- HeaderLog: 00000000 00000000 00000000 00000000 Kernel driver in use: xhci_hcd Kernel modules: xhci_pci with the quirk enabled it fails early with [ 0.754373] pci 0000:0b:00.0: xHCI HW did not halt within 32000 usec status = 0x1000 [ 0.754419] pci 0000:0b:00.0: quirk_usb_early_handoff+0x0/0x7a0 took 31459 usecs [ 2.228048] xhci_hcd 0000:0b:00.0: xHCI Host Controller [ 2.228053] xhci_hcd 0000:0b:00.0: new USB bus registered, assigned bus number 7 [ 2.260073] xhci_hcd 0000:0b:00.0: Host halt failed, -110 [ 2.260079] xhci_hcd 0000:0b:00.0: can't setup: -110 [ 2.260551] xhci_hcd 0000:0b:00.0: USB bus 7 deregistered [ 2.260624] xhci_hcd 0000:0b:00.0: init 0000:0b:00.0 fail, -110 [ 2.260639] xhci_hcd: probe of 0000:0b:00.0 failed with error -110 The hardware in question is an external PCIe card. It looks to me like the quirk needs to be narrowed down. But this needs information about the hardware showing the issue this quirk is to fix. So for now a clean revert. Signed-off-by: Oliver Neukum <oneukum@suse.com> Fixes: 5255660 ("xhci: add quirk for host controllers that don't update endpoint DCS") Cc: stable <stable@kernel.org> Link: https://lore.kernel.org/r/20230713112830.21773-1-oneukum@suse.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 9dc162e commit 5bef4b3

File tree

2 files changed

+2
-27
lines changed

2 files changed

+2
-27
lines changed

drivers/usb/host/xhci-pci.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,10 +479,8 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
479479
pdev->device == 0x3432)
480480
xhci->quirks |= XHCI_BROKEN_STREAMS;
481481

482-
if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) {
482+
if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483)
483483
xhci->quirks |= XHCI_LPM_SUPPORT;
484-
xhci->quirks |= XHCI_EP_CTX_BROKEN_DCS;
485-
}
486484

487485
if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
488486
pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI) {

drivers/usb/host/xhci-ring.c

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -626,11 +626,8 @@ static int xhci_move_dequeue_past_td(struct xhci_hcd *xhci,
626626
struct xhci_ring *ep_ring;
627627
struct xhci_command *cmd;
628628
struct xhci_segment *new_seg;
629-
struct xhci_segment *halted_seg = NULL;
630629
union xhci_trb *new_deq;
631630
int new_cycle;
632-
union xhci_trb *halted_trb;
633-
int index = 0;
634631
dma_addr_t addr;
635632
u64 hw_dequeue;
636633
bool cycle_found = false;
@@ -668,27 +665,7 @@ static int xhci_move_dequeue_past_td(struct xhci_hcd *xhci,
668665
hw_dequeue = xhci_get_hw_deq(xhci, dev, ep_index, stream_id);
669666
new_seg = ep_ring->deq_seg;
670667
new_deq = ep_ring->dequeue;
671-
672-
/*
673-
* Quirk: xHC write-back of the DCS field in the hardware dequeue
674-
* pointer is wrong - use the cycle state of the TRB pointed to by
675-
* the dequeue pointer.
676-
*/
677-
if (xhci->quirks & XHCI_EP_CTX_BROKEN_DCS &&
678-
!(ep->ep_state & EP_HAS_STREAMS))
679-
halted_seg = trb_in_td(xhci, td->start_seg,
680-
td->first_trb, td->last_trb,
681-
hw_dequeue & ~0xf, false);
682-
if (halted_seg) {
683-
index = ((dma_addr_t)(hw_dequeue & ~0xf) - halted_seg->dma) /
684-
sizeof(*halted_trb);
685-
halted_trb = &halted_seg->trbs[index];
686-
new_cycle = halted_trb->generic.field[3] & 0x1;
687-
xhci_dbg(xhci, "Endpoint DCS = %d TRB index = %d cycle = %d\n",
688-
(u8)(hw_dequeue & 0x1), index, new_cycle);
689-
} else {
690-
new_cycle = hw_dequeue & 0x1;
691-
}
668+
new_cycle = hw_dequeue & 0x1;
692669

693670
/*
694671
* We want to find the pointer, segment and cycle state of the new trb

0 commit comments

Comments
 (0)