Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172395
b: refs/heads/master
c: 3e82d01
h: refs/heads/master
i:
  172393: 17540dc
  172391: 74aaa3a
v: v3
  • Loading branch information
Russell King committed Nov 24, 2009
1 parent da21e55 commit 5b0a732
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 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: 7a9a32a9533fa01de911e1d056142ddd27360782
refs/heads/master: 3e82d012e9281a0b6388ff2356e8396b9d781e1c
18 changes: 10 additions & 8 deletions trunk/arch/arm/mm/dma-mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,16 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gf
return memory;

if (arch_is_coherent()) {
void *virt;
struct page *page;

virt = kmalloc(size, gfp);
if (!virt)
page = __dma_alloc_buffer(dev, PAGE_ALIGN(size), gfp);
if (!page) {
*handle = ~0;
return NULL;
*handle = virt_to_dma(dev, virt);
}

return virt;
*handle = page_to_dma(dev, page);
return page_address(page);
}

return __dma_alloc(dev, size, handle, gfp,
Expand Down Expand Up @@ -336,13 +338,13 @@ void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr
if (dma_release_from_coherent(dev, get_order(size), cpu_addr))
return;

size = PAGE_ALIGN(size);

if (arch_is_coherent()) {
kfree(cpu_addr);
__dma_free_buffer(dma_to_page(dev, handle), size);
return;
}

size = PAGE_ALIGN(size);

c = arm_vmregion_find_remove(&consistent_head, (unsigned long)cpu_addr);
if (!c)
goto no_area;
Expand Down

0 comments on commit 5b0a732

Please sign in to comment.