Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH] PCI: Add ASPM quirk for Hi1105 PCIe Wi-Fi
@ 2025-11-06  3:51 Shawn Lin
  2025-11-06 19:50 ` Bjorn Helgaas
  0 siblings, 1 reply; 3+ messages in thread
From: Shawn Lin @ 2025-11-06  3:51 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Bjorn Helgaas; +Cc: linux-rockchip, linux-pci, Shawn Lin

This Wi-Fi advertises the L0s and L1 capabilities but actually
it doesn't support them. This's comfirmed by Hisilicon team in
actual productization.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
---

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

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 214ed06..67250d4 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2526,6 +2526,12 @@ static void quirk_disable_aspm_l0s_l1(struct pci_dev *dev)
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASMEDIA, 0x1080, quirk_disable_aspm_l0s_l1);
 
 /*
+ * The Hi1105 PCIe Wi-Fi doesn't support L0s and L1 but advertise the capability.
+ * Disable both L0s and L1 for now.
+ */
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_HUAWEI, 0x1105, quirk_disable_aspm_l0s_l1);
+
+/*
  * Some Pericom PCIe-to-PCI bridges in reverse mode need the PCIe Retrain
  * Link bit cleared after starting the link retrain process to allow this
  * process to finish.
-- 
2.7.4


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

* Re: [PATCH] PCI: Add ASPM quirk for Hi1105 PCIe Wi-Fi
  2025-11-06  3:51 [PATCH] PCI: Add ASPM quirk for Hi1105 PCIe Wi-Fi Shawn Lin
@ 2025-11-06 19:50 ` Bjorn Helgaas
  2025-11-07  0:34   ` Shawn Lin
  0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Helgaas @ 2025-11-06 19:50 UTC (permalink / raw)
  To: Shawn Lin; +Cc: Manivannan Sadhasivam, Bjorn Helgaas, linux-rockchip, linux-pci

On Thu, Nov 06, 2025 at 11:51:59AM +0800, Shawn Lin wrote:
> This Wi-Fi advertises the L0s and L1 capabilities but actually
> it doesn't support them. This's comfirmed by Hisilicon team in
> actual productization.
> 
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
> ---
> 
>  drivers/pci/quirks.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index 214ed06..67250d4 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -2526,6 +2526,12 @@ static void quirk_disable_aspm_l0s_l1(struct pci_dev *dev)
>  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASMEDIA, 0x1080, quirk_disable_aspm_l0s_l1);
>  
>  /*
> + * The Hi1105 PCIe Wi-Fi doesn't support L0s and L1 but advertise the capability.
> + * Disable both L0s and L1 for now.
> + */
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_HUAWEI, 0x1105, quirk_disable_aspm_l0s_l1);

PCI_VENDOR_ID_HUAWEI is 0x19e5.  Is there an upstream driver that
matches [19e5:1105]?  I didn't find anything.

I think quirk_disable_aspm_l0s_l1() might be a problem because the new
strategy is to enable ASPM early (in pcie_aspm_init_link_state(),
called from pci_scan_slot(), which happens before FINAL fixups are run
during pci_bus_add_device().

So I think we will enable L0s and L1 briefly before
quirk_disable_aspm_l0s_l1() runs, and it's possible we'd see a problem
then.

But if you apply this series:
  https://lore.kernel.org/r/20251106183643.1963801-1-helgaas@kernel.org

and then the patch below on top, I think we should avoid enabling L0s
and L1 at all:

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 44e780718953..24c278857159 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2536,6 +2536,7 @@ static void quirk_disable_aspm_l0s_l1_cap(struct pci_dev *dev)
 	pci_info(dev, "ASPM: L0s L1 removed from Link Capabilities to work around device defect\n");
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_FREESCALE, 0x0451, quirk_disable_aspm_l0s_l1_cap);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_HUAWEI, 0x1105, quirk_disable_aspm_l0s_l1_cap);
 
 /*
  * Some Pericom PCIe-to-PCI bridges in reverse mode need the PCIe Retrain

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

* Re: [PATCH] PCI: Add ASPM quirk for Hi1105 PCIe Wi-Fi
  2025-11-06 19:50 ` Bjorn Helgaas
@ 2025-11-07  0:34   ` Shawn Lin
  0 siblings, 0 replies; 3+ messages in thread
From: Shawn Lin @ 2025-11-07  0:34 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: shawn.lin, Manivannan Sadhasivam, Bjorn Helgaas, linux-rockchip,
	linux-pci

在 2025/11/07 星期五 3:50, Bjorn Helgaas 写道:
> On Thu, Nov 06, 2025 at 11:51:59AM +0800, Shawn Lin wrote:
>> This Wi-Fi advertises the L0s and L1 capabilities but actually
>> it doesn't support them. This's comfirmed by Hisilicon team in
>> actual productization.
>>
>> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
>> ---
>>
>>   drivers/pci/quirks.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
>> index 214ed06..67250d4 100644
>> --- a/drivers/pci/quirks.c
>> +++ b/drivers/pci/quirks.c
>> @@ -2526,6 +2526,12 @@ static void quirk_disable_aspm_l0s_l1(struct pci_dev *dev)
>>   DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ASMEDIA, 0x1080, quirk_disable_aspm_l0s_l1);
>>   
>>   /*
>> + * The Hi1105 PCIe Wi-Fi doesn't support L0s and L1 but advertise the capability.
>> + * Disable both L0s and L1 for now.
>> + */
>> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_HUAWEI, 0x1105, quirk_disable_aspm_l0s_l1);
> 
> PCI_VENDOR_ID_HUAWEI is 0x19e5.  Is there an upstream driver that
> matches [19e5:1105]?  I didn't find anything.

Yes, like plenty of other wireless drivers, Hi1105 driver is also out of
tree.

> 
> I think quirk_disable_aspm_l0s_l1() might be a problem because the new
> strategy is to enable ASPM early (in pcie_aspm_init_link_state(),
> called from pci_scan_slot(), which happens before FINAL fixups are run
> during pci_bus_add_device().
> 

Oh, I missed this.

> So I think we will enable L0s and L1 briefly before
> quirk_disable_aspm_l0s_l1() runs, and it's possible we'd see a problem
> then.
> 
> But if you apply this series:
>    https://lore.kernel.org/r/20251106183643.1963801-1-helgaas@kernel.org
> 
> and then the patch below on top, I think we should avoid enabling L0s
> and L1 at all:
> 

The patch below looks good to me. I will fix it.
Thanks.

> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index 44e780718953..24c278857159 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -2536,6 +2536,7 @@ static void quirk_disable_aspm_l0s_l1_cap(struct pci_dev *dev)
>   	pci_info(dev, "ASPM: L0s L1 removed from Link Capabilities to work around device defect\n");
>   }
>   DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_FREESCALE, 0x0451, quirk_disable_aspm_l0s_l1_cap);
> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_HUAWEI, 0x1105, quirk_disable_aspm_l0s_l1_cap);
>   
>   /*
>    * Some Pericom PCIe-to-PCI bridges in reverse mode need the PCIe Retrain
> 


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

end of thread, other threads:[~2025-11-07  0:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-06  3:51 [PATCH] PCI: Add ASPM quirk for Hi1105 PCIe Wi-Fi Shawn Lin
2025-11-06 19:50 ` Bjorn Helgaas
2025-11-07  0:34   ` Shawn Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox