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

From: Niklas Cassel

Date: Fri Sep 04 2026 - 02:02:23 EST


On Fri, Sep 04, 2026 at 09:51:34AM +0800, Xincheng Zhang wrote:
> On Thu, Sep 03, 2026 at 05:30:18PM +0200, Niklas Cassel wrote:
>
> 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;

Looks good.
I think it also makes sense to add a short code comment above the
if-statement.


>
> 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.

Sounds good.


Kind regards,
Niklas