Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1506335 > unrolled thread

[PATCH v2 RESEND] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers

Started byBabu Moger <babu.moger@oracle.com>
First post2016-10-22 00:30 +0200
Last post2016-10-25 15:20 +0200
Articles 6 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2 RESEND] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers Babu Moger <babu.moger@oracle.com> - 2016-10-22 00:30 +0200
    Re: [PATCH v2 RESEND] drivers/usb: Skip auto handoff for TI and  RENESAS usb controllers Mathias Nyman <mathias.nyman@linux.intel.com> - 2016-10-24 12:00 +0200
      RE: [PATCH v2 RESEND] drivers/usb: Skip auto handoff for TI and  RENESAS usb controllers Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> - 2016-10-24 13:00 +0200
        Re: [PATCH v2 RESEND] drivers/usb: Skip auto handoff for TI and  RENESAS usb controllers Babu Moger <babu.moger@oracle.com> - 2016-10-24 17:00 +0200
          Re: [PATCH v2 RESEND] drivers/usb: Skip auto handoff for TI and  RENESAS usb controllers Mathias Nyman <mathias.nyman@intel.com> - 2016-10-25 09:00 +0200
            Re: [PATCH v2 RESEND] drivers/usb: Skip auto handoff for TI and  RENESAS usb controllers Babu Moger <babu.moger@oracle.com> - 2016-10-25 15:20 +0200

#1506335 — [PATCH v2 RESEND] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers

FromBabu Moger <babu.moger@oracle.com>
Date2016-10-22 00:30 +0200
Subject[PATCH v2 RESEND] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers
Message-ID<suQu5-3nv-1@gated-at.bofh.it>
Never seen XHCI auto handoff working on TI and RENESAS cards.
Eventually, we force handoff. This code forces the handoff
unconditionally. It saves 5 seconds boot time for each card.

Signed-off-by: Babu Moger <babu.moger@oracle.com>
---
v2: 
 Made changes per comments from Greg KH.
 Extra space removal in assignment
 Added both vendor and device id checks.
 Resending the patch. Original discussion here.
 https://marc.info/?t=145221162000007&r=1&w=4

 drivers/usb/host/pci-quirks.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
index 35af362..31c9502 100644
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -996,6 +996,14 @@ static void quirk_usb_handoff_xhci(struct pci_dev *pdev)
 	}
 	val = readl(base + ext_cap_offset);
 
