Re: [PATCH] PCI: qcom: Skip ASPM enablement walk on resume
From: Konrad Dybcio
Date: Thu Nov 26 2026 - 08:07:36 EST
On 11/26/26 6:44 AM, Krishna Chaitanya Chundru wrote:
> qcom_pcie_host_post_init_2_7_0() walks the bus and calls
> pci_set_power_state(D0) and pci_enable_link_state() on every downstream
> device. It runs from pp->ops->post_init(), which dw_pcie_resume_noirq()
> invokes on the resume path in addition to the initial host init.
>
> On resume, the PCI core has not yet restored the downstream devices
> saved config space, so the config accesses performed by the walk fail.
> With a PCIe switch in the topology this is easily hit, producing errors
> such as:
>
> pcieport 0000:02:01.0: Unable to change power state from D3hot to D0, device inaccessible
> ath12k_wifi7_pci 0000:03:00.0: Unable to change power state from D3hot to D0, device inaccessible
> pcieport 0000:02:02.0: Unable to change power state from D3hot to D0, device inaccessible
> pci 0000:05:00.0: Unable to change power state from unknown to D0, device inaccessible
>
> The walk is also redundant on resume: the ASPM link state is restored by
> the PCI core as part of the config space save/restore. Skip the walk when
> the controller is resuming, which is the case while pci->suspended is
> still set at post_init() time.
>
> Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@xxxxxxxxxxxxxxxx>
> ---
> drivers/pci/controller/dwc/pcie-qcom.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
> index a6a0e3ecd921..bd1ffbf5c21a 100644
> --- a/drivers/pci/controller/dwc/pcie-qcom.c
> +++ b/drivers/pci/controller/dwc/pcie-qcom.c
> @@ -1174,6 +1174,9 @@ static void qcom_pcie_host_post_init_2_7_0(struct qcom_pcie *pcie)
> {
> struct dw_pcie_rp *pp = &pcie->pci->pp;
>
> + if (pcie->pci->suspended)
> + return;
Is this going to regress hotplugged devices?
Or do we need this bus walk anyway now that we have
eacf92a29af9 ("PCI/ASPM: Mask ASPM states based on Devicetree properties")
?
Konrad