Linux PCI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Michal Gorlas" <michal.gorlas@9elements.com>
Cc: imx@lists.linux.dev, Frank.Li@kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH] PCI: imx6: enable ASPM L1 only iff CLKREQ# is supported
Date: Sun, 19 Jul 2026 00:57:45 +0000	[thread overview]
Message-ID: <20260719005746.31C271F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <20260719-l1-conditional-imx-v1-1-a55a57915c68@9elements.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Missing state restoration on resume: The patch disables ASPM L1 capability during probe for platforms lacking CLKREQ#, but fails to re-apply this hardware configuration during resume for platforms with the `IMX_PCIE_FLAG_BROKEN_SUSPEND` flag (e.g., IMX6Q).
--

--- Patch [1]: [PATCH] PCI: imx6: enable ASPM L1 only iff CLKREQ# is supported ---
commit 35b1dac6afa595d56fd03bd1c31c2ca679682abe
Author: Michal Gorlas <michal.gorlas@9elements.com>

PCI: imx6: enable ASPM L1 only iff CLKREQ# is supported

Since commit f3ac2ff14834 ("PCI/ASPM: Enable all ClockPM and ASPM
states for devicetree platforms"), ASPM states are force enabled
on all devicetree platforms. This causes PCI devices on some iMX SoCs
to enter L1 even though CLKREQ# is not supported, causing devices to
never wake up. This patch disables the L1 capability in the LINKCAP
register if supports-clkreq is not set in the DT explicitly.

> diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
> index 98e1db751132a..7471501fbf043 100644
> --- a/drivers/pci/controller/dwc/pci-imx6.c
> +++ b/drivers/pci/controller/dwc/pci-imx6.c
[ ... ]
> @@ -1442,6 +1458,9 @@ static int imx_pcie_host_init(struct dw_pcie_rp *pp)
>  
>  	imx_setup_phy_mpll(imx_pcie);
>  
> +	if (!imx_pcie->supports_clkreq)
> +		imx_pcie_disable_l1(pci);
> +

[Severity: High]
For platforms with the IMX_PCIE_FLAG_BROKEN_SUSPEND flag (such as IMX6Q),
imx_pcie_resume_noirq() bypasses dw_pcie_resume_noirq() (which normally calls
imx_pcie_host_init()). Instead, it directly calls dw_pcie_setup_rc():

drivers/pci/controller/dwc/pci-imx6.c:imx_pcie_resume_noirq() {
    ...
	if (imx_check_flag(imx_pcie, IMX_PCIE_FLAG_BROKEN_SUSPEND)) {
        ...
		/*
		 * Using PCIE_TEST_PD seems to disable MSI and powers down the
		 * root complex. This is why we have to setup the rc again and
		 * why we have to restore the MSI register.
		 */
		ret = dw_pcie_setup_rc(&imx_pcie->pci->pp);
		if (ret)
			return ret;
    ...
}

Because the root complex is powered down during suspend, its configuration
registers revert to hardware defaults.

Will this allow ASPM L1 to be re-enabled on resume, potentially causing a
device hang?

>  	return 0;
>  
>  err_phy_off:

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260719-l1-conditional-imx-v1-1-a55a57915c68@9elements.com?part=1

      reply	other threads:[~2026-07-19  0:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-19  0:47 [PATCH] PCI: imx6: enable ASPM L1 only iff CLKREQ# is supported Michal Gorlas
2026-07-19  0:57 ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260719005746.31C271F00A3D@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=linux-pci@vger.kernel.org \
    --cc=michal.gorlas@9elements.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox