diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2012-05-09 12:26:30 -0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2012-07-18 16:40:11 -0400 |
commit | eef015c8aa74451f848307fe5f65485070533bbb (patch) | |
tree | 7fca680be2246812c14920c0fb44fbe717786dc6 /arch/tile/kernel/pci-dma.c | |
parent | bbaa22c3a0d0be4406d26e5a73d1e8e504787986 (diff) |
arch/tile: enable ZONE_DMA for tilegx
This is required for PCI root complex legacy support and USB OHCI root
complex support. With this change tilegx now supports allocating memory
whose PA fits in 32 bits.
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'arch/tile/kernel/pci-dma.c')
-rw-r--r-- | arch/tile/kernel/pci-dma.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/tile/kernel/pci-dma.c b/arch/tile/kernel/pci-dma.c index 9814d7082f24..edd856a000c5 100644 --- a/arch/tile/kernel/pci-dma.c +++ b/arch/tile/kernel/pci-dma.c | |||
@@ -45,14 +45,17 @@ void *dma_alloc_coherent(struct device *dev, | |||
45 | gfp |= __GFP_ZERO; | 45 | gfp |= __GFP_ZERO; |
46 | 46 | ||
47 | /* | 47 | /* |
48 | * By forcing NUMA node 0 for 32-bit masks we ensure that the | 48 | * If the mask specifies that the memory be in the first 4 GB, then |
49 | * high 32 bits of the resulting PA will be zero. If the mask | 49 | * we force the allocation to come from the DMA zone. We also |
50 | * size is, e.g., 24, we may still not be able to guarantee a | 50 | * force the node to 0 since that's the only node where the DMA |
51 | * suitable memory address, in which case we will return NULL. | 51 | * zone isn't empty. If the mask size is smaller than 32 bits, we |
52 | * But such devices are uncommon. | 52 | * may still not be able to guarantee a suitable memory address, in |
53 | * which case we will return NULL. But such devices are uncommon. | ||
53 | */ | 54 | */ |
54 | if (dma_mask <= DMA_BIT_MASK(32)) | 55 | if (dma_mask <= DMA_BIT_MASK(32)) { |
56 | gfp |= GFP_DMA; | ||
55 | node = 0; | 57 | node = 0; |
58 | } | ||
56 | 59 | ||
57 | pg = homecache_alloc_pages_node(node, gfp, order, PAGE_HOME_DMA); | 60 | pg = homecache_alloc_pages_node(node, gfp, order, PAGE_HOME_DMA); |
58 | if (pg == NULL) | 61 | if (pg == NULL) |