All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael Büsch" <m@bues.ch>
To: John W Linville <linville@tuxdriver.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
	zajec5@gmail.com, Michael Buesch <mb@bu3sch.de>,
	b43-dev@lists.infradead.org, linux-wireless@vger.kernel.org
Subject: [RFC/RFT] b43: Relax requirement for descriptors to be in the DMA zone
Date: Thu, 25 Aug 2011 00:17:15 +0200	[thread overview]
Message-ID: <20110825001715.4806077c@milhouse> (raw)
In-Reply-To: <4e55750c.GPPIrbNLynUMWY/U%Larry.Finger@lwfinger.net>

On Wed, 24 Aug 2011 17:02:52 -0500
Larry Finger <Larry.Finger@lwfinger.net> wrote:

> When 64-bit DMA was first used, there were problems with the
> BCM4311 (14e4:4311). The problem was "fixed" by using the GFP_DMA
> flag in the allocation of coherent ring descriptor memory.
> 
> The original problem is now believed to have been due to bugs in
> the 64-bit DMA implementation in the rest of the kernel, and that
> those bugs have been fixed. Accordingly, the requirement for the
> descriptors to be in the DMA zone is relaxed.
> 
> Bounce buffers are left in the DMA zone.
> 
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> ---
> 
> John,
> 
> This material is for next.

John, please apply this even though it's marked RFC, unless somebody
objects in reasonable time, which I don't expect.

You can also add

Signed-off-by: Michael Buesch <m@bues.ch>

if you desire.

> Index: wireless-testing-new/drivers/net/wireless/b43/dma.c
> ===================================================================
> --- wireless-testing-new.orig/drivers/net/wireless/b43/dma.c
> +++ wireless-testing-new/drivers/net/wireless/b43/dma.c
> @@ -393,14 +393,7 @@ static int alloc_ringmemory(struct b43_d
>  	 * has shown that 4K is sufficient for the latter as long as the buffer
>  	 * does not cross an 8K boundary.
>  	 *
> -	 * For unknown reasons - possibly a hardware error - the BCM4311 rev
> -	 * 02, which uses 64-bit DMA, needs the ring buffer in very low memory,
> -	 * which accounts for the GFP_DMA flag below.
> -	 *
> -	 * The flags here must match the flags in free_ringmemory below!
>  	 */
> -	if (ring->type == B43_DMA_64BIT)
> -		flags |= GFP_DMA;
>  	ring->descbase = dma_alloc_coherent(ring->dev->dev->dma_dev,
>  					    B43_DMA_RINGMEMSIZE,
>  					    &(ring->dmabase), flags);
> 



-- 
Greetings, Michael.

WARNING: multiple messages have this Message-ID (diff)
From: "Michael Büsch" <m@bues.ch>
To: John W Linville <linville@tuxdriver.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
	zajec5@gmail.com, Michael Buesch <mb@bu3sch.de>,
	b43-dev@lists.infradead.org, linux-wireless@vger.kernel.org
Subject: Re: [RFC/RFT] b43: Relax requirement for descriptors to be in the DMA zone
Date: Thu, 25 Aug 2011 00:17:15 +0200	[thread overview]
Message-ID: <20110825001715.4806077c@milhouse> (raw)
In-Reply-To: <4e55750c.GPPIrbNLynUMWY/U%Larry.Finger@lwfinger.net>

On Wed, 24 Aug 2011 17:02:52 -0500
Larry Finger <Larry.Finger@lwfinger.net> wrote:

> When 64-bit DMA was first used, there were problems with the
> BCM4311 (14e4:4311). The problem was "fixed" by using the GFP_DMA
> flag in the allocation of coherent ring descriptor memory.
> 
> The original problem is now believed to have been due to bugs in
> the 64-bit DMA implementation in the rest of the kernel, and that
> those bugs have been fixed. Accordingly, the requirement for the
> descriptors to be in the DMA zone is relaxed.
> 
> Bounce buffers are left in the DMA zone.
> 
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> ---
> 
> John,
> 
> This material is for next.

John, please apply this even though it's marked RFC, unless somebody
objects in reasonable time, which I don't expect.

You can also add

Signed-off-by: Michael Buesch <m@bues.ch>

if you desire.

> Index: wireless-testing-new/drivers/net/wireless/b43/dma.c
> ===================================================================
> --- wireless-testing-new.orig/drivers/net/wireless/b43/dma.c
> +++ wireless-testing-new/drivers/net/wireless/b43/dma.c
> @@ -393,14 +393,7 @@ static int alloc_ringmemory(struct b43_d
>  	 * has shown that 4K is sufficient for the latter as long as the buffer
>  	 * does not cross an 8K boundary.
>  	 *
> -	 * For unknown reasons - possibly a hardware error - the BCM4311 rev
> -	 * 02, which uses 64-bit DMA, needs the ring buffer in very low memory,
> -	 * which accounts for the GFP_DMA flag below.
> -	 *
> -	 * The flags here must match the flags in free_ringmemory below!
>  	 */
> -	if (ring->type == B43_DMA_64BIT)
> -		flags |= GFP_DMA;
>  	ring->descbase = dma_alloc_coherent(ring->dev->dev->dma_dev,
>  					    B43_DMA_RINGMEMSIZE,
>  					    &(ring->dmabase), flags);
> 



-- 
Greetings, Michael.

  reply	other threads:[~2011-08-24 22:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-24 22:02 [RFC/RFT] b43: Relax requirement for descriptors to be in the DMA zone Larry Finger
2011-08-24 22:17 ` Michael Büsch [this message]
2011-08-24 22:17   ` Michael Büsch
2011-08-25 17:24 ` Rafał Miłecki
2011-08-25 17:24   ` Rafał Miłecki
2011-08-25 17:29   ` Larry Finger
2011-08-25 17:29     ` Larry Finger
2011-08-25 18:08     ` Rafał Miłecki
2011-08-25 18:08       ` Rafał Miłecki
  -- strict thread matches above, loose matches on Subject: below --
2011-08-24 19:40 Larry Finger
2011-08-24 19:53 ` Michael Büsch
2011-08-24 19:53   ` Michael Büsch
2011-08-24 20:59   ` Rafał Miłecki
2011-08-24 20:59     ` Rafał Miłecki

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=20110825001715.4806077c@milhouse \
    --to=m@bues.ch \
    --cc=Larry.Finger@lwfinger.net \
    --cc=b43-dev@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mb@bu3sch.de \
    --cc=zajec5@gmail.com \
    /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 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.