diff mbox

[RFC/RFT] b43: Relax requirement for descriptors to be in the DMA zone

Message ID 4e55750c.GPPIrbNLynUMWY/U%Larry.Finger@lwfinger.net (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Larry Finger Aug. 24, 2011, 10:02 p.m. UTC
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
---

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Michael Büsch Aug. 24, 2011, 10:17 p.m. UTC | #1
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);
>
Rafał Miłecki Aug. 25, 2011, 5:24 p.m. UTC | #2
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?
Larry Finger Aug. 25, 2011, 5:29 p.m. UTC | #3
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
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rafał Miłecki Aug. 25, 2011, 6:08 p.m. UTC | #4
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 :)
diff mbox

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