netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.de>
To: Matthias Fuchs <matthias.fuchs@esd.eu>
Cc: netdev@vger.kernel.org, Socketcan-core@lists.berlios.de,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH v3] can: Add driver for esd CAN-USB/2 device
Date: Fri, 28 May 2010 17:26:00 +0200	[thread overview]
Message-ID: <201005281726.00855.oneukum@suse.de> (raw)
In-Reply-To: <201005281619.33845.matthias.fuchs@esd.eu>

Am Freitag, 28. Mai 2010 16:19:33 schrieb Matthias Fuchs:
> On Wednesday 26 May 2010 15:47, Oliver Neukum wrote:
> > Am Mittwoch, 26. Mai 2010 11:14:03 schrieb Matthias Fuchs:
> > > +       netdev->trans_start = jiffies;
> > > +
> > > +       /* Slow down tx path */
> > > +       if (atomic_read(&priv->active_tx_jobs) >= MAX_TX_URBS)
> > > +               netif_stop_queue(netdev);
> > 
> > Where is the queue started again?
> > 
> > 	Regards
> > 		Oliver
> 
> This is done in the ack-patch for sent messages:
> 
> static void esd_usb2_tx_done_msg(struct esd_usb2_net_priv *priv,
> 				 struct esd_usb2_msg *msg)
> {
> ...
> 	atomic_dec(&priv->active_tx_jobs);
> 
> 	netif_wake_queue(netdev);
> }

Oh, I see. I am afraid this is a race. You have no guarantee that
esd_usb2_tx_done_msg() runs after you stop the queue. If you do
it that way you must stop the queue before you submit the URB
due to which you want to stop it (and do the error handling)

	Regards
		Oliver

      reply	other threads:[~2010-05-28 15:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-26  9:14 [PATCH v3] can: Add driver for esd CAN-USB/2 device Matthias Fuchs
     [not found] ` <201005261114.03214.matthias.fuchs-iOnpLzIbIdM@public.gmane.org>
2010-05-26 10:15   ` Wolfgang Grandegger
     [not found]     ` <4BFCF4AD.6030000-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2010-05-26 12:38       ` Matthias Fuchs
2010-05-26 11:31   ` Viral Mehta
     [not found]     ` <70376CA23424B34D86F1C7DE6B9973430254343AD9-fVvhrSDAkVjuuPCCJ6VnObSn4PsL5ZDKvpI+GvaZM4lBDgjK7y7TUQ@public.gmane.org>
2010-05-28 15:25       ` Matthias Fuchs
2010-05-31  6:35         ` Viral Mehta
2010-05-26 13:47 ` Oliver Neukum
     [not found]   ` <201005261547.34596.oneukum-l3A5Bk7waGM@public.gmane.org>
2010-05-28 14:19     ` Matthias Fuchs
2010-05-28 15:26       ` Oliver Neukum [this message]

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=201005281726.00855.oneukum@suse.de \
    --to=oneukum@suse.de \
    --cc=Socketcan-core@lists.berlios.de \
    --cc=linux-usb@vger.kernel.org \
    --cc=matthias.fuchs@esd.eu \
    --cc=netdev@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).