Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert "xhci: add quirk for host controllers that don't update endpoint DCS"

This reverts commit 5255660b208aebfdb71d574f3952cf48392f4306.

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: 5255660b208a ("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>

authored by

Oliver Neukum and committed by
Greg Kroah-Hartman
5bef4b3c 9dc162e2

+2 -27
+1 -3
drivers/usb/host/xhci-pci.c
··· 479 479 pdev->device == 0x3432) 480 480 xhci->quirks |= XHCI_BROKEN_STREAMS; 481 481 482 - if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) { 482 + if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) 483 483 xhci->quirks |= XHCI_LPM_SUPPORT; 484 - xhci->quirks |= XHCI_EP_CTX_BROKEN_DCS; 485 - } 486 484 487 485 if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && 488 486 pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI) {
+1 -24
drivers/usb/host/xhci-ring.c
··· 626 626 struct xhci_ring *ep_ring; 627 627 struct xhci_command *cmd; 628 628 struct xhci_segment *new_seg; 629 - struct xhci_segment *halted_seg = NULL; 630 629 union xhci_trb *new_deq; 631 630 int new_cycle; 632 - union xhci_trb *halted_trb; 633 - int index = 0; 634 631 dma_addr_t addr; 635 632 u64 hw_dequeue; 636 633 bool cycle_found = false; ··· 665 668 hw_dequeue = xhci_get_hw_deq(xhci, dev, ep_index, stream_id); 666 669 new_seg = ep_ring->deq_seg; 667 670 new_deq = ep_ring->dequeue; 668 - 669 - /* 670 - * Quirk: xHC write-back of the DCS field in the hardware dequeue 671 - * pointer is wrong - use the cycle state of the TRB pointed to by 672 - * the dequeue pointer. 673 - */ 674 - if (xhci->quirks & XHCI_EP_CTX_BROKEN_DCS && 675 - !(ep->ep_state & EP_HAS_STREAMS)) 676 - halted_seg = trb_in_td(xhci, td->start_seg, 677 - td->first_trb, td->last_trb, 678 - hw_dequeue & ~0xf, false); 679 - if (halted_seg) { 680 - index = ((dma_addr_t)(hw_dequeue & ~0xf) - halted_seg->dma) / 681 - sizeof(*halted_trb); 682 - halted_trb = &halted_seg->trbs[index]; 683 - new_cycle = halted_trb->generic.field[3] & 0x1; 684 - xhci_dbg(xhci, "Endpoint DCS = %d TRB index = %d cycle = %d\n", 685 - (u8)(hw_dequeue & 0x1), index, new_cycle); 686 - } else { 687 - new_cycle = hw_dequeue & 0x1; 688 - } 671 + new_cycle = hw_dequeue & 0x1; 689 672 690 673 /* 691 674 * We want to find the pointer, segment and cycle state of the new trb