Re: [PATCH v7 23/25] PCI: dwc: Restore DMA-mask after MSI-data allocation

From: Christoph Hellwig
Date: Thu Dec 15 2022 - 02:15:01 EST


On Thu, Dec 15, 2022 at 02:53:03AM +0300, Serge Semin wrote:
> DW PCIe Root Ports and End-points can be equipped with the DW eDMA engine.
> In that case it is critical to have the platform device pre-initialized
> with a valid DMA-mask so the drivers using the eDMA-engine would be able
> to allocate the DMA-able buffers. The MSI-capable data requires to be
> allocated from the lowest 4GB region. Since that procedure implies the
> DMA-mask change we need to restore the mask set by the low-level drivers
> after the MSI-data allocation is done.

You can't change the DMA mask when there are existing allocations.