Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158063
b: refs/heads/master
c: c7084b3
h: refs/heads/master
i:
  158061: 5e829d3
  158059: 8e0b298
  158055: 74f74b6
  158047: 5291ca3
v: v3
  • Loading branch information
Casey Dahlin authored and Ingo Molnar committed Aug 21, 2009
1 parent d07421d commit e615db8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 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: 451d7400a34cb679369e337d67f0238ed410f484
refs/heads/master: c7084b35eb1a4d3353a501508baf9d3d82822c93
15 changes: 9 additions & 6 deletions trunk/lib/swiotlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,12 +581,15 @@ swiotlb_full(struct device *dev, size_t size, int dir, int do_panic)
printk(KERN_ERR "DMA: Out of SW-IOMMU space for %zu bytes at "
"device %s\n", size, dev ? dev_name(dev) : "?");

if (size > io_tlb_overflow && do_panic) {
if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL)
panic("DMA: Memory would be corrupted\n");
if (dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL)
panic("DMA: Random memory would be DMAed\n");
}
if (size <= io_tlb_overflow || !do_panic)
return;

if (dir == DMA_BIDIRECTIONAL)
panic("DMA: Random memory could be DMA accessed\n");
if (dir == DMA_FROM_DEVICE)
panic("DMA: Random memory could be DMA written\n");
if (dir == DMA_TO_DEVICE)
panic("DMA: Random memory could be DMA read\n");
}

/*
Expand Down

0 comments on commit e615db8

Please sign in to comment.