[SRU] [B/E/F/Unstable/OEM-B/OEM-OSP1-B] [PATCH 0/1] USB key cannot be detected by hotplug on Sunix USB Type-A 3.1 Gen 2 card [1b21:2142]

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU] [B/E/F/Unstable/OEM-B/OEM-OSP1-B] [PATCH 0/1] USB key cannot be detected by hotplug on Sunix USB Type-A 3.1 Gen 2 card [1b21:2142]

Kai-Heng Feng
BugLink: https://bugs.launchpad.net/bugs/1858988

[Impact]
Hotplug USB key to Sunix USB Type-A 3.1 Gen 2 card can't be detected

[Fix]
ASMedia XHCI USB controller PME# doesn't work under D0, so remove its
cap by quirk.

[Test]
Verified on the target machine, USB 3 storage works.

[Regression Potential]
Low, it only affects target chip.

Kai-Heng Feng (1):
  PCI: Avoid ASMedia XHCI USB PME# from D0 defect

 drivers/pci/quirks.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[B/OEM-B] [PATCH] UBUNTU: SAUCE: PCI: Avoid ASMedia XHCI USB PME# from D0 defect

Kai-Heng Feng
BugLink: https://bugs.launchpad.net/bugs/1858988

The ASMedia USB XHCI Controller claims to support generating PME# while
in D0:

01:00.0 USB controller: ASMedia Technology Inc. Device 2142 (prog-if 30 [XHCI])
        Subsystem: SUNIX Co., Ltd. Device 312b
        Capabilities: [78] Power Management version 3
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA PME(D0+,D1-,D2-,D3hot-,D3cold-)
                Status: D0 NoSoftRst+ PME-Enable+ DSel=0 DScale=0 PME-

However PME# only gets asserted when plugging USB 2.0 or USB 1.1
devices, but not for USB 3.0 devices.

So remove PCI_PM_CAP_PME_D0 to avoid using PME under D0.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=205919
Signed-off-by: Kai-Heng Feng <[hidden email]>
---
 drivers/pci/quirks.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 23d7fa167a36..d21e511333ef 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -4953,3 +4953,14 @@ DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
        PCI_BASE_CLASS_DISPLAY, 16, quirk_nvidia_hda);
 DECLARE_PCI_FIXUP_CLASS_RESUME_EARLY(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
        PCI_BASE_CLASS_DISPLAY, 16, quirk_nvidia_hda);
+
+/*
+ * Device [1b21:2142]
+ * When in D0, PME# doesn't get asserted when plugging USB 3.0 device.
+ */
+static void pci_fixup_no_d0_pme(struct pci_dev *dev)
+{
+ pci_info(dev, "PME# does not work under D0, disabling it\n");
+ dev->pme_support &= ~(PCI_PM_CAP_PME_D0 >> PCI_PM_CAP_PME_SHIFT);
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASMEDIA, 0x2142, pci_fixup_no_d0_pme);
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[E/F/Unstable/OEM-OSP1-B] [PATCH 1/1] UBUNTU: SAUCE: PCI: Avoid ASMedia XHCI USB PME# from D0 defect

Kai-Heng Feng
In reply to this post by Kai-Heng Feng
BugLink: https://bugs.launchpad.net/bugs/1858988

The ASMedia USB XHCI Controller claims to support generating PME# while
in D0:

01:00.0 USB controller: ASMedia Technology Inc. Device 2142 (prog-if 30 [XHCI])
        Subsystem: SUNIX Co., Ltd. Device 312b
        Capabilities: [78] Power Management version 3
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA PME(D0+,D1-,D2-,D3hot-,D3cold-)
                Status: D0 NoSoftRst+ PME-Enable+ DSel=0 DScale=0 PME-

However PME# only gets asserted when plugging USB 2.0 or USB 1.1
devices, but not for USB 3.0 devices.

So remove PCI_PM_CAP_PME_D0 to avoid using PME under D0.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=205919
Signed-off-by: Kai-Heng Feng <[hidden email]>
---
 drivers/pci/quirks.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index db180595592a..138be523f724 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -5469,3 +5469,14 @@ static void quirk_reset_lenovo_thinkpad_p50_nvgpu(struct pci_dev *pdev)
 DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_NVIDIA, 0x13b1,
       PCI_CLASS_DISPLAY_VGA, 8,
       quirk_reset_lenovo_thinkpad_p50_nvgpu);
+
+/*
+ * Device [1b21:2142]
+ * When in D0, PME# doesn't get asserted when plugging USB 3.0 device.
+ */
+static void pci_fixup_no_d0_pme(struct pci_dev *dev)
+{
+ pci_info(dev, "PME# does not work under D0, disabling it\n");
+ dev->pme_support &= ~(PCI_PM_CAP_PME_D0 >> PCI_PM_CAP_PME_SHIFT);
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASMEDIA, 0x2142, pci_fixup_no_d0_pme);
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

APPLIED [OEM-OSP1-B] Re: [SRU] [B/E/F/Unstable/OEM-B/OEM-OSP1-B] [PATCH 0/1] USB key cannot be detected by hotplug on Sunix USB Type-A 3.1 Gen 2 card [1b21:2142]

Timo Aaltonen-6
In reply to this post by Kai-Heng Feng
On 9.1.2020 11.46, Kai-Heng Feng wrote:

> BugLink: https://bugs.launchpad.net/bugs/1858988
>
> [Impact]
> Hotplug USB key to Sunix USB Type-A 3.1 Gen 2 card can't be detected
>
> [Fix]
> ASMedia XHCI USB controller PME# doesn't work under D0, so remove its
> cap by quirk.
>
> [Test]
> Verified on the target machine, USB 3 storage works.
>
> [Regression Potential]
> Low, it only affects target chip.
>
> Kai-Heng Feng (1):
>   PCI: Avoid ASMedia XHCI USB PME# from D0 defect
>
>  drivers/pci/quirks.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>

applied to osp1 oem-next, thanks

--
t

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK/Cmnt: [B] [PATCH] UBUNTU: SAUCE: PCI: Avoid ASMedia XHCI USB PME# from D0 defect

Stefan Bader-2
In reply to this post by Kai-Heng Feng
On 09.01.20 10:46, Kai-Heng Feng wrote:

> BugLink: https://bugs.launchpad.net/bugs/1858988
>
> The ASMedia USB XHCI Controller claims to support generating PME# while
> in D0:
>
> 01:00.0 USB controller: ASMedia Technology Inc. Device 2142 (prog-if 30 [XHCI])
>         Subsystem: SUNIX Co., Ltd. Device 312b
>         Capabilities: [78] Power Management version 3
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA PME(D0+,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 NoSoftRst+ PME-Enable+ DSel=0 DScale=0 PME-
>
> However PME# only gets asserted when plugging USB 2.0 or USB 1.1
> devices, but not for USB 3.0 devices.
>
> So remove PCI_PM_CAP_PME_D0 to avoid using PME under D0.
>
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=205919
> Signed-off-by: Kai-Heng Feng <[hidden email]>
Acked-by: Stefan Bader <[hidden email]>
> ---

Looks simple enough. So ok, for Bionic. I am ignoring the request for OEM-B, and
E/F on purpose because your bug report does not contain any tasks for those.

-Stefan

>  drivers/pci/quirks.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index 23d7fa167a36..d21e511333ef 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -4953,3 +4953,14 @@ DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
>         PCI_BASE_CLASS_DISPLAY, 16, quirk_nvidia_hda);
>  DECLARE_PCI_FIXUP_CLASS_RESUME_EARLY(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
>         PCI_BASE_CLASS_DISPLAY, 16, quirk_nvidia_hda);
> +
> +/*
> + * Device [1b21:2142]
> + * When in D0, PME# doesn't get asserted when plugging USB 3.0 device.
> + */
> +static void pci_fixup_no_d0_pme(struct pci_dev *dev)
> +{
> + pci_info(dev, "PME# does not work under D0, disabling it\n");
> + dev->pme_support &= ~(PCI_PM_CAP_PME_D0 >> PCI_PM_CAP_PME_SHIFT);
> +}
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASMEDIA, 0x2142, pci_fixup_no_d0_pme);
>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

ACK: [B/OEM-B] [PATCH] UBUNTU: SAUCE: PCI: Avoid ASMedia XHCI USB PME# from D0 defect

Connor Kuehl
In reply to this post by Kai-Heng Feng
On 1/9/20 1:46 AM, Kai-Heng Feng wrote:

> BugLink: https://bugs.launchpad.net/bugs/1858988
>
> The ASMedia USB XHCI Controller claims to support generating PME# while
> in D0:
>
> 01:00.0 USB controller: ASMedia Technology Inc. Device 2142 (prog-if 30 [XHCI])
>          Subsystem: SUNIX Co., Ltd. Device 312b
>          Capabilities: [78] Power Management version 3
>                  Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA PME(D0+,D1-,D2-,D3hot-,D3cold-)
>                  Status: D0 NoSoftRst+ PME-Enable+ DSel=0 DScale=0 PME-
>
> However PME# only gets asserted when plugging USB 2.0 or USB 1.1
> devices, but not for USB 3.0 devices.
>
> So remove PCI_PM_CAP_PME_D0 to avoid using PME under D0.
>
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=205919
> Signed-off-by: Kai-Heng Feng <[hidden email]>
> ---
>   drivers/pci/quirks.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)
>
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index 23d7fa167a36..d21e511333ef 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -4953,3 +4953,14 @@ DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
>         PCI_BASE_CLASS_DISPLAY, 16, quirk_nvidia_hda);
>   DECLARE_PCI_FIXUP_CLASS_RESUME_EARLY(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
>         PCI_BASE_CLASS_DISPLAY, 16, quirk_nvidia_hda);
> +
> +/*
> + * Device [1b21:2142]
> + * When in D0, PME# doesn't get asserted when plugging USB 3.0 device.
> + */
> +static void pci_fixup_no_d0_pme(struct pci_dev *dev)
> +{
> + pci_info(dev, "PME# does not work under D0, disabling it\n");
> + dev->pme_support &= ~(PCI_PM_CAP_PME_D0 >> PCI_PM_CAP_PME_SHIFT);
> +}
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASMEDIA, 0x2142, pci_fixup_no_d0_pme);
>

Acked-by: Connor Kuehl <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

APPPLIED[F/Unstable]: [SRU] [B/E/F/Unstable/OEM-B/OEM-OSP1-B] [PATCH 0/1] USB key cannot be detected by hotplug on Sunix USB Type-A 3.1 Gen 2 card [1b21:2142]

Seth Forshee
In reply to this post by Kai-Heng Feng
On Thu, Jan 09, 2020 at 05:46:13PM +0800, Kai-Heng Feng wrote:

> BugLink: https://bugs.launchpad.net/bugs/1858988
>
> [Impact]
> Hotplug USB key to Sunix USB Type-A 3.1 Gen 2 card can't be detected
>
> [Fix]
> ASMedia XHCI USB controller PME# doesn't work under D0, so remove its
> cap by quirk.
>
> [Test]
> Verified on the target machine, USB 3 storage works.
>
> [Regression Potential]
> Low, it only affects target chip.

Applied to focal/master-next and unstable/master, thanks!

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

APPLIED(B)/cmt: [B/OEM-B] [PATCH] UBUNTU: SAUCE: PCI: Avoid ASMedia XHCI USB PME# from D0 defect

Khaled Elmously
In reply to this post by Kai-Heng Feng
Applied to Bionic. I did not apply to the other series since the ACKs appear to be specific to Bionic.

As a side note, I really don't see how this patch fixes a bug by just defining a new function.  I'm just curious ...



On 2020-01-09 17:46:14 , Kai-Heng Feng wrote:

