From: sashiko-bot@kernel.org
To: "Xincheng Zhang" <zhangxincheng@ultrarisc.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v2 1/2] PCI: dwc: Allow drivers to skip MEM outbound iATU setup
Date: Sat, 05 Sep 2026 03:04:29 +0000 [thread overview]
Message-ID: <20260905030429.BC9A21F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <20260905025635.211390-2-zhangxincheng@ultrarisc.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Callers of dw_pcie_setup_rc() ignore its return value, missing potential errors.
--
commit b48f3b5259744f25f4f7ea094bd8ed4860783aa6
Author: Xincheng Zhang <zhangxincheng@ultrarisc.com>
PCI: dwc: Allow drivers to skip MEM outbound iATU setup
This commit adds a flag to bypass outbound iATU programming for
identity-mapped MEM ranges on DWC controllers. It introduces a check
that returns -EINVAL if a skipped MEM range is not identity-mapped.
> diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
> --- a/drivers/pci/controller/dwc/pcie-designware-host.c
> +++ b/drivers/pci/controller/dwc/pcie-designware-host.c
> @@ -918,6 +918,20 @@ static int dw_pcie_iatu_setup(struct dw_pcie_rp *pp)
> atu.parent_bus_addr = entry->res->start - pci->parent_bus_offset;
> atu.pci_addr = entry->res->start - entry->offset;
>
> + if (pp->bypass_ob_mem_iatu) {
> + /*
> + * The no-match pass-through path preserves the correct
> + * PCI address only for identity-mapped MEM ranges.
> + */
> + if (atu.parent_bus_addr != atu.pci_addr) {
> + dev_err(pci->dev,
> + "Cannot bypass outbound iATU for non-identity MEM range %pr\n",
> + entry->res);
> + return -EINVAL;
[Severity: High]
This isn't a bug introduced by this patch, but adding this new failure path
highlights that callers of dw_pcie_setup_rc() (which calls
dw_pcie_iatu_setup()) ignore its return value.
For example, in drivers/pci/controller/dwc/pcie-designware-host.c during
system resume:
dw_pcie_resume_noirq() {
...
dw_pcie_setup_rc(&pci->pp);
...
}
The core suspend/resume framework ignores the setup return value here.
The same pattern exists in driver-specific functions like
exynos_pcie_resume_noirq(), tegra_pcie_dw_resume_noirq(), and
tegra_pcie_dw_start_link().
If dw_pcie_setup_rc() fails because of an invalid ATU configuration
(like this new -EINVAL path) or an iATU enablement timeout, the controller
proceeds with link initialization without proper configuration. Missing
outbound memory windows or broken MSI can result in system crashes or silent
I/O failures when accessing PCI memory.
Could the callers of dw_pcie_setup_rc() be updated to check and handle
these failures appropriately?
> + }
> + continue;
> + }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260905025635.211390-1-zhangxincheng@ultrarisc.com?part=1
next prev parent reply other threads:[~2026-09-05 3:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-05 2:56 [PATCH v2 0/2] PCI: dwc: Support large BARs on UltraRISC DP1000 Xincheng Zhang
2026-09-05 2:56 ` [PATCH v2 1/2] PCI: dwc: Allow drivers to skip MEM outbound iATU setup Xincheng Zhang
2026-09-05 3:04 ` sashiko-bot [this message]
2026-09-05 2:56 ` [PATCH v2 2/2] PCI: ultrarisc: Skip MEM outbound iATU setup on DP1000 Xincheng Zhang
2026-09-05 3:10 ` sashiko-bot
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=20260905030429.BC9A21F00A3D@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=zhangxincheng@ultrarisc.com \
/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