netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	jgarzik@pobox.com, pp@ee.oulu.fi
Subject: Re: [patch 2.6.14-rc4] b44: alternate allocation option for DMA descriptors
Date: Thu, 20 Oct 2005 17:17:05 +1000	[thread overview]
Message-ID: <1129792626.7620.248.camel@gaston> (raw)
In-Reply-To: <10182005213059.12243@bilbo.tuxdriver.com>

On Tue, 2005-10-18 at 21:30 -0400, John W. Linville wrote:
> This is a (final?) hack to support the odd DMA allocation requirements
> of the b44 hardware.  The b44 hardware has a 30-bit DMA mask.  On x86,
> anything less than a 32-bit DMA mask forces allocations into the 16MB
> GFP_DMA range.  The memory there is somewhat limited, often resulting
> in an inability to initialize the b44 driver.
> 
> This hack uses streaming DMA allocation APIs in order to provide an
> alternative in case the GFP_DMA allocation fails.  It is somewhat ugly,
> but not much worse than the similar existing hacks to support SKB
> allocations in the same driver.  FWIW, I have received positive
> feedback on this from several Fedora users.

I'm not sure what you are trying to do here ... If pci_alloc_* failed,
you do kmalloc(...,GFP_KERNEL) which can give you memory above your DMA
mask. Then, you use dma_map_* but that won't help much more neither.
Unless you have an iommu (or swiotlb) _and_ that implements arbitrary
DMA masks support (which it typically doesn't it's often 32 bits vs. 64
bits) it won't help, you'll get into your error case.

So basically, what you are doing is: if allocation fails, you try to get
memory using GFP_KERNEL. If it happens to be in the low 2Gb of memory,
use it, if not, drop it.

Did I get that right ?

Note that the Broadcom wireless (which is currently being reverse
engineered) seem to suffer from the same stupid DMA engine...

Ben.

  parent reply	other threads:[~2005-10-20  7:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-19  1:30 [patch 2.6.14-rc4] b44: alternate allocation option for DMA descriptors John W. Linville
2005-10-19  2:27 ` Jeff Garzik
2005-10-20  7:17 ` Benjamin Herrenschmidt [this message]
2005-10-20 14:33   ` John W. Linville

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=1129792626.7620.248.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=netdev@vger.kernel.org \
    --cc=pp@ee.oulu.fi \
    /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;
as well as URLs for NNTP newsgroup(s).