All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC/RFT] b43: Relax requirement for descriptors to be in the DMA zone
@ 2011-08-24 19:40 Larry Finger
  2011-08-24 19:53   ` Michael Büsch
  0 siblings, 1 reply; 14+ messages in thread
From: Larry Finger @ 2011-08-24 19:40 UTC (permalink / raw)
  To: zajec5; +Cc: Michael Buesch, b43-dev, linux-wireless

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, relaxation of the
requirement for the descriptors to be in the DMA zone is relaxed.

When a bounce buffer is needed, that is left in the DMA zone.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---

@Michael - Your idea seems to be correct.

@Rafal - Incorporate this in your other patch.


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);
@@ -589,7 +582,7 @@ static int setup_rx_descbuffer(struct b4
 	dmaaddr = map_descbuffer(ring, skb->data, ring->rx_buffersize, 0);
 	if (b43_dma_mapping_error(ring, dmaaddr, ring->rx_buffersize, 0)) {
 		/* ugh. try to realloc in zone_dma */
-		gfp_flags |= GFP_DMA;
+		gfp_flags |= GFP_KERNEL;
 
 		dev_kfree_skb_any(skb);
 
@@ -903,7 +896,7 @@ struct b43_dmaring *b43_setup_dmaring(st
 			kfree(ring->txhdr_cache);
 			ring->txhdr_cache = kcalloc(ring->nr_slots / TX_SLOTS_PER_FRAME,
 						    b43_txhdr_size(dev),
-						    GFP_KERNEL | GFP_DMA);
+						    GFP_KERNEL);
 			if (!ring->txhdr_cache)
 				goto err_kfree_meta;
 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [RFC/RFT] b43: Relax requirement for descriptors to be in the DMA zone
  2011-08-24 19:40 [RFC/RFT] b43: Relax requirement for descriptors to be in the DMA zone Larry Finger
@ 2011-08-24 19:53   ` Michael Büsch
  0 siblings, 0 replies; 14+ messages in thread
From: Michael Büsch @ 2011-08-24 19:53 UTC (permalink / raw)
  To: Larry Finger; +Cc: zajec5, Michael Buesch, b43-dev, linux-wireless

On Wed, 24 Aug 2011 14:40:24 -0500
Larry Finger <Larry.Finger@lwfinger.net> wrote:

> @Rafal - Incorporate this in your other patch.

I would rather like to have this as a separate patch and have
Rafal's other patch apply on _top_ of this.

> @@ -903,7 +896,7 @@ struct b43_dmaring *b43_setup_dmaring(st
>  			kfree(ring->txhdr_cache);
>  			ring->txhdr_cache = kcalloc(ring->nr_slots / TX_SLOTS_PER_FRAME,
>  						    b43_txhdr_size(dev),
> -						    GFP_KERNEL | GFP_DMA);
> +						    GFP_KERNEL);
>  			if (!ring->txhdr_cache)
>  				goto err_kfree_meta;
>  
> 

Why are you removing this? Seems wrong to me.
This seems to be part of the bounce-buffer mechanism, that we _do_ still need
for legacy 30bit devices.


-- 
Greetings, Michael.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [RFC/RFT] b43: Relax requirement for descriptors to be in the DMA zone
@ 2011-08-24 19:53   ` Michael Büsch
  0 siblings, 0 replies; 14+ messages in thread
From: Michael Büsch @ 2011-08-24 19:53 UTC (permalink / raw)
  To: Larry Finger; +Cc: zajec5, Michael Buesch, b43-dev, linux-wireless

On Wed, 24 Aug 2011 14:40:24 -0500
Larry Finger <Larry.Finger@lwfinger.net> wrote:

> @Rafal - Incorporate this in your other patch.

I would rather like to have this as a separate patch and have
Rafal's other patch apply on _top_ of this.

> @@ -903,7 +896,7 @@ struct b43_dmaring *b43_setup_dmaring(st
>  			kfree(ring->txhdr_cache);
>  			ring->txhdr_cache = kcalloc(ring->nr_slots / TX_SLOTS_PER_FRAME,
>  						    b43_txhdr_size(dev),
> -						    GFP_KERNEL | GFP_DMA);
> +						    GFP_KERNEL);
>  			if (!ring->txhdr_cache)
>  				goto err_kfree_meta;
>  
> 

Why are you removing this? Seems wrong to me.
This seems to be part of the bounce-buffer mechanism, that we _do_ still need
for legacy 30bit devices.


-- 
Greetings, Michael.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [RFC/RFT] b43: Relax requirement for descriptors to be in the DMA zone
  2011-08-24 19:53   ` Michael Büsch
