[PATCH] b43: use rx desc underrun interrupt

Thommy Jakobsson thommyj at gmail.com
Sun Apr 21 11:11:23 EDT 2013



> I had the same thought, but notice that you also need to update
> ring->current_slot in b43_dma_rx_discard.
> 
> When ring->current_slot update is missing (as in your original
> patch), you will introduce the same problem I hit by removing
> ops->set_current_rxslot(ring, slot) from b43_dma_rx (disabling
> RX underflow detection). Basically we break assumptions about
> ownership of descriptors (which descriptors are exclusively used
> by host and which can be written by DMA processor). So next time
> b43_dma_rx is called it may process descriptors that are updated
> by DMA processor at the same time (race condition).
Why would I update ring->current_slot? That should point where we are in 
the ring from the drivers perspective. Since that i always updated 
together with the rx index (set_current_rxslot) it will always be the same 
as the current index in hw (get_current_rxslot) in the b43_rx_discard. 
That is also where it should be.

It is true that I'll introduce a possibility for ownership problem with 
the original patch, but that will only last until the next time b43_dma_rx 
is called. Which is just after the b43_dma_rx_discard has 
exited since you always will get a rx interrupt at the same time as the 
underflow interrupt. This is also the case at each startup since rx index 
is initilised to the same thing as I used.

I have tested the index-1 that me and michael talked about, from the 
initial test is working just fine. Im running with only 8 rxslots to try 
to find any corner cases, so I see a lot of traffic drops though. This 
would also fix the ownership problem.

BTW, it is confusing that set and get current_rxslot doesn't updated and 
read the same register. 

About the FIFO errors I haven't looked at those at all. I did get some 
other errors when I pumped data at link speed into my router, but that was 
for TX.

//Thommy



More information about the b43-dev mailing list