Skip to content

Commit 8d9789d

Browse files
mannamssmb49
authored andcommitted
iommu/dma: Fix IOVA reserve dma ranges
BugLink: https://bugs.launchpad.net/bugs/1938199 [ Upstream commit 571f316 ] Fix IOVA reserve failure in the case when address of first memory region listed in dma-ranges is equal to 0x0. Fixes: aadad09 ("iommu/dma: Reserve IOVA for PCIe inaccessible DMA address") Signed-off-by: Srinath Mannam <[email protected]> Reviewed-by: Robin Murphy <[email protected]> Tested-by: Sven Peter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Kamal Mostafa <[email protected]> Signed-off-by: Stefan Bader <[email protected]>
1 parent 91d8cb9 commit 8d9789d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/iommu/dma-iommu.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,11 @@ static int iova_reserve_pci_windows(struct pci_dev *dev,
216216
lo = iova_pfn(iovad, start);
217217
hi = iova_pfn(iovad, end);
218218
reserve_iova(iovad, lo, hi);
219-
} else {
219+
} else if (end < start) {
220220
/* dma_ranges list should be sorted */
221-
dev_err(&dev->dev, "Failed to reserve IOVA\n");
221+
dev_err(&dev->dev,
222+
"Failed to reserve IOVA [%#010llx-%#010llx]\n",
223+
start, end);
222224
return -EINVAL;
223225
}
224226

0 commit comments

Comments
 (0)