[PATCH] b43: use rx desc underrun interrupt

Piotras piotras at gmail.com
Sun Apr 21 11:24:18 EDT 2013


On Sun, Apr 21, 2013 at 3:59 PM, Michael Büsch <m at bues.ch> wrote:
> On Sun, 21 Apr 2013 15:46:03 +0100
> Piotras <piotras at gmail.com> wrote:
>
>> On Sun, Apr 21, 2013 at 1:12 PM, Thommy Jakobsson <thommyj at gmail.com> wrote:
>> >
>> >
>> > On Sun, 21 Apr 2013, Michael Büsch wrote:
>> >
>> >> On Sun, 21 Apr 2013 11:01:11 +0200 (CEST)
>> >> Thommy Jakobsson <thommyj at gmail.com> wrote:
>> >>
>> >> > Why is it set to to beyond the ring when it is initilised?
>> >>
>> >> That's what broadcom does in their implementation. I guess that's the only reason.
>> >>
>> > Check, I'll give index-1 a go. It should be quite obvious if it works or
>> > not.
>>
>> Thommy,
>>
>> I had the same thought, but notice that you also need to update
>> ring->current_slot in b43_dma_rx_discard.
>
> I don't think so.
> We don't modify the descriptor pointer, but the stop index.

Yes.

My code was incorrect as I should ensure that ring->current_slot is
equal ops->get_current_rxslot(ring). As we are in the RX underflow,
B43_DMA32_RXSTATUS, B43_DMA32_RXINDEX and ring->current_slot should
already point to the same descriptor, so only set_current_rxslot is
needed.


>
>> I guess the following could be used to mark all descriptors for DMA
>> use from RX underflow interrupt or whenever we decide that number of
>> free descriptors is too low (not tested):
>>
>>   slot = prev_slot(ring, ops->get_current_rxslot(ring));
>>   wmb();
>>   ops->set_current_rxslot(ring, slot);
>
> get_current_rxslot() reads a different register than set_current_rxslot().
>
> get_current_rxslot() returns the descriptor pointer that the device is pointing to.
> set_current_rxslot() sets the _stop_ index.
> Yes, at least the last one is misnamed.
>
>> Not sure if FIFO overruns are really an issue and how to prevent them.
>> Maybe RX underflow should be handled in top half and reprogram device
>> to suspend receives (is this possible)?
>
> What is "top half"?

Top half interrupt handler (b43_do_interrupt).


>
> --
> Michael



More information about the b43-dev mailing list