Re: [PATCH v2 1/2] PCI: dwc: Allow drivers to skip MEM outbound iATU setup

From: Niklas Cassel

Date: Wed Oct 14 2026 - 04:37:05 EST


On Sat, Sep 05, 2026 at 10:56:34AM +0800, Xincheng Zhang wrote:
> Some DWC-based controllers do not require outbound iATU windows for MEM
> transactions. For those platforms, programming outbound iATU windows for
> host bridge MEM ranges is unnecessary and may constrain the available MEM
> aperture.
>
> The DWC PCIe RP Controller Databook v6.00a, section 3.12.2, describes the
> default outbound no-match behavior as pass-through. Section 3.12.5.6, "No
> Address Match Result", says the address is not translated and programmable
> TLP header fields come from the application transmit interface.
>
> This no-match path cannot translate between different parent-bus and PCI
> addresses, so require skipped MEM ranges to be identity-mapped.
>
> Add dw_pcie_rp::bypass_ob_mem_iatu so drivers can skip generic MEM iATU
> setup while using the common DWC host init path.
>
> Existing drivers keep the current behavior because the flag defaults to
> false. The I/O iATU setup does not use the MEM resource iterator, and the
> iterator may be uninitialized when MEM setup is skipped. Avoid using it in
> the I/O iATU error path.
>
> Signed-off-by: Xincheng Zhang <zhangxincheng@xxxxxxxxxxxxx>
> ---
> .../pci/controller/dwc/pcie-designware-host.c | 17 +++++++++++++++--
> drivers/pci/controller/dwc/pcie-designware.h | 1 +
> 2 files changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
> index f5a38e6fd8d79..b06797b4e31d2 100644
> --- 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) {

Sorry for commenting on this patch after it was accepted.

But... since this behavior is intrinsic to the DWC controller, rather than
being SoC specific... Why bother creating a flag for it?

Is there a reason why this can't just be a simple:

if (atu.parent_bus_addr == atu.pci_addr)
continue;

?


Kind regards,
Niklas