Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252965
b: refs/heads/master
c: 8fcc537
h: refs/heads/master
i:
  252963: 6a7d3cc
v: v3
  • Loading branch information
Chris Wright authored and David Woodhouse committed Jun 1, 2011
1 parent 318fb76 commit 207fecc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9b4554b21ed07e8556405510638171f0c787742a
refs/heads/master: 8fcc5372fbac085199d84a880503ed67aba3fe49
15 changes: 13 additions & 2 deletions trunk/drivers/pci/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2316,8 +2316,19 @@ static int iommu_should_identity_map(struct pci_dev *pdev, int startup)
* Assume that they will -- if they turn out not to be, then we can
* take them out of the 1:1 domain later.
*/
if (!startup)
return pdev->dma_mask > DMA_BIT_MASK(32);
if (!startup) {
/*
* If the device's dma_mask is less than the system's memory
* size then this is not a candidate for identity mapping.
*/
u64 dma_mask = pdev->dma_mask;

if (pdev->dev.coherent_dma_mask &&
pdev->dev.coherent_dma_mask < dma_mask)
dma_mask = pdev->dev.coherent_dma_mask;

return dma_mask >= dma_get_required_mask(&pdev->dev);
}

return 1;
}
Expand Down

0 comments on commit 207fecc

Please sign in to comment.