@ 2011-08-24 20:59     ` Rafał Miłecki
  -1 siblings, 0 replies; 14+ messages in thread
From: Rafał Miłecki @ 2011-08-24 20:59 UTC (permalink / raw)
  To: Michael Büsch; +Cc: Larry Finger, Michael Buesch, b43-dev, linux-wireless

2011/8/24 Michael Büsch <m@bues.ch>:
> On Wed, 24 Aug 2011 14:40:24 -0500
> Larry Finger <Larry.Finger@lwfinger.net> wrote:
>
>> @Rafal - Incorporate this in your other patch.
>
> I would rather like to have this as a separate patch and have
> Rafal's other patch apply on _top_ of this.

/me agrees

Larry: don't care about my patches, do this one and I'll rebase my one.

-- 
Rafał

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [RFC/RFT] b43: Relax requirement for descriptors to be in the DMA zone
@ 2011-08-24 20:59     ` Rafał Miłecki
  0 siblings, 0 replies; 14+ messages in thread
From: Rafał Miłecki @ 2011-08-24 20:59 UTC (permalink / raw)
  To: Michael Büsch; +Cc: Larry Finger, Michael Buesch, b43-dev, linux-wireless

2011/8/24 Michael B?sch <m@bues.ch>:
> On Wed, 24 Aug 2011 14:40:24 -0500
> Larry Finger <Larry.Finger@lwfinger.net> wrote:
>
>> @Rafal - Incorporate this in your other patch.
>
> I would rather like to have this as a separate patch and have
> Rafal's other patch apply on _top_ of this.

/me agrees

Larry: don't care about my patches, do this one and I'll rebase my one.

-- 
Rafa?

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [RFC/RFT] b43: Relax requirement for descriptors to be in the DMA zone
  2011-08-25 17:29     ` Larry Finger
@ 2011-08-25 18:08       ` Rafał Miłecki
  -1 siblings, 0 replies; 14+ messages in thread
From: Rafał Miłecki @ 2011-08-25 18:08 UTC (permalink / raw)
  To: Larry Finger; +Cc: John W Linville, Michael Buesch, b43-dev, linux-wireless

W dniu 25 sierpnia 2011 19:29 użytkownik Larry Finger
<Larry.Finger@lwfinger.net> napisał:
> On 08/25/2011 12:24 PM, Rafał Miłecki wrote:
>>
>> 2011/8/25 Larry Finger<Larry.Finger@lwfinger.net>:
>>>
>>> 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.
>>
>> Larry, it is not clear to me from the commit message: did you test
>> that patch with your 14e4:4311?
>
> Yes.

Great, thanks for taking a look at this :)

-- 
Rafał

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [RFC/RFT] b43: Relax requirement for descriptors to be in the DMA zone
@ 2011-08-25 18:08       ` Rafał Miłecki
  0 siblings, 0 replies; 14+ messages in thread
From: Rafał Miłecki @ 2011-08-25 18:08 UTC (permalink / raw)
  To: Larry Finger; +Cc: John W Linville, Michael Buesch, b43-dev, linux-wireless

W dniu 25 sierpnia 2011 19:29 u?ytkownik Larry Finger
<Larry.Finger@lwfinger.net> napisa?:
> On 08/25/2011 12:24 PM, Rafa? Mi?ecki wrote:
>>
>> 2011/8/25 Larry Finger<Larry.Finger@lwfinger.net>:
>>>
>>> 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.
>>
>> Larry, it is not clear to me from the commit message: did you test
>> that patch with your 14e4:4311?
>
> Yes.

Great, thanks for taking a look at this :)

-- 
Rafa?

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [RFC/RFT] b43: Relax requirement for descriptors to be in the DMA zone
  2011-08-25 17:24   ` Rafał Miłecki
