On Sunday 26 July 2009 19:01:35 Larry Finger wrote:
> Michael Buesch wrote:
> > On Sunday 26 July 2009 17:37:10 Larry Finger wrote:
> >>
> >> The revised printk shows
> >>
> >> b43-phy0 warning: DMA queue overflow with free_slots = 0
> > 
> > Ok, it's a mac80211 bug then.
> 
> Perhaps not. I also got the ring->stopped WARN_ON.

Yeah. That just indicates that it _is_ a mac80211 bug.

> Is it possible that 
> a second transmission was held at the spin_lock_irqsave() when the
> queues were stopped. If that were the case, the following patch should
> fix the problem.

Nah, that patch cannot fix anything. You just move the check inside of the lock.
>From the outside view it stays the same. The lock makes it atomic.

> ---
> 
> Index: wireless-testing/drivers/net/wireless/b43/dma.c
> ===================================================================
> --- wireless-testing.orig/drivers/net/wireless/b43/dma.c
> +++ wireless-testing/drivers/net/wireless/b43/dma.c
> @@ -1334,17 +1334,20 @@ int b43_dma_tx(struct b43_wldev *dev, st
>       spin_lock_irqsave(&ring->lock, flags);
> 
>       B43_WARN_ON(!ring->tx);
> +
> +     if (unlikely(free_slots(ring) < TX_SLOTS_PER_FRAME)) {
> +             if (b43_debug(dev, B43_DBG_DMAVERBOSE)) {
> +                     b43warn(dev->wl, "DMA queue overflow with %d"
> +                             " free slots\n", free_slots(ring));
> +                     err = -ENOSPC;
> +                     goto out_unlock;
> +             }
> +     }
>       /* Check if the queue was stopped in mac80211,
>        * but we got called nevertheless.
>        * That would be a mac80211 bug. */
>       B43_WARN_ON(ring->stopped);
> 
> -     if (unlikely(free_slots(ring) < TX_SLOTS_PER_FRAME)) {
> -             b43warn(dev->wl, "DMA queue overflow\n");
> -             err = -ENOSPC;
> -             goto out_unlock;
> -     }
> -
>       /* Assign the queue number to the ring (if not already done before)
>        * so TX status handling can use it. The queue to ring mapping is
>        * static, so we don't need to store it per frame. */
> 
> ---
> 
> I do have one question. Should the "DMA queue overflow" message ever be 
> printed?
> It seems to me that we have a 'no harm - no foul' situation.

Yes. This is a situation that should not happen.
If we stop the queue in mac80211, we expect that mac80211 does not queue more
frames from then on.

-- 
Greetings, Michael.
_______________________________________________
Bcm43xx-dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev

Reply via email to