From: Oliver Neukum <oliver@neukum.org>
To: Ulrich Kunitz <kune@deine-taler.de>
Cc: Daniel Drake <dsd@gentoo.org>,
netdev@vger.kernel.org, linux-usb-devel@lists.sourceforge.net,
"John W. Linville" <linville@tuxdriver.com>
Subject: Re: [PATCH RFC] ZyDAS ZD1211 USB-WLAN driver
Date: Sat, 10 Jun 2006 13:49:06 +0200 [thread overview]
Message-ID: <200606101349.06498.oliver@neukum.org> (raw)
In-Reply-To: <20060610112306.GA19198@p15091797.pureserver.info>
Am Samstag, 10. Juni 2006 13:23 schrieb Ulrich Kunitz:
> On 06-06-04 00:25 Oliver Neukum wrote:
>
> > > > +static void disconnect(struct usb_interface *intf)
> > > > This is racy. It allows io to disconnected devices. You must take the
> > > > lock and set a flag that you test after you've taken the lock elsewhere.
> > >
> > > Will fix, thanks.
> >
> > You're welcome
>
> Not so fast, because I don't know what to fix.
>
> Actually there are two cases, when disconnect is called. The first
There are three cases. It can also be triggered by sysfs and usbfs.
> is, when the device is removed. The second is, when the kernel
> module is removed from the kernel. It should also be recognized
> that disconnect() must always succeed, so we have to ignore IO
> errors anyhow.
You can ignore IO errors in disconnect(). They are harmless.
> In the first case we don't need the IO and in the second case we
> have to do it, because otherwise, the device will not come up, if
> we load the driver again.
>
> Testing shows, that doing the IO doesn't create a lot of issues,
> there are some errors reported, but that's it and the second case
> just works fine. So there doesn't appear a problem and even if
> want to be "clean", I would like to know, how to distinguish both
> cases without trying to do IO with the device.
The problem is not that you may do IO _during_ disconnect. You may
do IO _after_ disconnect, even if usbfs might already have claimed
the device. Disconnect() must either terminate ongoing IO or wait for
it to end. And it must make sure that there'll be no IO afterwards.
Regards
Oliver
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
next prev parent reply other threads:[~2006-06-10 11:49 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-03 11:20 [PATCH RFC] ZyDAS ZD1211 USB-WLAN driver Daniel Drake
2006-06-03 17:51 ` [linux-usb-devel] " Oliver Neukum
2006-06-03 19:35 ` Daniel Drake
2006-06-03 22:25 ` Oliver Neukum
2006-06-04 16:29 ` John Que
2006-06-04 17:17 ` Oliver Neukum
2006-06-04 18:03 ` Rami Rosen
2006-06-04 21:51 ` Daniel Drake
2006-06-04 18:22 ` John Que
2006-06-04 19:06 ` Oliver Neukum
2006-06-04 21:45 ` Daniel Drake
2006-06-06 5:41 ` David Brownell
2006-06-10 11:23 ` Ulrich Kunitz
2006-06-10 11:49 ` Oliver Neukum [this message]
2006-06-10 12:40 ` Daniel Drake
2006-06-10 19:37 ` Daniel Drake
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=200606101349.06498.oliver@neukum.org \
--to=oliver@neukum.org \
--cc=dsd@gentoo.org \
--cc=kune@deine-taler.de \
--cc=linux-usb-devel@lists.sourceforge.net \
--cc=linville@tuxdriver.com \
--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).