> BugLink: https://bugs.launchpad.net/bugs/1858988
>
> The ASMedia USB XHCI Controller claims to support generating PME# while
> in D0:
>
> 01:00.0 USB controller: ASMedia Technology Inc. Device 2142 (prog-if 30 [XHCI])
>         Subsystem: SUNIX Co., Ltd. Device 312b
>         Capabilities: [78] Power Management version 3
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA PME(D0+,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 NoSoftRst+ PME-Enable+ DSel=0 DScale=0 PME-
>
> However PME# only gets asserted when plugging USB 2.0 or USB 1.1
> devices, but not for USB 3.0 devices.
>
> So remove PCI_PM_CAP_PME_D0 to avoid using PME under D0.
>
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=205919
> Signed-off-by: Kai-Heng Feng <[hidden email]>
> ---
>  drivers/pci/quirks.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index 23d7fa167a36..d21e511333ef 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -4953,3 +4953,14 @@ DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
>         PCI_BASE_CLASS_DISPLAY, 16, quirk_nvidia_hda);
>  DECLARE_PCI_FIXUP_CLASS_RESUME_EARLY(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
>         PCI_BASE_CLASS_DISPLAY, 16, quirk_nvidia_hda);
> +
> +/*
> + * Device [1b21:2142]
> + * When in D0, PME# doesn't get asserted when plugging USB 3.0 device.
> + */
> +static void pci_fixup_no_d0_pme(struct pci_dev *dev)
> +{
> + pci_info(dev, "PME# does not work under D0, disabling it\n");
> + dev->pme_support &= ~(PCI_PM_CAP_PME_D0 >> PCI_PM_CAP_PME_SHIFT);
> +}
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASMEDIA, 0x2142, pci_fixup_no_d0_pme);
> --
> 2.17.1
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: [E/F/Unstable/OEM-OSP1-B] [PATCH 1/1] UBUNTU: SAUCE: PCI: Avoid ASMedia XHCI USB PME# from D0 defect

Kleber Souza
In reply to this post by Kai-Heng Feng
On 09.01.20 10:46, Kai-Heng Feng wrote:

> BugLink: https://bugs.launchpad.net/bugs/1858988
>
> The ASMedia USB XHCI Controller claims to support generating PME# while
> in D0:
>
> 01:00.0 USB controller: ASMedia Technology Inc. Device 2142 (prog-if 30 [XHCI])
>         Subsystem: SUNIX Co., Ltd. Device 312b
>         Capabilities: [78] Power Management version 3
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA PME(D0+,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 NoSoftRst+ PME-Enable+ DSel=0 DScale=0 PME-
>
> However PME# only gets asserted when plugging USB 2.0 or USB 1.1
> devices, but not for USB 3.0 devices.
>
> So remove PCI_PM_CAP_PME_D0 to avoid using PME under D0.
>
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=205919
> Signed-off-by: Kai-Heng Feng <[hidden email]>

Hi Kai-Heng,

Please note that this patch hasn't been applied to eoan/linux as per
Stefan's and Khalid's comments. Please clarify if you really need this
patch on eoan/linux and if so please adjust the bug nomination
accordingly.


Thanks,
Kleber


> ---
>  drivers/pci/quirks.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index db180595592a..138be523f724 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -5469,3 +5469,14 @@ static void quirk_reset_lenovo_thinkpad_p50_nvgpu(struct pci_dev *pdev)
>  DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_NVIDIA, 0x13b1,
>        PCI_CLASS_DISPLAY_VGA, 8,
>        quirk_reset_lenovo_thinkpad_p50_nvgpu);
> +
> +/*
> + * Device [1b21:2142]
> + * When in D0, PME# doesn't get asserted when plugging USB 3.0 device.
> + */
> +static void pci_fixup_no_d0_pme(struct pci_dev *dev)
> +{
> + pci_info(dev, "PME# does not work under D0, disabling it\n");
> + dev->pme_support &= ~(PCI_PM_CAP_PME_D0 >> PCI_PM_CAP_PME_SHIFT);
> +}
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASMEDIA, 0x2142, pci_fixup_no_d0_pme);
>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Re: [E/F/Unstable/OEM-OSP1-B] [PATCH 1/1] UBUNTU: SAUCE: PCI: Avoid ASMedia XHCI USB PME# from D0 defect

Kai-Heng Feng


> On Feb 14, 2020, at 19:43, Kleber Souza <[hidden email]> wrote:
>
> On 09.01.20 10:46, Kai-Heng Feng wrote:
>> BugLink: https://bugs.launchpad.net/bugs/1858988
>>
>> The ASMedia USB XHCI Controller claims to support generating PME# while
>> in D0:
>>
>> 01:00.0 USB controller: ASMedia Technology Inc. Device 2142 (prog-if 30 [XHCI])
>>        Subsystem: SUNIX Co., Ltd. Device 312b
>>        Capabilities: [78] Power Management version 3
>>                Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA PME(D0+,D1-,D2-,D3hot-,D3cold-)
>>                Status: D0 NoSoftRst+ PME-Enable+ DSel=0 DScale=0 PME-
>>
>> However PME# only gets asserted when plugging USB 2.0 or USB 1.1
>> devices, but not for USB 3.0 devices.
>>
>> So remove PCI_PM_CAP_PME_D0 to avoid using PME under D0.
>>
>> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=205919
>> Signed-off-by: Kai-Heng Feng <[hidden email]>
>
> Hi Kai-Heng,
>
> Please note that this patch hasn't been applied to eoan/linux as per
> Stefan's and Khalid's comments. Please clarify if you really need this
> patch on eoan/linux and if so please adjust the bug nomination
> accordingly.

