]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/dma: Explicitly sort PCI DMA windows
authorRobin Murphy <robin.murphy@arm.com>
Mon, 9 May 2022 10:16:08 +0000 (11:16 +0100)
committerJoerg Roedel <jroedel@suse.de>
Fri, 13 May 2022 13:08:20 +0000 (15:08 +0200)
commit1a396b6ce307b71da2cb5a8be79190eec621a3c8
tree0bc4580aebbe9f2c76334c542b6184d7f5beb1ac
parent9eefeb3d07d63378b67ddf97719ca890a2f1af4b
iommu/dma: Explicitly sort PCI DMA windows

Originally, creating the dma_ranges resource list in pre-sorted fashion
was the simplest and most efficient way to enforce the order required by
iova_reserve_pci_windows(). However since then at least one PCI host
driver is now re-sorting the list for its own probe-time processing,
which doesn't seem entirely unreasonable, so that basic assumption no
longer holds. Make iommu-dma robust and get the sort order it needs by
explicitly sorting, which means we can also save the effort at creation
time and just build the list in whatever natural order the DT had.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/35661036a7e4160850895f9b37f35408b6a29f2f.1652091160.git.robin.murphy@arm.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/dma-iommu.c
drivers/pci/of.c