+	/* Auto handoff never worked for these devices. Force it and continue */
+	if ((pdev->vendor == PCI_VENDOR_ID_TI && pdev->device == 0x8241) ||
+			(pdev->vendor == PCI_VENDOR_ID_RENESAS
+			 && pdev->device == 0x0014)) {
+		val = (val | XHCI_HC_OS_OWNED) & ~XHCI_HC_BIOS_OWNED;
+		writel(val, base + ext_cap_offset);
+	}
+
 	/* If the BIOS owns the HC, signal that the OS wants it, and wait */
 	if (val & XHCI_HC_BIOS_OWNED) {
 		writel(val | XHCI_HC_OS_OWNED, base + ext_cap_offset);
-- 
1.7.1

[toc] | [next] | [standalone]


#1507045 — Re: [PATCH v2 RESEND] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers

FromMathias Nyman <mathias.nyman@linux.intel.com>
Date2016-10-24 12:00 +0200
SubjectRe: [PATCH v2 RESEND] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers
Message-ID<svKcV-5NX-1@gated-at.bofh.it>
In reply to#1506335
On 22.10.2016 01:25, Babu Moger wrote:
> Never seen XHCI auto handoff working on TI and RENESAS cards.
> Eventually, we force handoff. This code forces the handoff
> unconditionally. It saves 5 seconds boot time for each card.
>
> Signed-off-by: Babu Moger <babu.moger@oracle.com>

Do the Renesas and TI controllers still advertise the extended capability
for the handoff? (XHCI_EXT_CAPS_LEGACY)

Is this some known issue with these vendors controllers? Is there some documentation
about this, errata or anything?

Adding Yoshihiro Shimoda, he might know about the Renesas controller.

-Mathias

[toc] | [prev] | [next] | [standalone]


#1507092 — RE: [PATCH v2 RESEND] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers

FromYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date2016-10-24 13:00 +0200
SubjectRE: [PATCH v2 RESEND] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers
Message-ID<svL90-6xn-33@gated-at.bofh.it>
In reply to#1507045
Hi,

> From: Mathias Nyman
> Sent: Monday, October 24, 2016 6:58 PM
> 
> On 22.10.2016 01:25, Babu Moger wrote:
> > Never seen XHCI auto handoff working on TI and RENESAS cards.
> > Eventually, we force handoff. This code forces the handoff
> > unconditionally. It saves 5 seconds boot time for each card.
> >
> > Signed-off-by: Babu Moger <babu.moger@oracle.com>
> 
> Do the Renesas and TI controllers still advertise the extended capability
> for the handoff? (XHCI_EXT_CAPS_LEGACY)
> 
> Is this some known issue with these vendors controllers? Is there some documentation
> about this, errata or anything?
> 
> Adding Yoshihiro Shimoda, he might know about the Renesas controller.

Thank you for adding me on this email.
However, unfortunately I don't know the detail about Renesas PCIe xHCI controllers.
(I know the xHCI controller of R-Car SoCs for now.)

Best regards,
Yoshihiro Shimoda

[toc] | [prev] | [next] | [standalone]


#1507276 — Re: [PATCH v2 RESEND] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers

FromBabu Moger <babu.moger@oracle.com>
Date2016-10-24 17:00 +0200
SubjectRe: [PATCH v2 RESEND] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers
Message-ID<svOTg-vq-45@gated-at.bofh.it>
In reply to#1507092
On 10/24/2016 5:54 AM, Yoshihiro Shimoda wrote:
> Hi,
>
>> From: Mathias Nyman
>> Sent: Monday, October 24, 2016 6:58 PM
>>
>> On 22.10.2016 01:25, Babu Moger wrote:
>>> Never seen XHCI auto handoff working on TI and RENESAS cards.
>>> Eventually, we force handoff. This code forces the handoff
>>> unconditionally. It saves 5 seconds boot time for each card.
>>>
>>> Signed-off-by: Babu Moger <babu.moger@oracle.com>
>> Do the Renesas and TI controllers still advertise the extended capability
>> for the handoff? (XHCI_EXT_CAPS_LEGACY)
I don't see this capability.  Here is lspci output.

# lspci -s 0009:01:00.0 -vvv
0009:01:00.0 USB controller: Texas Instruments TUSB73x0 SuperSpeed USB 
3.0 xHCI Host Controller (rev 02) (prog-if 30 [XHCI])
         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 0000000e
         Region 0: Memory at 100000000 (64-bit, non-prefetchable) [size=64K]
         Region 2: Memory at 100010000 (64-bit, non-prefetchable) [size=8K]
         Region 4: [virtual] Memory at fffdfdc000000000 (32-bit, 
non-prefetchable)
         Region 5: [virtual] Memory at fffdfdc000000000 (32-bit, 
non-prefetchable)
         [virtual] Expansion ROM at fffdfdc000000000 [disabled]
         Capabilities: [40] Power Management version 3
                 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA 
PME(D0+,D1+,D2+,D3hot+,D3cold-)
                 Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
         Capabilities: [48] MSI: Enable- Count=1/8 Maskable- 64bit+
                 Address: 0000000000000000  Data: 0000
         Capabilities: [70] Express (v2) Endpoint, MSI 00
                 DevCap: MaxPayload 1024 bytes, PhantFunc 0, Latency L0s 
unlimited, L1 unlimited
                         ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
                 DevCtl: Report errors: Correctable- Non-Fatal- Fatal- 
Unsupported-
                         RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
                         MaxPayload 256 bytes, MaxReadReq 512 bytes
                 DevSta: CorrErr+ UncorrErr- FatalErr- UnsuppReq+ 
AuxPwr- TransPend-
                 LnkCap: Port #0, Speed 5GT/s, Width x1, ASPM L0s L1, 
Latency L0 <2us, L1 <64us
                         ClockPM+ Surprise- LLActRep- BwNot-
                 LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- 
CommClk-
                         ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                 LnkSta: Speed 5GT/s, Width x1, TrErr- Train- SlotClk+ 
DLActive- BWMgmt- ABWMgmt-
                 DevCap2: Completion Timeout: Not Supported, 
TimeoutDis+, LTR-, OBFF Not Supported
                 DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, 
LTR-, OBFF Disabled
                 LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- 
SpeedDis-
                          Transmit Margin: Normal Operating Range, 
EnterModifiedCompliance- ComplianceSOS-
                          Compliance De-emphasis: -6dB
                 LnkSta2: Current De-emphasis Level: -3.5dB, 
EqualizationComplete-, EqualizationPhase1-
                          EqualizationPhase2-, EqualizationPhase3-, 
LinkEqualizationRequest-
         Capabilities: [c0] MSI-X: Enable+ Count=8 Masked-
                 Vector table: BAR=2 offset=00000000
                 PBA: BAR=2 offset=00001000
         Capabilities: [100 v2] 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- 
NonFatalErr+
                 CEMsk:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- 
NonFatalErr+
                 AERCap: First Error Pointer: 00, GenCap+ CGenEn- 
ChkCap+ ChkEn-
         Capabilities: [150 v1] Device Serial Number 08-00-28-00-00-20-00-00
         Kernel driver in use: xhci_hcd

>>
>> Is this some known issue with these vendors controllers? Is there some documentation
>> about this, errata or anything?
>>
>> Adding Yoshihiro Shimoda, he might know about the Renesas controller.
> Thank you for adding me on this email.
> However, unfortunately I don't know the detail about Renesas PCIe xHCI controllers.
> (I know the xHCI controller of R-Car SoCs for now.)
>
> Best regards,
> Yoshihiro Shimoda
>

[toc] | [prev] | [next] | [standalone]


#1508011 — Re: [PATCH v2 RESEND] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers

FromMathias Nyman <mathias.nyman@intel.com>
Date2016-10-25 09:00 +0200
SubjectRe: [PATCH v2 RESEND] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers
Message-ID<sw3Si-239-5@gated-at.bofh.it>
In reply to#1507276
On 24.10.2016 17:52, Babu Moger wrote:
>
> On 10/24/2016 5:54 AM, Yoshihiro Shimoda wrote:
>> Hi,
>>
>>> From: Mathias Nyman
>>> Sent: Monday, October 24, 2016 6:58 PM
>>>
>>> On 22.10.2016 01:25, Babu Moger wrote:
>>>> Never seen XHCI auto handoff working on TI and RENESAS cards.
>>>> Eventually, we force handoff. This code forces the handoff
>>>> unconditionally. It saves 5 seconds boot time for each card.
>>>>
>>>> Signed-off-by: Babu Moger <babu.moger@oracle.com>
>>> Do the Renesas and TI controllers still advertise the extended capability
>>> for the handoff? (XHCI_EXT_CAPS_LEGACY)
> I don't see this capability.  Here is lspci output.
>

It's not a PCI capability, it's a xhci Extended Capability.

If the capability is supported, and handoff fail, then quirk_usb_handoff_xhci() will print
"xHCI BIOS handoff failed (BIOS bug ?)"

Further on in the same function we wait for the "controller not ready" bit in the status
register to clear. If that times it prints out:

"xHCI HW not ready after 5 sec (HC bug?) status"

Do you see any of these two messages in the log?

-Mathias

[toc] | [prev] | [next] | [standalone]


#1508289 — Re: [PATCH v2 RESEND] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers

FromBabu Moger <babu.moger@oracle.com>
Date2016-10-25 15:20 +0200
SubjectRe: [PATCH v2 RESEND] drivers/usb: Skip auto handoff for TI and RENESAS usb controllers
Message-ID<sw9O1-67F-27@gated-at.bofh.it>
In reply to#1508011
On 10/25/2016 1:51 AM, Mathias Nyman wrote:
> On 24.10.2016 17:52, Babu Moger wrote:
>>
>> On 10/24/2016 5:54 AM, Yoshihiro Shimoda wrote:
>>> Hi,
>>>
>>>> From: Mathias Nyman
>>>> Sent: Monday, October 24, 2016 6:58 PM
>>>>
>>>> On 22.10.2016 01:25, Babu Moger wrote:
>>>>> Never seen XHCI auto handoff working on TI and RENESAS cards.
>>>>> Eventually, we force handoff. This code forces the handoff
>>>>> unconditionally. It saves 5 seconds boot time for each card.
>>>>>
>>>>> Signed-off-by: Babu Moger <babu.moger@oracle.com>
>>>> Do the Renesas and TI controllers still advertise the extended 
>>>> capability
>>>> for the handoff? (XHCI_EXT_CAPS_LEGACY)
>> I don't see this capability.  Here is lspci output.
>>
>
> It's not a PCI capability, it's a xhci Extended Capability.
>
> If the capability is supported, and handoff fail, then 
> quirk_usb_handoff_xhci() will print
> "xHCI BIOS handoff failed (BIOS bug ?)"
>

   Yes. I see these messages. After this patch I don't see these messages.

> Further on in the same function we wait for the "controller not ready" 
> bit in the status
> register to clear. If that times it prints out:
>
> "xHCI HW not ready after 5 sec (HC bug?) status"

       No. I didn't see this messages.

>
> Do you see any of these two messages in the log?
>
> -Mathias

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web