diff mbox series

usb: xhci: Workaround for runpm issue on AMD xHC

Message ID 20230215075855.46204-1-acelan.kao@canonical.com (mailing list archive)
State New, archived
Headers show
Series usb: xhci: Workaround for runpm issue on AMD xHC | expand

Commit Message

Chia-Lin Kao (AceLan) Feb. 15, 2023, 7:58 a.m. UTC
From: "Chia-Lin Kao (AceLan)" <acelan.kao@canonical.com>

When the xHC host is runtime suspended, the device connects to it will be
disconnected while trying to use it.
The quirk in commit 2a632815683d ("usb: xhci: Workaround for S3 issue on
AMD SNPS 3.0 xHC") also works for this issue, so added its ID to the
quirk, too.

05:00.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Device [1022:1505] (prog-if 30 [XHCI])
        Subsystem: Dell Device [1028:0c3f]
        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 60
        IOMMU group: 21
        Region 0: Memory at c0000000 (64-bit, non-prefetchable) [size=1M]
        Capabilities: <access denied>
        Kernel driver in use: xhci_hcd
        Kernel modules: xhci_pci

[   20.769275] xhci_hcd 0000:05:00.0: xHCI host not responding to stop endpoint command
[   20.771429] xhci_hcd 0000:05:00.0: xHCI host controller not responding, assume dead
[   20.771444] xhci_hcd 0000:05:00.0: HC died; cleaning up
[   20.771733] usb 5-1: USB disconnect, device number 2

Cc: stable@vger.kernel.org #v4.19+
Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
---
 drivers/usb/host/xhci-pci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Mario Limonciello Feb. 20, 2023, 3:14 a.m. UTC | #1
+ a bunch of AMD guys

Please don't submit quirks for AMD systems without talking to AMD about 
if they make sense.

On 2/15/23 01:58, AceLan Kao wrote:
> From: "Chia-Lin Kao (AceLan)" <acelan.kao@canonical.com>
> 
> When the xHC host is runtime suspended, the device connects to it will be
> disconnected while trying to use it.
> The quirk in commit 2a632815683d ("usb: xhci: Workaround for S3 issue on
> AMD SNPS 3.0 xHC") also works for this issue, so added its ID to the
> quirk, too.
> 
> 05:00.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Device [1022:1505] (prog-if 30 [XHCI])
>          Subsystem: Dell Device [1028:0c3f]
>          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 60
>          IOMMU group: 21
>          Region 0: Memory at c0000000 (64-bit, non-prefetchable) [size=1M]
>          Capabilities: <access denied>
>          Kernel driver in use: xhci_hcd
>          Kernel modules: xhci_pci
> 
> [   20.769275] xhci_hcd 0000:05:00.0: xHCI host not responding to stop endpoint command
> [   20.771429] xhci_hcd 0000:05:00.0: xHCI host controller not responding, assume dead
> [   20.771444] xhci_hcd 0000:05:00.0: HC died; cleaning up
> [   20.771733] usb 5-1: USB disconnect, device number 2
> 
> Cc: stable@vger.kernel.org #v4.19+
> Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>

Is this system that you're finding this bug already launched?  This 
looks like a BIOS bug.

If it's not launched we should fix it from BIOS, reach out to AMD off 
list to talk about it.

> ---
>   drivers/usb/host/xhci-pci.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
> index fb988e4ea924..b8f6843a8cd1 100644
> --- a/drivers/usb/host/xhci-pci.c
> +++ b/drivers/usb/host/xhci-pci.c
> @@ -177,7 +177,9 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
>   	    (pdev->device == 0x15e0 || pdev->device == 0x15e1))
>   		xhci->quirks |= XHCI_SNPS_BROKEN_SUSPEND;
>   
> -	if (pdev->vendor == PCI_VENDOR_ID_AMD && pdev->device == 0x15e5) {
> +	if (pdev->vendor == PCI_VENDOR_ID_AMD &&
> +		(pdev->device == 0x15e5 ||
> +		 pdev->device == 0x1505)) {
>   		xhci->quirks |= XHCI_DISABLE_SPARSE;
>   		xhci->quirks |= XHCI_RESET_ON_RESUME;
>   	}
Chia-Lin Kao (AceLan) Feb. 20, 2023, 6:54 a.m. UTC | #2
Hi Mario,

Mario Limonciello <mario.limonciello@amd.com> 於 2023年2月20日 週一 上午11:14寫道:
>
> + a bunch of AMD guys
>
> Please don't submit quirks for AMD systems without talking to AMD about
> if they make sense.
Got it.

>
> On 2/15/23 01:58, AceLan Kao wrote:
> > From: "Chia-Lin Kao (AceLan)" <acelan.kao@canonical.com>
> >
> > When the xHC host is runtime suspended, the device connects to it will be
> > disconnected while trying to use it.
> > The quirk in commit 2a632815683d ("usb: xhci: Workaround for S3 issue on
> > AMD SNPS 3.0 xHC") also works for this issue, so added its ID to the
> > quirk, too.
> >
> > 05:00.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Device [1022:1505] (prog-if 30 [XHCI])
> >          Subsystem: Dell Device [1028:0c3f]
> >          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 60
> >          IOMMU group: 21
> >          Region 0: Memory at c0000000 (64-bit, non-prefetchable) [size=1M]
> >          Capabilities: <access denied>
> >          Kernel driver in use: xhci_hcd
> >          Kernel modules: xhci_pci
> >
> > [   20.769275] xhci_hcd 0000:05:00.0: xHCI host not responding to stop endpoint command
> > [   20.771429] xhci_hcd 0000:05:00.0: xHCI host controller not responding, assume dead
> > [   20.771444] xhci_hcd 0000:05:00.0: HC died; cleaning up
> > [   20.771733] usb 5-1: USB disconnect, device number 2
> >
> > Cc: stable@vger.kernel.org #v4.19+
> > Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
>
> Is this system that you're finding this bug already launched?  This
> looks like a BIOS bug.
>
> If it's not launched we should fix it from BIOS, reach out to AMD off
> list to talk about it.
This system is not launched yet, any hints about the BIOS issue?
I tried to disable D3Cold, but the symptom is the same.
The xHC enters D3Hot and then it can't be waken up.

>
> > ---
> >   drivers/usb/host/xhci-pci.c | 4 +++-
> >   1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
> > index fb988e4ea924..b8f6843a8cd1 100644
> > --- a/drivers/usb/host/xhci-pci.c
> > +++ b/drivers/usb/host/xhci-pci.c
> > @@ -177,7 +177,9 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
> >           (pdev->device == 0x15e0 || pdev->device == 0x15e1))
> >               xhci->quirks |= XHCI_SNPS_BROKEN_SUSPEND;
> >
> > -     if (pdev->vendor == PCI_VENDOR_ID_AMD && pdev->device == 0x15e5) {
> > +     if (pdev->vendor == PCI_VENDOR_ID_AMD &&
> > +             (pdev->device == 0x15e5 ||
> > +              pdev->device == 0x1505)) {
> >               xhci->quirks |= XHCI_DISABLE_SPARSE;
> >               xhci->quirks |= XHCI_RESET_ON_RESUME;
> >       }
>
Mario Limonciello Feb. 20, 2023, 3 p.m. UTC | #3
[AMD Official Use Only - General]



> -----Original Message-----
> From: AceLan Kao <acelan.kao@canonical.com>
> Sent: Monday, February 20, 2023 00:54
> To: Limonciello, Mario <Mario.Limonciello@amd.com>
> Cc: Mathias Nyman <mathias.nyman@intel.com>; Greg Kroah-Hartman
> <gregkh@linuxfoundation.org>; linux-usb@vger.kernel.org; linux-
> kernel@vger.kernel.org; S-k, Shyam-sundar <Shyam-sundar.S-
> k@amd.com>; Tsao, Anson <anson.tsao@amd.com>; Gong, Richard
> <Richard.Gong@amd.com>; Natikar, Basavaraj
> <Basavaraj.Natikar@amd.com>; Oakes, Gregory
> <Gregory.Oakes@amd.com>
> Subject: Re: [PATCH] usb: xhci: Workaround for runpm issue on AMD xHC
> 
> Hi Mario,
> 
> Mario Limonciello <mario.limonciello@amd.com> 於 2023年2月20日 週一
> 上午11:14寫道:
> >
> > + a bunch of AMD guys
> >
> > Please don't submit quirks for AMD systems without talking to AMD about
> > if they make sense.
> Got it.
> 
> >
> > On 2/15/23 01:58, AceLan Kao wrote:
> > > From: "Chia-Lin Kao (AceLan)" <acelan.kao@canonical.com>
> > >
> > > When the xHC host is runtime suspended, the device connects to it will
> be
> > > disconnected while trying to use it.
> > > The quirk in commit 2a632815683d ("usb: xhci: Workaround for S3 issue
> on
> > > AMD SNPS 3.0 xHC") also works for this issue, so added its ID to the
> > > quirk, too.
> > >
> > > 05:00.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Device
> [1022:1505] (prog-if 30 [XHCI])
> > >          Subsystem: Dell Device [1028:0c3f]
> > >          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 60
> > >          IOMMU group: 21
> > >          Region 0: Memory at c0000000 (64-bit, non-prefetchable) [size=1M]
> > >          Capabilities: <access denied>
> > >          Kernel driver in use: xhci_hcd
> > >          Kernel modules: xhci_pci
> > >
> > > [   20.769275] xhci_hcd 0000:05:00.0: xHCI host not responding to stop
> endpoint command
> > > [   20.771429] xhci_hcd 0000:05:00.0: xHCI host controller not responding,
> assume dead
> > > [   20.771444] xhci_hcd 0000:05:00.0: HC died; cleaning up
> > > [   20.771733] usb 5-1: USB disconnect, device number 2
> > >
> > > Cc: stable@vger.kernel.org #v4.19+
> > > Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
> >
> > Is this system that you're finding this bug already launched?  This
> > looks like a BIOS bug.
> >
> > If it's not launched we should fix it from BIOS, reach out to AMD off
> > list to talk about it.
> This system is not launched yet, any hints about the BIOS issue?
> I tried to disable D3Cold, but the symptom is the same.
> The xHC enters D3Hot and then it can't be waken up.

OK thanks for confirming.
It's not something that has a configuration knob in BIOS.
Raise a ticket with AMD and it can be discussed there.

> 
> >
> > > ---
> > >   drivers/usb/host/xhci-pci.c | 4 +++-
> > >   1 file changed, 3 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
> > > index fb988e4ea924..b8f6843a8cd1 100644
> > > --- a/drivers/usb/host/xhci-pci.c
> > > +++ b/drivers/usb/host/xhci-pci.c
> > > @@ -177,7 +177,9 @@ static void xhci_pci_quirks(struct device *dev,
> struct xhci_hcd *xhci)
> > >           (pdev->device == 0x15e0 || pdev->device == 0x15e1))
> > >               xhci->quirks |= XHCI_SNPS_BROKEN_SUSPEND;
> > >
> > > -     if (pdev->vendor == PCI_VENDOR_ID_AMD && pdev->device ==
> 0x15e5) {
> > > +     if (pdev->vendor == PCI_VENDOR_ID_AMD &&
> > > +             (pdev->device == 0x15e5 ||
> > > +              pdev->device == 0x1505)) {
> > >               xhci->quirks |= XHCI_DISABLE_SPARSE;
> > >               xhci->quirks |= XHCI_RESET_ON_RESUME;
> > >       }
> >
diff mbox series

Patch

diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index fb988e4ea924..b8f6843a8cd1 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -177,7 +177,9 @@  static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
 	    (pdev->device == 0x15e0 || pdev->device == 0x15e1))
 		xhci->quirks |= XHCI_SNPS_BROKEN_SUSPEND;
 
-	if (pdev->vendor == PCI_VENDOR_ID_AMD && pdev->device == 0x15e5) {
+	if (pdev->vendor == PCI_VENDOR_ID_AMD &&
+		(pdev->device == 0x15e5 ||
+		 pdev->device == 0x1505)) {
 		xhci->quirks |= XHCI_DISABLE_SPARSE;
 		xhci->quirks |= XHCI_RESET_ON_RESUME;
 	}