aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2009-07-01 14:27:53 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-07-01 14:54:37 -0400
commit85b98276f2ffa66b25ae6328b00bfadfd74b74e7 (patch)
tree17ae570435b8d46e217803b2c536a41f6e8a0c18 /drivers/pci
parent206a73c102fc480ba072a9388bc2142c303113aa (diff)
intel-iommu: Warn about unmatched unmap requests
This would have found the bug in i386 pci_unmap_addr() a long time ago. We shouldn't just silently return without doing anything. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/intel-iommu.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index 02223e2e27d4..2bbc3fc88dc9 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -2640,7 +2640,8 @@ static void intel_unmap_page(struct device *dev, dma_addr_t dev_addr,
2640 iommu = domain_get_iommu(domain); 2640 iommu = domain_get_iommu(domain);
2641 2641
2642 iova = find_iova(&domain->iovad, IOVA_PFN(dev_addr)); 2642 iova = find_iova(&domain->iovad, IOVA_PFN(dev_addr));
2643 if (!iova) 2643 if (WARN_ONCE(!iova, "Driver unmaps unmatched page at PFN %llx\n",
2644 (unsigned long long)dev_addr))
2644 return; 2645 return;
2645 2646
2646 start_pfn = mm_to_dma_pfn(iova->pfn_lo); 2647 start_pfn = mm_to_dma_pfn(iova->pfn_lo);
@@ -2730,7 +2731,8 @@ static void intel_unmap_sg(struct device *hwdev, struct scatterlist *sglist,
2730 iommu = domain_get_iommu(domain); 2731 iommu = domain_get_iommu(domain);
2731 2732
2732 iova = find_iova(&domain->iovad, IOVA_PFN(sglist[0].dma_address)); 2733 iova = find_iova(&domain->iovad, IOVA_PFN(sglist[0].dma_address));
2733 if (!iova) 2734 if (WARN_ONCE(!iova, "Driver unmaps unmatched sglist at PFN %llx\n",
2735 (unsigned long long)sglist[0].dma_address))
2734 return; 2736 return;
2735 2737
2736 start_pfn = mm_to_dma_pfn(iova->pfn_lo); 2738 start_pfn = mm_to_dma_pfn(iova->pfn_lo);