Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Alexander Stein" <alexander.stein@ew.tq-group.com>
Cc: imx@lists.linux.dev, Frank.Li@kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH 1/1] PCI: imx6: Use dev_err_probe
Date: Fri, 19 Jun 2026 11:36:24 +0000	[thread overview]
Message-ID: <20260619113624.A90AE1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260619112535.1127850-1-alexander.stein@ew.tq-group.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] The return value of imx_pcie_host_init() is ignored in imx_add_pcie_ep(), leading to a system crash when pwrctrl devices trigger a probe deferral.
--

commit 177305e0f76751d4a9bafb983aa8f962639d5a3b
Author: Alexander Stein <alexander.stein@ew.tq-group.com>

PCI: imx6: Use dev_err_probe

pci_pwrctrl_power_on_devices() might return -EPROBE_DEFER resulting in
an error message. Use dev_err_probe to silence this non-error message.

> diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
> index 98e1db751132a..b7a502e9a1c59 100644
> --- a/drivers/pci/controller/dwc/pci-imx6.c
> +++ b/drivers/pci/controller/dwc/pci-imx6.c
> @@ -1381,7 +1381,7 @@ static int imx_pcie_host_init(struct dw_pcie_rp *pp)
>  
>  	ret = pci_pwrctrl_power_on_devices(dev);
>  	if (ret) {
> -		dev_err(dev, "failed to power on pwrctrl devices\n");
> +		dev_err_probe(dev, ret, "failed to power on pwrctrl devices\n");

[Severity: High]
This isn't a bug introduced by this patch, but since 
pci_pwrctrl_power_on_devices() might return -EPROBE_DEFER (as anticipated by
this change), does this lead to a system crash during endpoint initialization?

In drivers/pci/controller/dwc/pci-imx6.c:imx_add_pcie_ep(),
imx_pcie_host_init() is called but its return value is ignored:

	imx_pcie_host_init(pp);
	ep = &pci->ep;

If imx_pcie_host_init() fails and returns -EPROBE_DEFER, imx_add_pcie_ep()
blindly proceeds to execute dw_pcie_ep_init_registers() and
imx_pcie_host_post_init() on unpowered hardware.

This causes the kernel to attempt MMIO reads and writes on unclocked and
unpowered PCIe Endpoint DBI registers, which triggers a synchronous external
abort and panics the system on ARM/i.MX platforms.

Could we add a check for the return value of imx_pcie_host_init() in
imx_add_pcie_ep()?

>  		goto err_pwrctrl_destroy;
>  	}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260619112535.1127850-1-alexander.stein@ew.tq-group.com?part=1

  reply	other threads:[~2026-06-19 11:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-19 11:25 [PATCH 1/1] PCI: imx6: Use dev_err_probe Alexander Stein
2026-06-19 11:36 ` sashiko-bot [this message]
2026-06-19 14:11 ` Frank Li
2026-09-28 11:45 ` Alexander Stein

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=20260619113624.A90AE1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=imx@lists.linux.dev \
    --cc=linux-pci@vger.kernel.org \
    --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