linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Lamparter <chunkeey@web.de>
To: Artur Skawina <art.08.09@gmail.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [RFC][RFT][PATCH] p54usb: rx refill revamp
Date: Thu, 22 Jan 2009 16:09:27 +0100	[thread overview]
Message-ID: <200901221609.27401.chunkeey@web.de> (raw)
In-Reply-To: <497806E8.1060709@gmail.com>

On Thursday 22 January 2009 06:40:56 Artur Skawina wrote:
> Artur Skawina wrote:
> > Christian Lamparter wrote:
> >> A updated patch is attached (as file)
> > 
> > Will test.
> 
> Did a quick test of your patch on top of
>   current w-t/pending
> +
>   "p54usb: fix packet loss with first generation devices"
> + this:
> 
> diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
> index f754798..20818d6 100644
> --- a/drivers/net/wireless/p54/p54usb.c
> +++ b/drivers/net/wireless/p54/p54usb.c
> @@ -92,7 +92,7 @@ static void p54u_rx_cb(struct urb *urb)
>  
>         if (unlikely(urb->status)) {
>                 dev_kfree_skb_irq(skb);
> -           return;
> +         goto stash_urb;
>         }
>  
>         skb_put(skb, urb->actual_length);
> @@ -141,7 +141,7 @@ static void p54u_rx_cb(struct urb *urb)
>          * the less critical workqueue thread.
>          * This eases the memory pressure and prevents latency spikes.
>          */
> -
> +stash_urb:
>         urb->transfer_buffer = NULL;
>         urb->context = NULL;
>  
> That didn't work, various symptoms such as hostapd getting stuck, other unrelated
> usb devices breaking, machine frozen etc.
> 
> After applying the changes below it seemed to work alright, but i only tested for
> a few minutes.
> [line #s are wrong]
> 
> diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
> index 20818d6..643d517 100644
> --- a/drivers/net/wireless/p54/p54usb.c
> +++ b/drivers/net/wireless/p54/p54usb.c
> @@ -160,7 +173,7 @@ stash_urb:
>  		 * Huh? mac80211 isn't fully initialized yet?
>  		 * Please check your system, something bad is going on.
>  		 */
> -		WARN_ON(1);
> +		printk(KERN_WARNING "p54u_rx_cb workqueue missing\n");
>  		return;
>  	}
>  
> @@ -196,9 +210,9 @@ static void p54u_free_urbs(struct ieee80211_hw *dev)
>  {
>  	struct p54u_priv *priv = dev->priv;
>  
>  	cancel_work_sync(&priv->rx_refill_work);
> -	p54u_free_rx_refill_list(dev);
>  	usb_kill_anchored_urbs(&priv->submitted);
> +	p54u_free_rx_refill_list(dev);
>  }
>  
>  static int p54u_rx_refill(struct ieee80211_hw *dev)
> @@ -281,9 +297,9 @@ static int p54u_init_urbs(struct ieee80211_hw *dev)
>  	}
>  
>  	p54u_rx_refill(dev);
> -
>  err:
> -	p54u_free_rx_refill_list(dev);
> +	if (ret)
> +		p54u_free_rx_refill_list(dev);
>  	return ret;
>  }
>  
> The 'workqueue-missing' warnings appear on module init; there are several
> p54u_init_urbs(), p54u_free_urbs() call sequences.
> p54u_free_urbs() triggers the unlikely(urb->status) path while killing
> the urbs, and the first time this happens you get 32 warnings.
> After that everything's fine.

the workqueue is available as soon as ieee80211_register_hw completed,
however before we can do that, we have to get the eeprom for the MAC...

The reason why this works without "warning" is that we recycle the skb
of the eeprom readback... so the queue_work is never executed on start up
and if it is then something is very wrong with the device itself.
 
> I put the machine under some load and while there was usually 28..31 RX
> urbs queued, at one point the refilling stalled and the number went down
> from 31 to 1, then 6, slowly grew to ~30, then fell to 13, then recovered.
> All of this within ~5 mins of testing, w/ only a small amount of http 
> traffic generated by the client. it looks like i will have to try 
> allocating in the interrupt after all.

was this with your patch to use rx_refills urb pool for tx, or without?

Regards,
	Chr

  reply	other threads:[~2009-01-22 15:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-21 13:50 [RFC][RFT][PATCH] p54usb: rx refill revamp Christian Lamparter
2009-01-21 16:04 ` Artur Skawina
2009-01-21 18:24   ` Christian Lamparter
2009-01-21 19:32     ` Artur Skawina
2009-01-21 20:56       ` Christian Lamparter
2009-01-21 23:22         ` Artur Skawina
2009-01-22 15:00           ` Christian Lamparter
2009-01-22 15:43             ` Artur Skawina
2009-01-22 21:39               ` Christian Lamparter
2009-01-22 21:45                 ` Artur Skawina
2009-01-22 22:12                   ` Christian Lamparter
2009-01-22  5:40       ` Artur Skawina
2009-01-22 15:09         ` Christian Lamparter [this message]
2009-01-22 15:52           ` Artur Skawina
2009-01-22 16:01             ` Christian Lamparter
2009-01-22 19:19               ` Artur Skawina
2009-01-22 21:02                 ` Christian Lamparter
2009-01-22 22:05                   ` Artur Skawina
2009-01-22 22:39                     ` Christian Lamparter
2009-01-22 22:51                       ` Artur Skawina
2009-01-23  1:11                     ` Artur Skawina
2009-01-21 20:06 ` Larry Finger
2009-01-21 20:51   ` Christian Lamparter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200901221609.27401.chunkeey@web.de \
    --to=chunkeey@web.de \
    --cc=art.08.09@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).