Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 120155
b: refs/heads/master
c: da9fdc8
h: refs/heads/master
i:
  120153: 78aa371
  120151: 58085ef
v: v3
  • Loading branch information
Magnus Damm authored and Paul Mundt committed Dec 22, 2008
1 parent 33d0bf3 commit a4ab366
Show file tree
Hide file tree
Showing 2 changed files with 7 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: 78fb40263f34c65ade1693664db1af168d479588
refs/heads/master: da9fdc8b44c421f14a68988ae4d1fb414d5edbf0
7 changes: 6 additions & 1 deletion trunk/arch/sh/mm/consistent.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ void *dma_alloc_coherent(struct device *dev, size_t size,
return NULL;
}

split_page(pfn_to_page(virt_to_phys(ret) >> PAGE_SHIFT), order);

*dma_handle = virt_to_phys(ret);
return ret_nocache;
}
Expand All @@ -51,10 +53,13 @@ void dma_free_coherent(struct device *dev, size_t size,
void *vaddr, dma_addr_t dma_handle)
{
int order = get_order(size);
unsigned long pfn = dma_handle >> PAGE_SHIFT;
int k;

if (!dma_release_from_coherent(dev, order, vaddr)) {
WARN_ON(irqs_disabled()); /* for portability */
free_pages((unsigned long)phys_to_virt(dma_handle), order);
for (k = 0; k < (1 << order); k++)
__free_pages(pfn_to_page(pfn + k), 0);
iounmap(vaddr);
}
}
Expand Down

0 comments on commit a4ab366

Please sign in to comment.