diff options
author | Glauber Costa <gcosta@redhat.com> | 2008-04-09 12:18:06 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-19 13:19:58 -0400 |
commit | 8f19ca1341a6d89bd96e2e69e6e10f46d3258089 (patch) | |
tree | 89ba0c6d2d87798bdfa2753e57f71507f4370caa /arch/x86 | |
parent | 5fa78ca75d8e67063948a01b51594a0904af5710 (diff) |
x86: unify gfp masks
Use the same gfp masks for x86_64 and i386.
It involves using HIGHMEM or DMA32 where necessary, for the sake
of code compatibility, (no real effect), and using the NORETRY
mask for i386.
Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/pci-dma_32.c | 6 | ||||
-rw-r--r-- | arch/x86/kernel/pci-dma_64.c | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/arch/x86/kernel/pci-dma_32.c b/arch/x86/kernel/pci-dma_32.c index 11f100a5f034..5450bd142cb0 100644 --- a/arch/x86/kernel/pci-dma_32.c +++ b/arch/x86/kernel/pci-dma_32.c | |||
@@ -79,7 +79,7 @@ void *dma_alloc_coherent(struct device *dev, size_t size, | |||
79 | unsigned long dma_mask = 0; | 79 | unsigned long dma_mask = 0; |
80 | 80 | ||
81 | /* ignore region specifiers */ | 81 | /* ignore region specifiers */ |
82 | gfp &= ~(__GFP_DMA | __GFP_HIGHMEM); | 82 | gfp &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32); |
83 | 83 | ||
84 | if (dma_alloc_from_coherent_mem(dev, size, dma_handle, &ret)) | 84 | if (dma_alloc_from_coherent_mem(dev, size, dma_handle, &ret)) |
85 | return ret; | 85 | return ret; |
@@ -91,7 +91,9 @@ void *dma_alloc_coherent(struct device *dev, size_t size, | |||
91 | if (dma_mask == 0) | 91 | if (dma_mask == 0) |
92 | dma_mask = DMA_32BIT_MASK; | 92 | dma_mask = DMA_32BIT_MASK; |
93 | 93 | ||
94 | again: | 94 | /* Don't invoke OOM killer */ |
95 | gfp |= __GFP_NORETRY; | ||
96 | again: | ||
95 | page = dma_alloc_pages(dev, gfp, order); | 97 | page = dma_alloc_pages(dev, gfp, order); |
96 | if (page == NULL) | 98 | if (page == NULL) |
97 | return NULL; | 99 | return NULL; |
diff --git a/arch/x86/kernel/pci-dma_64.c b/arch/x86/kernel/pci-dma_64.c index 13a31a4a4c17..b956f5945d67 100644 --- a/arch/x86/kernel/pci-dma_64.c +++ b/arch/x86/kernel/pci-dma_64.c | |||
@@ -49,6 +49,8 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | |||
49 | unsigned long dma_mask = 0; | 49 | unsigned long dma_mask = 0; |
50 | u64 bus; | 50 | u64 bus; |
51 | 51 | ||
52 | /* ignore region specifiers */ | ||
53 | gfp &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32); | ||
52 | 54 | ||
53 | if (dma_alloc_from_coherent_mem(dev, size, dma_handle, &memory)) | 55 | if (dma_alloc_from_coherent_mem(dev, size, dma_handle, &memory)) |
54 | return memory; | 56 | return memory; |