[PATCH] B43: Handle DMA RX descriptor underrun

Thommy Jakobsson thommyj at gmail.com
Sun May 5 15:09:47 EDT 2013



On Sun, 5 May 2013, Rafa? Mi?ecki wrote:

> 2013/5/5 Rafa? Mi?ecki <zajec5 at gmail.com>:
> > 2013/4/23 Thommy Jakobsson <thommyj at gmail.com>:
> >> Add handling of rx descriptor underflow. This fixes a fault that could
> >> happen on slow machines, where data is received faster than the CPU can
> >> handle. In such a case the device will use up all rx descriptors and
> >> refuse to send any more data before confirming that it is ok. This
> >> patch enables necessary interrupt to discover such a situation and will
> >> handle them by dropping everything in the ring buffer.
> >
> > Thommy: does it mean firmware actually ignores what we write to the
> > B43_DMA64_RXINDEX (recently renamed to the B43_DMA64_RXSTOPINDEX)? Is
> > our set_current_rxslot and op64_set_current_rxslot (same for 32bit
> > version) useless in this situation?
> 
> I've done some tests with this register. First I've added simple debugging:
> 
> [  326.496207] [DBG] old current:0      new current:1
> [  326.496215] [DBG] reading slot 0
> [  326.496237] [DBG] writing stop slot 1
> 
> [  326.921657] [DBG] old current:1      new current:2
> [  326.921665] [DBG] reading slot 1
> [  326.921691] [DBG] writing stop slot 2
> 
> I'm not sure how does it work. If we write 1 to RXSTOPINDEX it means
> firmware should not use slot "1", right? But then it'll IRQ and
> "current" will be 2 meaning there is a packet on slot 1.
> So I'm not sure anymore meaning of that index register.

See that this got stuck in my outbox, sorry. Michael already answered the 
question I think, but I send it anyway.


If we write 1 to rxstopindex it means stop when you reach that index. The 
difference in the normal loop is that the device has already marked what 
we write to RXSTOPINDEX as current. One cannot remove a slot from the 
firmware.

//Thommy





More information about the b43-dev mailing list