Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91033
b: refs/heads/master
c: 71848d6
h: refs/heads/master
i:
  91031: 3711481
v: v3
  • Loading branch information
Glauber Costa authored and Ingo Molnar committed Apr 19, 2008
1 parent d73bc9b commit 8b0ac5d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 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: 2e33e361188617628e47b4bc47e87e84feaf556f
refs/heads/master: 71848d687e2a477cb7c68a854d8fdeaa5dff0ffc
14 changes: 7 additions & 7 deletions trunk/arch/x86/kernel/pci-dma_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@ struct device fallback_dev = {
noinline static void *
dma_alloc_pages(struct device *dev, gfp_t gfp, unsigned order)
{
struct page *page;
int node;

node = dev_to_node(dev);

page = alloc_pages_node(node, gfp, order);
return page ? page_address(page) : NULL;
return alloc_pages_node(node, gfp, order);
}

#define dma_alloc_from_coherent_mem(dev, size, handle, ret) (0)
Expand All @@ -47,6 +45,7 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
gfp_t gfp)
{
void *memory;
struct page *page;
unsigned long dma_mask = 0;
u64 bus;

Expand Down Expand Up @@ -79,13 +78,14 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
gfp |= GFP_DMA32;

again:
memory = dma_alloc_pages(dev, gfp, get_order(size));
if (memory == NULL)
page = dma_alloc_pages(dev, gfp, get_order(size));
if (page == NULL)
return NULL;

{
int high, mmu;
bus = virt_to_bus(memory);
bus = page_to_phys(page);
memory = page_address(page);
high = (bus + size) >= dma_mask;
mmu = high;
if (force_iommu && !(gfp & GFP_DMA))
Expand All @@ -112,7 +112,7 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,

memset(memory, 0, size);
if (!mmu) {
*dma_handle = virt_to_bus(memory);
*dma_handle = bus;
return memory;
}
}
Expand Down

0 comments on commit 8b0ac5d

Please sign in to comment.