@ 2011-08-25 17:29     ` Larry Finger
  -1 siblings, 0 replies; 14+ messages in thread
From: Larry Finger @ 2011-08-25 17:29 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: John W Linville, Michael Buesch, b43-dev, linux-wireless

On 08/25/2011 12:24 PM, Rafał Miłecki wrote:
> 2011/8/25 Larry Finger<Larry.Finger@lwfinger.net>:
>> 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.
>
> Larry, it is not clear to me from the commit message: did you test
> that patch with your 14e4:4311?

Yes.

Larry

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [RFC/RFT] b43: Relax requirement for descriptors to be in the DMA zone
@ 2011-08-25 17:29     ` Larry Finger
  0 siblings, 0 replies; 14+ messages in thread
From: Larry Finger @ 2011-08-25 17:29 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: John W Linville, Michael Buesch, b43-dev, linux-wireless

On 08/25/2011 12:24 PM, Rafa? Mi?ecki wrote:
> 2011/8/25 Larry Finger<Larry.Finger@lwfinger.net>:
>> 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.
>
> Larry, it is not clear to me from the commit message: did you test
> that patch with your 14e4:4311?

Yes.

Larry

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [RFC/RFT] b43: Relax requirement for descriptors to be in the DMA zone
  2011-08-24 22:02 Larry Finger
@ 2011-08-25 17:24   ` Rafał Miłecki
  2011-08-25 17:24   ` Rafał Miłecki
  1 sibling, 0 replies; 14+ messages in thread
From: Rafał Miłecki @ 2011-08-25 17:24 UTC (permalink / raw)
  To: Larry Finger; +Cc: John W Linville, Michael Buesch, b43-dev, linux-wireless

2011/8/25 Larry Finger <Larry.Finger@lwfinger.net>:
> 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.

Larry, it is not clear to me from the commit message: did you test
that patch with your 14e4:4311?

-- 
Rafał

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [RFC/RFT] b43: Relax requirement for descriptors to be in the DMA zone
@ 2011-08-25 17:24   ` Rafał Miłecki
  0 siblings, 0 replies; 14+ messages in thread
From: Rafał Miłecki @ 2011-08-25 17:24 UTC (permalink / raw)
  To: Larry Finger; +Cc: John W Linville, Michael Buesch, b43-dev, linux-wireless

2011/8/25 Larry Finger <Larry.Finger@lwfinger.net>:
> 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.

Larry, it is not clear to me from the commit message: did you test
that patch with your 14e4:4311?

-- 
Rafa?

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [RFC/RFT] b43: Relax requirement for descriptors to be in the DMA zone
  2011-08-24 22:02 Larry Finger
@ 2011-08-24 22:17   ` Michael Büsch
  2011-08-25 17:24   ` Rafał Miłecki
  1 sibling, 0 replies; 14+ messages in thread
From: Michael Büsch @ 2011-08-24 22:17 UTC (permalink / raw)
  To: John W Linville
  Cc: Larry Finger, zajec5, Michael Buesch, b43-dev, linux-wireless

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.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [RFC/RFT] b43: Relax requirement for descriptors to be in the DMA zone
@ 2011-08-24 22:17   ` Michael Büsch
  0 siblings, 0 replies; 14+ messages in thread
From: Michael Büsch @ 2011-08-24 22:17 UTC (permalink / raw)
  To: John W Linville
  Cc: Larry Finger, zajec5, Michael Buesch, b43-dev, linux-wireless

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.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [RFC/RFT] b43: Relax requirement for descriptors to be in the DMA zone
@ 2011-08-24 22:02 Larry Finger
  2011-08-24 22:17   ` Michael Büsch
  2011-08-25 17:24   ` Rafał Miłecki
  0 siblings, 2 replies; 14+ messages in thread
From: Larry Finger @ 2011-08-24 22:02 UTC (permalink / raw)
  To: John W Linville; +Cc: zajec5, Michael Buesch, b43-dev, linux-wireless

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.

Larry
---

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2011-08-25 18:08 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-24 19:40 [RFC/RFT] b43: Relax requirement for descriptors to be in the DMA zone 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
2011-08-24 22:02 Larry Finger
2011-08-24 22:17 ` Michael Büsch
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

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.