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

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.

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.

artur

  parent reply	other threads:[~2009-01-22  5:41 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 [this message]
2009-01-22 15:09         ` Christian Lamparter
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=497806E8.1060709@gmail.com \
    --to=art.08.09@gmail.com \
    --cc=chunkeey@web.de \
    --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).