PS mode STA trigger driver bug

Joe Parks jphstap
Sat Apr 17 16:31:38 PDT 2004


On Thu, 8 Apr 2004 21:46:04 -0700
Jouni Malinen <jkmaline at cc.hut.fi> wrote:

> On Thu, Apr 08, 2004 at 03:01:15PM -0400, Joe Parks wrote:
> 
> > When a STA with Power Saving mode enabled connects to one of my hostap boxes (firmware revisions 1.3.6 through 1.7.4 tested with driver revisions 0.1.1 through current CVS) it will *eventually* trigger the following:
> > 
> > wlan1: driver bug - prism2_transmit() called when previous TX was pending
> 
> It looks like the FIX comment in pspoll_send_buffered() (hostap_ap.c) of
> development branch is quite valid.. The driver is trying skip the
> possible TX queue when sending a buffered frame after a PS poll from the
> station. This bypasses some locking in the kernel and prism2_tx_80211()
> ends up being called concurrently by the next "normal" data frame.
> 
> I need to take a bit closer look at this at some point, but if you are
> interested in experimental changed, you could try to modify that
> pspoll_send_buffered() function. One trivial change would be to change
> the call to use kernel queue:
> 
>         if (skb->dev->hard_start_xmit(skb, skb->dev)) {
> 		PDEBUG(DEBUG_AP, "%s: TX failed for buffered frame (PS Poll)"
> 		       "\n", skb->dev->name);
> 		dev_kfree_skb(skb);
> 	}
> 
> into
> 
> 	dev_queue_xmit(skb);
> 
> another alternative would be to change this into
> 
>         spin_lock_bh(&skb->dev->xmit_lock);
>         if (skb->dev->hard_start_xmit(skb, skb->dev)) {
> 		spin_unlock_bh(&skb->dev->xmit_lock);
> 		PDEBUG(DEBUG_AP, "%s: TX failed for buffered frame (PS Poll)"
> 		       "\n", skb->dev->name);
> 		dev_kfree_skb(skb);
>         }
>         spin_unlock_bh(&skb->dev->xmit_lock);
> 
> this would at least try to send the frame faster (which would be useful
> for this PS Poll case)
> 
> 
> I haven't tried these, so if you happen to test them, I'm certainly
> interested in hearing whether they helped with this issue.

I've now tried both of these changes.

The first one ( dev_queue_xmit(skb); ) appears to work perfectly.  After 24 hours of testing on several devices with PS STAs associated, not a single "driver bug" has been observed. 

The second one seemed to reduce the problem (although that may have just been perception on my part) but it certainly didn't eliminate it.  I tested that one first because it looked somehow more attractive to me.




More information about the Hostap mailing list