Yes, E/F are also targeted.
Bug nomination updated.

Thanks!

Kai-Heng

>
>
> Thanks,
> Kleber
>
>
>> ---
>> drivers/pci/quirks.c | 11 +++++++++++
>> 1 file changed, 11 insertions(+)
>>
>> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
>> index db180595592a..138be523f724 100644
>> --- a/drivers/pci/quirks.c
>> +++ b/drivers/pci/quirks.c
>> @@ -5469,3 +5469,14 @@ static void quirk_reset_lenovo_thinkpad_p50_nvgpu(struct pci_dev *pdev)
>> DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_NVIDIA, 0x13b1,
>>      PCI_CLASS_DISPLAY_VGA, 8,
>>      quirk_reset_lenovo_thinkpad_p50_nvgpu);
>> +
>> +/*
>> + * Device [1b21:2142]
>> + * When in D0, PME# doesn't get asserted when plugging USB 3.0 device.
>> + */
>> +static void pci_fixup_no_d0_pme(struct pci_dev *dev)
>> +{
>> + pci_info(dev, "PME# does not work under D0, disabling it\n");
>> + dev->pme_support &= ~(PCI_PM_CAP_PME_D0 >> PCI_PM_CAP_PME_SHIFT);
>> +}
>> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASMEDIA, 0x2142, pci_fixup_no_d0_pme);
>>
>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

APPLIED[E]/cmnt: [E/F/Unstable/OEM-OSP1-B] [PATCH 1/1] UBUNTU: SAUCE: PCI: Avoid ASMedia XHCI USB PME# from D0 defect

Kleber Souza
In reply to this post by Kai-Heng Feng
On 09.01.20 10:46, Kai-Heng Feng wrote:

> BugLink: https://bugs.launchpad.net/bugs/1858988
>
> The ASMedia USB XHCI Controller claims to support generating PME# while
> in D0:
>
> 01:00.0 USB controller: ASMedia Technology Inc. Device 2142 (prog-if 30 [XHCI])
>         Subsystem: SUNIX Co., Ltd. Device 312b
>         Capabilities: [78] Power Management version 3
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA PME(D0+,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 NoSoftRst+ PME-Enable+ DSel=0 DScale=0 PME-
>
> However PME# only gets asserted when plugging USB 2.0 or USB 1.1
> devices, but not for USB 3.0 devices.
>
> So remove PCI_PM_CAP_PME_D0 to avoid using PME under D0.
>
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=205919
> Signed-off-by: Kai-Heng Feng <[hidden email]>
> ---
>  drivers/pci/quirks.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index db180595592a..138be523f724 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -5469,3 +5469,14 @@ static void quirk_reset_lenovo_thinkpad_p50_nvgpu(struct pci_dev *pdev)
>  DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_NVIDIA, 0x13b1,
>        PCI_CLASS_DISPLAY_VGA, 8,
>        quirk_reset_lenovo_thinkpad_p50_nvgpu);
> +
> +/*
> + * Device [1b21:2142]
> + * When in D0, PME# doesn't get asserted when plugging USB 3.0 device.
> + */
> +static void pci_fixup_no_d0_pme(struct pci_dev *dev)
> +{
> + pci_info(dev, "PME# does not work under D0, disabling it\n");
> + dev->pme_support &= ~(PCI_PM_CAP_PME_D0 >> PCI_PM_CAP_PME_SHIFT);
> +}
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASMEDIA, 0x2142, pci_fixup_no_d0_pme);
>

Applied to eoan/linux, with the ACK's from the Bionic patch.

Thanks,
Kleber

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team