[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a46b93b6-b5ea-46d1-95df-de0333a24124@rock-chips.com>
Date: Fri, 7 Nov 2025 14:16:02 +0800
From: Shawn Lin <shawn.lin@...k-chips.com>
To: Manivannan Sadhasivam <mani@...nel.org>
Cc: shawn.lin@...k-chips.com, Bjorn Helgaas <helgaas@...nel.org>,
linux-pci@...r.kernel.org, Christian Zigotzky <chzigotzky@...osoft.de>,
mad skateman <madskateman@...il.com>, "R . T . Dickinson" <rtd2@...a.co.nz>,
Darren Stevens <darren@...vens-zone.net>,
John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>,
Lukas Wunner <lukas@...ner.de>, luigi burdo <intermediadc@...mail.com>,
Al <al@...azap.net>, Roland <rol7and@....com>,
Hongxing Zhu <hongxing.zhu@....com>, hypexed@...oo.com.au,
linuxppc-dev@...ts.ozlabs.org, debian-powerpc@...ts.debian.org,
linux-kernel@...r.kernel.org, Bjorn Helgaas <bhelgaas@...gle.com>
Subject: Re: [PATCH 1/2] PCI/ASPM: Cache Link Capabilities so quirks can
override them
在 2025/11/07 星期五 14:03, Manivannan Sadhasivam 写道:
> On Fri, Nov 07, 2025 at 09:17:09AM +0800, Shawn Lin wrote:
>> 在 2025/11/07 星期五 2:36, Bjorn Helgaas 写道:
>>> From: Bjorn Helgaas <bhelgaas@...gle.com>
>>>
>>> Cache the PCIe Link Capabilities register in struct pci_dev so quirks can
>>> remove features to avoid hardware defects. The idea is:
>>>
>>> - set_pcie_port_type() reads PCIe Link Capabilities and caches it in
>>> dev->lnkcap
>>>
>>> - HEADER quirks can update the cached dev->lnkcap to remove advertised
>>> features that don't work correctly
>>>
>>> - pcie_aspm_cap_init() relies on dev->lnkcap and ignores any features not
>>> advertised there
>>>
>>
>> Quick test with a NVMe shows it works.
>>
>> Before this patch, lspci -vvv dumps:
>>
>> LnkCap: Port #0, Speed 16GT/s, Width x4, ASPM L1, Exit Latency L1 <64us
>> ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp+
>> LnkCtl: ASPM L1 Enabled; RCB 64 bytes, LnkDisable- CommClk+
>>
>>
>> Capabilities: [21c v1] L1 PM Substates
>> L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+
>> L1_PM_Substates+
>> PortCommonModeRestoreTime=10us PortTPowerOnTime=10us
>> L1SubCtl1: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+
>> T_CommonMode=0us LTR1.2_Threshold=26016ns
>>
>> After this patch + a local quirk patch like your patch 2, it shows:
>>
>> LnkCap: Port #0, Speed 16GT/s, Width x4, ASPM L1, Exit Latency L1 <64us
>> ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp+
>> LnkCtl: ASPM Disabled; RCB 64 bytes, LnkDisable- CommClk-
>>
>> Capabilities: [21c v1] L1 PM Substates
>> L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+
>> L1_PM_Substates+
>> PortCommonModeRestoreTime=10us PortTPowerOnTime=10us
>> L1SubCtl1: PCI-PM_L1.2- PCI-PM_L1.1- ASPM_L1.2- ASPM_L1.1-
>> T_CommonMode=0us LTR1.2_Threshold=0ns
>>
>>
>>
>> One things I noticed is CommClk in LnkCtl is changed.
>
> That's not because of this series, but because of your quirk that disables L0s
> and L1. Common Clock Configuration happens only when ASPM is enabled, if it is
> disabled, PCI core will not configure it (the value remains untouched). That's
> why it was enabled before your quirk and disabled afterwards.
>
Thanks for the detailed explanation, I have no more questions now.
> This bit is also only used to report the L0s and L1 Exit latencies by the
> devices.
>
> - Mani
>
Powered by blists - more mailing lists