From: David Miller <davem@davemloft.net>
To: remi.denis-courmont@nokia.com
Cc: oliver@neukum.org, netdev@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH] USB host CDC Phonet network interface driver
Date: Mon, 20 Jul 2009 07:55:56 -0700 (PDT) [thread overview]
Message-ID: <20090720.075556.92145474.davem@davemloft.net> (raw)
In-Reply-To: <200907200935.19103.remi.denis-courmont@nokia.com>
From: "Rémi Denis-Courmont" <remi.denis-courmont@nokia.com>
Date: Mon, 20 Jul 2009 09:35:18 +0300
> In the racy case, tx_complete() fires, incrementation in
> usbpn_xmit() and decrementation in tx_complete() will cancel each
> other. So, regardless of their respective order, tx_queue will be
> unchanged, and the assertion remains valid. A fortiori, it works
> fine if usbpn_xmit() races with more than one call of tx_complete().
You can only do the wakeup race free without deadlocking the TX queue
state if you grab the TX path lock, as TG3 does:
/* Need to make the tx_cons update visible to tg3_start_xmit()
* before checking for netif_queue_stopped(). Without the
* memory barrier, there is a small possibility that tg3_start_xmit()
* will miss it and cause the queue to be stopped forever.
*/
smp_mb();
if (unlikely(netif_queue_stopped(tp->dev) &&
(tg3_tx_avail(tp) > TG3_TX_WAKEUP_THRESH(tp)))) {
netif_tx_lock(tp->dev);
if (netif_queue_stopped(tp->dev) &&
(tg3_tx_avail(tp) > TG3_TX_WAKEUP_THRESH(tp)))
netif_wake_queue(tp->dev);
netif_tx_unlock(tp->dev);
}
next prev parent reply other threads:[~2009-07-20 14:55 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-17 9:56 [PATCH] USB host CDC Phonet network interface driver Rémi Denis-Courmont
2009-07-17 13:47 ` Oliver Neukum
[not found] ` <200907171547.39815.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2009-07-20 6:35 ` Rémi Denis-Courmont
[not found] ` <200907200935.19103.remi.denis-courmont-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2009-07-20 6:41 ` Oliver Neukum
2009-07-20 14:55 ` David Miller [this message]
2009-07-21 19:42 ` David Miller
[not found] ` <20090721.124217.03326492.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2009-07-21 20:14 ` Marcel Holtmann
2009-07-21 20:18 ` David Miller
[not found] ` <20090721.131816.116617596.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2009-07-21 20:20 ` Marcel Holtmann
2009-07-21 20:20 ` David Miller
2009-07-22 6:57 ` Rémi Denis-Courmont
-- strict thread matches above, loose matches on Subject: below --
2009-07-21 11:58 Rémi Denis-Courmont
2009-07-21 13:52 ` Dan Williams
[not found] ` <1248184373.6558.15.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-07-21 15:34 ` Marcel Holtmann
2009-07-22 8:37 ` Rémi Denis-Courmont
[not found] ` <200907221137.07005.remi.denis-courmont-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2009-07-22 8:40 ` Alan Cox
2009-07-22 8:41 ` Oliver Neukum
2009-07-22 9:11 ` Alan Cox
2009-07-22 9:15 ` Marcel Holtmann
2009-07-22 11:07 ` Rémi Denis-Courmont
2009-07-23 14:34 ` Dan Williams
[not found] ` <1248359692.774.22.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-07-24 12:58 ` Rémi Denis-Courmont
2009-07-24 12:01 ` Oliver Neukum
2009-07-24 12:14 ` Rémi Denis-Courmont
2009-07-24 12:31 ` Oliver Neukum
[not found] ` <200907241431.08858.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2009-07-24 12:48 ` Alan Cox
[not found] ` <20090724134805.0d9496be-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2009-07-24 13:00 ` Rémi Denis-Courmont
2009-07-24 14:12 ` Oliver Neukum
2009-07-24 14:19 ` Alan Cox
2009-07-24 16:59 ` Oliver Neukum
2009-07-24 18:00 ` Marcel Holtmann
2009-07-24 23:19 ` Alan Cox
2009-07-27 17:36 ` Dan Williams
2009-07-27 17:59 ` Marcel Holtmann
2009-07-15 13:59 Rémi Denis-Courmont
[not found] ` <1247666341-7121-1-git-send-email-remi.denis-courmont-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2009-07-15 14:20 ` Oliver Neukum
2009-07-16 7:12 ` Rémi Denis-Courmont
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=20090720.075556.92145474.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=oliver@neukum.org \
--cc=remi.denis-courmont@nokia.com \
/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).