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

From: Xincheng Zhang

Date: Thu Sep 03 2026 - 21:55:23 EST


Hi Niklas,

On Thu, Sep 03, 2026 at 05:30:18PM +0200, Niklas Cassel wrote:
> Looking at dw_pcie_parent_bus_offset(), I can see that it already computes
> pci->parent_bus_offset correctly, regardless of pci->ops->cpu_addr_fixup and
> pci->use_parent_dt_ranges, so atu.parent_bus_addr will be set correctly.
>
> Thus, you can ignore 1).
>
> But 2) would still be very much needed.

Thanks for checking this.

Yes, I agree that the skipped MEM windows need an identity mapping check.
In v2 I will move the bypass decision until after calculating the same
outbound addresses used by the normal iATU programming path, and fail the
host init if a skipped MEM range is not identity-mapped:

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 &&
atu.parent_bus_addr != atu.pci_addr)
return -EINVAL;

This should prevent the driver from silently relying on no-match pass-through
when the DT "ranges" describe different parent-bus and PCI addresses.

For the databook reference, the relevant text I found is in the DWC PCIe RP
Controller Databook v6.00a, June 2022. Section 3.12.2 says the default
outbound no-match behavior is pass-through, and Section 3.12.5.6 "No Address
Match Result" says the address is not translated and programmable TLP header
information comes from the application transmit interface. I will cite those
RP Databook sections in the v2 commit message instead of referring to this
generically.

For DP1000, this remains MEM-only. CFG and I/O still use the normal DWC
outbound iATU programming path.

Thanks,
Xincheng