archive mirror
 help / color / mirror / Atom feed
From: Srinath Mannam via iommu <>
To: Robin Murphy <>,
	Joerg Roedel <>,
	Lorenzo Pieralisi <>,
	Bjorn Helgaas <>,
Cc: Srinath Mannam <>,,,
Subject: [PATCH v2] iommu/dma: Fix IOVA reserve dma ranges
Date: Fri, 11 Sep 2020 15:55:34 +0530	[thread overview]
Message-ID: <> (raw)

Fix IOVA reserve failure in the case when address of first memory region
listed in dma-ranges is equal to 0x0.

Fixes: aadad097cd46f ("iommu/dma: Reserve IOVA for PCIe inaccessible DMA address")
Signed-off-by: Srinath Mannam <>
Changes from v1:
   Removed unnecessary changes based on Robin's review comments.

 drivers/iommu/dma-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c
index 5141d49a046b..682068a9aae7 100644
--- a/drivers/iommu/dma-iommu.c
+++ b/drivers/iommu/dma-iommu.c
@@ -217,7 +217,7 @@ static int iova_reserve_pci_windows(struct pci_dev *dev,
 			lo = iova_pfn(iovad, start);
 			hi = iova_pfn(iovad, end);
 			reserve_iova(iovad, lo, hi);
-		} else {
+		} else if (end < start) {
 			/* dma_ranges list should be sorted */
 			dev_err(&dev->dev, "Failed to reserve IOVA\n");
 			return -EINVAL;

iommu mailing list

             reply	other threads:[~2020-09-11 10:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11 10:25 Srinath Mannam via iommu [this message]
2020-09-11 15:16 ` [PATCH v2] iommu/dma: Fix IOVA reserve dma ranges Bjorn Helgaas
2020-09-14  7:11   ` Srinath Mannam via iommu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).