[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <200907161012.42452.remi.denis-courmont@nokia.com>
Date: Thu, 16 Jul 2009 10:12:41 +0300
From: "Rémi Denis-Courmont"
<remi.denis-courmont@...ia.com>
To: ext Oliver Neukum <oliver@...kum.org>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>
Subject: Re: [PATCH] USB host CDC Phonet network interface driver
On Wednesday 15 July 2009 17:20:31 ext Oliver Neukum wrote:
> Am Mittwoch, 15. Juli 2009 15:59:01 schrieb Rémi Denis-Courmont:
>
> Hello,
>
> > + netif_stop_queue(dev);
> > + if (atomic_inc_return(&pnd->tx_queue) < dev->tx_queue_len)
> > + netif_wake_queue(dev);
>
> This is unelegant.
But I cannot think of any alternative that would not involve a spin lock and
disable IRQs. There is a race between qdisc and USB TX completion here.
I'm not sure what you're trying to suggest...?
> > +static void usbpn_disconnect(struct usb_interface *intf)
> > +{
> > + struct usbpn_dev *pnd = usb_get_intfdata(intf);
> > +
>
> What happens if this happens in the unexpected order?
Right, the data interface gets released twice. This "works" since
usb_driver_release_interface() has an explicit check. I will try to clean it
up anyway.
> > + if (intf != pnd->data_intf) {
> > + usb_driver_release_interface(&usbpn_driver, pnd->data_intf);
> > + return;
> > + }
> > +
> > + unregister_netdev(pnd->dev);
> > + usb_put_dev(pnd->usb);
> > +}
Thanks for the review.
--
Rémi Denis-Courmont
Nokia Devices R&D, Maemo Software, Helsinki
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists