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 <srinath.mannam@broadcom.com> Reviewed-by: Robin Murphy <robin.murphy@arm.com> Tested-by: Sven Peter <sven@svenpeter.dev> Link: https://lore.kernel.org/r/20200914072319.6091-1-srinath.mannam@broadcom.com Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
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)