Re: [PATCH 1/2] PCI: dwc: ep: Fix dw_pcie_ep_align_addr()

Krzysztof Wilczyński
2024-11-02T11:37:34Z

Hello,

> > ep->page_size is defined by the EPC drivers.
> > Some drivers e.g. pci-imx6.c defines this to 4K for imx95.
> >
> > dw_pcie_ep_init() will call pci_epc_mem_init() with ep->page_size.
> > pci_epc_mem_init() will call pci_epc_multi_mem_init().
> >
> > pci_epc_multi_mem_init() will initialize mem->window.page_size.
> > If the provided page_size (ep->page_size) is smaller than PAGE_SIZE,
> > it will initialize mem->window.page_size to PAGE_SIZE rather than
> > ep->page_size.
> >
> > Thus, mem->window.page_size can be larger than ep->page_size, e.g.
> > for a platform built with PAGE_SIZE == 64K, while using a EPC driver
> > that defines ep->page_size to 4k.
> >
> > Therefore, modify dw_pcie_ep_align_addr() to use
> > epc->mem->window.page_size rather than ep->page_size.
> >
> > [...]
>
> Fixes: a1cd1d901a5c ("PCI: dwc: endpoint: Implement the pci_epc_ops::align_addr() operation")

I squashed this patch into the one this aimed to fix.

Krzysztof