x86: fix dma_mapping_error for 32bit x86

Devices like b44 ethernet can't dma from addresses above 1GB. The driver
handles this cases by falling back to GFP_DMA allocation. But for detecting
the problem it needs to get an indication from dma_mapping_error.
The bug is triggered by using a VMSPLIT option of 2G/2G.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by

Thomas Bogendoerfer and committed by
Ingo Molnar
7b1dedca b627c8b1

+2 -4
+2 -4
arch/x86/include/asm/dma-mapping.h
··· 71 71 /* Make sure we keep the same behaviour */ 72 72 static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) 73 73 { 74 - #ifdef CONFIG_X86_32 75 - return 0; 76 - #else 74 + #ifdef CONFIG_X86_64 77 75 struct dma_mapping_ops *ops = get_dma_ops(dev); 78 76 if (ops->mapping_error) 79 77 return ops->mapping_error(dev, dma_addr); 80 78 81 - return (dma_addr == bad_dma_address); 82 79 #endif 80 + return (dma_addr == bad_dma_address); 83 81 } 84 82 85 83 #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)