Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11210
b: refs/heads/master
c: 424cada
h: refs/heads/master
v: v3
  • Loading branch information
Thiemo Seufer authored and Ralf Baechle committed Oct 29, 2005
1 parent f43cce4 commit a5ecd9f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 39 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: 98e316d4b151111d5a8ff2b3a684a9300634d83f
refs/heads/master: 424cadae94a683afe2164f726269d2b479d99732
46 changes: 8 additions & 38 deletions trunk/arch/mips/mm/dma-noncoherent.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,22 +105,7 @@ dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
{
unsigned long addr = (unsigned long) ptr;

switch (direction) {
case DMA_TO_DEVICE:
dma_cache_wback(addr, size);
break;

case DMA_FROM_DEVICE:
dma_cache_inv(addr, size);
break;

case DMA_BIDIRECTIONAL:
dma_cache_wback_inv(addr, size);
break;

default:
BUG();
}
__dma_sync(addr, size, direction);

return virt_to_phys(ptr);
}
Expand All @@ -133,22 +118,7 @@ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
unsigned long addr;
addr = dma_addr + PAGE_OFFSET;

switch (direction) {
case DMA_TO_DEVICE:
//dma_cache_wback(addr, size);
break;

case DMA_FROM_DEVICE:
//dma_cache_inv(addr, size);
break;

case DMA_BIDIRECTIONAL:
//dma_cache_wback_inv(addr, size);
break;

default:
BUG();
}
//__dma_sync(addr, size, direction);
}

EXPORT_SYMBOL(dma_unmap_single);
Expand All @@ -164,10 +134,11 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
unsigned long addr;

addr = (unsigned long) page_address(sg->page);
if (addr)
if (addr) {
__dma_sync(addr + sg->offset, sg->length, direction);
sg->dma_address = (dma_addr_t)
(page_to_phys(sg->page) + sg->offset);
sg->dma_address = (dma_addr_t)page_to_phys(sg->page)
+ sg->offset;
}
}

return nents;
Expand Down Expand Up @@ -218,9 +189,8 @@ void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,

for (i = 0; i < nhwentries; i++, sg++) {
addr = (unsigned long) page_address(sg->page);
if (!addr)
continue;
dma_cache_wback_inv(addr + sg->offset, sg->length);
if (addr)
__dma_sync(addr + sg->offset, sg->length, direction);
}
}

Expand Down

0 comments on commit a5ecd9f

Please sign in to comment.