* Please help with kernel BUG at include/linux/gfp.h:80 with ndiswrapper on x86_64
@ 2005-12-09 21:13 Orion Poplawski
2005-12-10 18:10 ` Arjan van de Ven
0 siblings, 1 reply; 2+ messages in thread
From: Orion Poplawski @ 2005-12-09 21:13 UTC (permalink / raw)
To: linux-kernel
-----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)
because dma_alloc_coherent does:
dma_mask = dev->coherent_dma_mask;
if (dma_mask == 0)
dma_mask = 0xffffffff;
/* Kludge to make it bug-to-bug compatible with i386. i386
uses the normal dma_mask for alloc_coherent. */
dma_mask &= *dev->dma_mask;
/* Why <=? Even when the mask is smaller than 4GB it is often larger
than 16MB and in this case we have a chance of finding
fitting memory
in the next higher zone first. If not retry with true
GFP_DMA. -AK */
if (dma_mask <= 0xffffffff)
gfp |= GFP_DMA32;
again:
memory = dma_alloc_pages(dev, gfp, get_order(size));
so it appears that gfp becomes GFP_DMA | GFP_DMA32 = 5 and triggers the BUG.
So, what should ndiswrapper be using in it's call to dma_alloc_coherent?
GFP_DMA32?
Thanks!
Orion Poplawski
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFDmfNoORnzrtFC2/sRAsp2AKCiK/VAMoIGvxn3uvSuapcop7GUCwCgq9U+
HZShybTsF7LZyG1yXSJceFo=
=iInr
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Please help with kernel BUG at include/linux/gfp.h:80 with ndiswrapper on x86_64
2005-12-09 21:13 Please help with kernel BUG at include/linux/gfp.h:80 with ndiswrapper on x86_64 Orion Poplawski
@ 2005-12-10 18:10 ` Arjan van de Ven
0 siblings, 0 replies; 2+ messages in thread
From: Arjan van de Ven @ 2005-12-10 18:10 UTC (permalink / raw)
To: Orion Poplawski; +Cc: linux-kernel
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).
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-12-10 18:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-09 21:13 Please help with kernel BUG at include/linux/gfp.h:80 with ndiswrapper on x86_64 Orion Poplawski
2005-12-10 18:10 ` Arjan van de Ven
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.