Re: Please help with kernel BUG at include/linux/gfp.h:80 withndiswrapper on x86_64

From: Arjan van de Ven
Date: Sat Dec 10 2005 - 13:09:41 EST


On Fri, 2005-12-09 at 14:13 -0700, Orion Poplawski wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> With kernel 2.6.15-rc5, gfp_zone has the following BUG_ON:
>
> static inline int gfp_zone(gfp_t gfp)
> {
> int zone = GFP_ZONEMASK & (__force int) gfp;
> BUG_ON(zone >= GFP_ZONETYPES);
> return zone;
> }
>
> This is being tripped by ndiswrapper on x86_64 when it calls:
>
> dma_alloc_coherent(&pci_dev->dev,size,dma_handle, \
> GFP_KERNEL | __GFP_REPEAT | GFP_DMA)


I don't think GFP_DMA is a valid option for dma_alloc_coherent at all;
GFP_DMA was for isa card allocations, for PCI stuff you need to set the
proper masks instead, and GFP_DMA is obsolete and wrong for PCI.
(except for potentially deep arch code that knows what it's doing).


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/