Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 62308
b: refs/heads/master
c: df336d1
h: refs/heads/master
v: v3
  • Loading branch information
Keir Fraser authored and Linus Torvalds committed Jul 22, 2007
1 parent 433e5bf commit 5482568
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 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: 28de7948a896763bc97ccd416bba5b9422158350
refs/heads/master: df336d1c7b6fd510fa6d3a028f999e7586c7026e
5 changes: 4 additions & 1 deletion trunk/lib/swiotlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,8 @@ map_single(struct device *hwdev, char *buffer, size_t size, int dir)
* This is needed when we sync the memory. Then we sync the buffer if
* needed.
*/
io_tlb_orig_addr[index] = buffer;
for (i = 0; i < nslots; i++)
io_tlb_orig_addr[index+i] = buffer + (i << IO_TLB_SHIFT);
if (dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL)
memcpy(dma_addr, buffer, size);

Expand Down Expand Up @@ -418,6 +419,8 @@ sync_single(struct device *hwdev, char *dma_addr, size_t size,
int index = (dma_addr - io_tlb_start) >> IO_TLB_SHIFT;
char *buffer = io_tlb_orig_addr[index];

buffer += ((unsigned long)dma_addr & ((1 << IO_TLB_SHIFT) - 1));

switch (target) {
case SYNC_FOR_CPU:
if (likely(dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL))
Expand Down

0 comments on commit 5482568

Please sign in to comment.