public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Orion Poplawski <orion@cora.nwra.com>
To: linux-kernel@vger.kernel.org
Subject: Please help with kernel BUG at include/linux/gfp.h:80 with ndiswrapper on x86_64
Date: Fri, 09 Dec 2005 14:13:13 -0700	[thread overview]
Message-ID: <dncs1c$8e5$1@sea.gmane.org> (raw)

-----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-----


             reply	other threads:[~2005-12-09 21:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-09 21:13 Orion Poplawski [this message]
2005-12-10 18:10 ` Please help with kernel BUG at include/linux/gfp.h:80 with ndiswrapper on x86_64 Arjan van de Ven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='dncs1c$8e5$1@sea.gmane.org' \
    --to=orion@cora.nwra.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox