Am Freitag, 11. Mai 2007 16:27 schrieb Alan Stern:
> 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.

Yes, unbind.

> 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.

No, I propose reverting to the norm. Loss of power == disconnect
 
> If a device encounters an error, it can simply refuse to do any more work.

Thus leaking a device until virtually unbound.
 
> 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.

You are asking drivers to do something what some of them cannot do
in principle. To restore state from scratch you need to know the state
the device was in. Many drivers cannot know that.
 
> 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.

On the contrary. This propblem usually occurs during probe() where it is
handled exactly this way. You return an error.

        Regards
                Oliver

-------------------------------------------------------------------------
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

Reply via email to