Stuart MacDonald wrote:
From: "David Brownell" <[EMAIL PROTECTED]>

What happens when a semaphore is freed from under a sleeping holder?
Bad Stuff.  It's not legal.  Oopses could happen ...

Including the sleeping holder never waking up? 'Cause I saw that too.
That's Bad Stuff, yes.  Probably more likely than oopses, but...


Basically you need to decouple some "disconnect" processing
from the "last close".  The drivers that do this right are
the ones where (a) disconnect does only a partial cleanup
when the device is still open, but (b) when that open fd is
closed, the rest of that cleanup is done.

How does one link those? Ah. _disconnect runs, but eventually
serial_close will be called when the user space fd gets closed right?
Yes.


If so, this breaks my understanding that when _disconnect is finished
the driver must be ready for unloading. Is that not true then?
When disconnect() returns, that means the driver won't ever
try to touch that USB device ever again. It could touch some
other device later ...

The "driver module ready to unload" guarantee applies to the
module_exit() logic. By the time that's called, usbcore is
supposed to have disconnect()ed the driver from every device,
and every open through the driver should have been closed.

- Dave





-------------------------------------------------------
This SF.net email is sponsored by: Get the new Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to