On Fri, 11 May 2007, Oliver Neukum wrote: > Hi, > > it seems to me that you have to allow for drivers failling to restore > their devices' state. The obvious way would be to let post_reset() > return an error code and treat failure as unplug.
To begin with, you don't want to trait failure as unplug. There might be other drivers bound to other interfaces still working perfectly well; there's no reason to mess them up. You might want to treat it as unbind. However I'm not so sure. Failure to restore a device's state is only one of the things that can go wrong with a driver. Lots of other errors can arise too; it doesn't seem right to single one of them out for special treatment by the core. If a device encounters an error, it can simply refuse to do any more work. Return failure for all I/O requests. Or it can try to continue as best it can, probably getting lots of device errors along the way. Now perhaps you would like to add a subroutine to the core, which a driver could call to request that it be unbound. This could be done, although to be safe you'd probably want the actual unbind to occur in a different process context. But I doubt that such a routine would get used. So far nobody seems to have needed it. Alan Stern ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel