linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: Avoid ASMedia XHCI USB PME# from D0 defect
@ 2019-12-19 19:20 Kai-Heng Feng
  2020-02-04 17:08 ` Kai-Heng Feng
  2020-03-19 21:49 ` Bjorn Helgaas
  0 siblings, 2 replies; 4+ messages in thread
From: Kai-Heng Feng @ 2019-12-19 19:20 UTC (permalink / raw)
  To: bhelgaas; +Cc: linux-pci, linux-kernel, Kai-Heng Feng

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 <kai.heng.feng@canonical.com>
---
 drivers/pci/quirks.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 79379b4c9d7a..24c71555dc77 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -5436,3 +5436,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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] PCI: Avoid ASMedia XHCI USB PME# from D0 defect
  2019-12-19 19:20 [PATCH] PCI: Avoid ASMedia XHCI USB PME# from D0 defect Kai-Heng Feng
@ 2020-02-04 17:08 ` Kai-Heng Feng
  2020-03-11  6:55   ` Kai-Heng Feng
  2020-03-19 21:49 ` Bjorn Helgaas
  1 sibling, 1 reply; 4+ messages in thread
From: Kai-Heng Feng @ 2020-02-04 17:08 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci, linux-kernel

Hi Bjorn,

> On Dec 20, 2019, at 03:20, Kai-Heng Feng <kai.heng.feng@canonical.com> wrote:
> 
> 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 <kai.heng.feng@canonical.com>

Would it be possible to merge this patch? Thanks.

Kai-Heng

> ---
> drivers/pci/quirks.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index 79379b4c9d7a..24c71555dc77 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -5436,3 +5436,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
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] PCI: Avoid ASMedia XHCI USB PME# from D0 defect
  2020-02-04 17:08 ` Kai-Heng Feng
@ 2020-03-11  6:55   ` Kai-Heng Feng
  0 siblings, 0 replies; 4+ messages in thread
From: Kai-Heng Feng @ 2020-03-11  6:55 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci, linux-kernel



> On Feb 5, 2020, at 01:08, Kai-Heng Feng <kai.heng.feng@canonical.com> wrote:
> 
> Hi Bjorn,
> 
>> On Dec 20, 2019, at 03:20, Kai-Heng Feng <kai.heng.feng@canonical.com> wrote:
>> 
>> 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 <kai.heng.feng@canonical.com>
> 
> Would it be possible to merge this patch? Thanks.

Another gentle ping...

> 
> Kai-Heng
> 
>> ---
>> drivers/pci/quirks.c | 11 +++++++++++
>> 1 file changed, 11 insertions(+)
>> 
>> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
>> index 79379b4c9d7a..24c71555dc77 100644
>> --- a/drivers/pci/quirks.c
>> +++ b/drivers/pci/quirks.c
>> @@ -5436,3 +5436,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
>> 
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] PCI: Avoid ASMedia XHCI USB PME# from D0 defect
  2019-12-19 19:20 [PATCH] PCI: Avoid ASMedia XHCI USB PME# from D0 defect Kai-Heng Feng
  2020-02-04 17:08 ` Kai-Heng Feng
@ 2020-03-19 21:49 ` Bjorn Helgaas
  1 sibling, 0 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2020-03-19 21:49 UTC (permalink / raw)
  To: Kai-Heng Feng; +Cc: linux-pci, linux-kernel

On Fri, Dec 20, 2019 at 03:20:06AM +0800, Kai-Heng Feng wrote:
> 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 <kai.heng.feng@canonical.com>

Applied to pci/misc for v5.7, thanks!

> ---
>  drivers/pci/quirks.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index 79379b4c9d7a..24c71555dc77 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -5436,3 +5436,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
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-03-19 21:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-19 19:20 [PATCH] PCI: Avoid ASMedia XHCI USB PME# from D0 defect Kai-Heng Feng
2020-02-04 17:08 ` Kai-Heng Feng
2020-03-11  6:55   ` Kai-Heng Feng
2020-03-19 21:49 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).