diff options
author | Daniel Hellstrom <daniel@gaisler.com> | 2014-09-10 08:17:52 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-10 17:03:28 -0400 |
commit | d1105287aabe88dbb3af825140badaa05cf0442c (patch) | |
tree | 4a2e91fa69c62cf249d3728ae37586870c1ff955 /arch/sparc/kernel | |
parent | b84ca92e1672432aac43cccaaa572881e7cc9fdd (diff) |
sparc32: dma_alloc_coherent must honour gfp flags
dma_zalloc_coherent() calls dma_alloc_coherent(__GFP_ZERO)
but the sparc32 implementations sbus_alloc_coherent() and
pci32_alloc_coherent() doesn't take the gfp flags into
account.
Tested on the SPARC32/LEON GRETH Ethernet driver which fails
due to dma_alloc_coherent(__GFP_ZERO) returns non zeroed
pages.
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r-- | arch/sparc/kernel/ioport.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c index 7f08ec8a7c68..28fed53b13a0 100644 --- a/arch/sparc/kernel/ioport.c +++ b/arch/sparc/kernel/ioport.c | |||
@@ -278,7 +278,8 @@ static void *sbus_alloc_coherent(struct device *dev, size_t len, | |||
278 | } | 278 | } |
279 | 279 | ||
280 | order = get_order(len_total); | 280 | order = get_order(len_total); |
281 | if ((va = __get_free_pages(GFP_KERNEL|__GFP_COMP, order)) == 0) | 281 | va = __get_free_pages(gfp, order); |
282 | if (va == 0) | ||
282 | goto err_nopages; | 283 | goto err_nopages; |
283 | 284 | ||
284 | if ((res = kzalloc(sizeof(struct resource), GFP_KERNEL)) == NULL) | 285 | if ((res = kzalloc(sizeof(struct resource), GFP_KERNEL)) == NULL) |
@@ -443,7 +444,7 @@ static void *pci32_alloc_coherent(struct device *dev, size_t len, | |||
443 | } | 444 | } |
444 | 445 | ||
445 | order = get_order(len_total); | 446 | order = get_order(len_total); |
446 | va = (void *) __get_free_pages(GFP_KERNEL, order); | 447 | va = (void *) __get_free_pages(gfp, order); |
447 | if (va == NULL) { | 448 | if (va == NULL) { |
448 | printk("pci_alloc_consistent: no %ld pages\n", len_total>>PAGE_SHIFT); | 449 | printk("pci_alloc_consistent: no %ld pages\n", len_total>>PAGE_SHIFT); |
449 | goto err_nopages; | 450 | goto err_nopages; |