Re: [patch]usb_serial_driver insufficient for clean disconnect handling

Oliver Neukum <[email protected]>
Newsgroups gmane.linux.usb.devel
Organization Novell
Message-ID <[email protected]>
Am Donnerstag, 15. März 2007 23:10 schrieb Greg KH:
> On Thu, Mar 15, 2007 at 01:59:30PM +0100, Oliver Neukum wrote:
> > Hi,
> > 
> > it seems to me that for several usb serial drivers it is currently
> > impossible to cleanly handle disconnect, because usb_serial_driver
> > lacks a needed method.
> > 
> > As we often discussed, before a disconnect handler may return, it has
> > to finish all IO to the device. That means that usb_kill_urb() has to be
> > called on all URBs that might be active.
> > The serial driver does kill all standard URBs (bulk/interrupt in/out)
> > but it does not and indeed cannot deal with any private URBs (eg.
> > control URBs as in mos7720/mos7840).
> > The shutdown() method is unable to do the job because it can be
> > delayed if additional references to the port exist.
> > 
> > To allow killing them in time I propose this additional method for
> > usb_serial_driver.
> 
> This looks good to me, thanks for doing this.  I missed this change when
> we switched to the driver model.
> 
> However, shouldn't we just be calling "shutdown" here instead?  Lots of

Currently the locking is not good enough to call shutdown() so early.
It could be strengthened. Make your choice. I can and will do it
either way. Just the current state of affairs is bad.

> drivers do their tear-down in that function.  Unless you are going to
> start converting drivers to use this new callback?

A model with one callback having the clear meaning "stop all IO"
and a second callback "free all memory" has its merits.

But this code is your design. Tell me what you like best and I'll do
it.

	Regards
		Oliver

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.