Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172399
b: refs/heads/master
c: ebd7a84
h: refs/heads/master
i:
  172397: 2bd0832
  172395: 5b0a732
  172391: 74aaa3a
  172383: 698488a
v: v3
  • Loading branch information
Russell King committed Nov 24, 2009
1 parent f152169 commit cb63625
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 20 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: 88c58f3b92bc7c26439802c300d39b6377739d81
refs/heads/master: ebd7a845fa4332da3ebcbe8cf1b09bb43413420e
31 changes: 12 additions & 19 deletions trunk/arch/arm/mm/dma-mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,18 +189,24 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
struct page *page;
struct arm_vmregion *c;

if (!consistent_pte[0]) {
printk(KERN_ERR "%s: not initialised\n", __func__);
dump_stack();
return NULL;
}

size = PAGE_ALIGN(size);

page = __dma_alloc_buffer(dev, size, gfp);
if (!page)
goto no_page;

if (arch_is_coherent()) {
*handle = page_to_dma(dev, page);
return page_address(page);
}

if (!consistent_pte[0]) {
printk(KERN_ERR "%s: not initialised\n", __func__);
dump_stack();
__dma_free_buffer(page, size);
return NULL;
}

/*
* Allocate a virtual address in the consistent mapping region.
*/
Expand Down Expand Up @@ -342,19 +348,6 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gf
if (dma_alloc_from_coherent(dev, size, handle, &memory))
return memory;

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

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

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

return __dma_alloc(dev, size, handle, gfp,
pgprot_noncached(pgprot_kernel));
}
Expand Down

0 comments on commit cb63625

Please sign in to comment.