Alan Stern wrote:

>> I've tried a suspend / resume cycle with another USB serial device, a 
>> Belkin RS-232 serial converter which uses the mct_u232 driver.
>>
>> And here we're seeing basically the same thing.  When initially plugged 
>> in, it comes up as /dev/ttyUSB0.  I can fire up minicom, and talk to 
>> another RS-232 device.
>>
>> When the system comes out of suspend, the serial converter is back as 
>> /dev/ttyUSB1.  The minicom application is of course clueless as to what 
>> has happened, and communication to the other RS-232 device no longer works.
>>
>> -------------------------------------------------------------------
>>
>> So the question in my mind is now this, is it possible to close the 
>> driver upon suspend?  Would this allow the device, when it is "plugged 
>> back in" to get the same /dev device file(s) it previously had.
> 
> If you exited from minicom or your other application before the 
> suspend and then restarted it after the resume, you should be okay.  Is 
> that what you're asking?

Yes, if you close the device file, and then do the suspend / resume, 
then the serial converter will be available again at the same 
/dev/ttyUSB0.  So that's fine.

> Just recently added to the mainline GIT tree is a way around your 
> problem.  (It has been in Greg KH's development tree for some time 
> now.)  You can read all about it in Documentation/usb/persist.txt.
> 
> To make this work, your device driver must define a "reset_resume"  
> method.  It will be called in place of the regular "resume" method if 
> the device has been reset.  It can reinitialize the device and put it 
> back in the original pre-suspend condition, after which it ought to 
> continue operating normally.  The application wouldn't notice a thing, 
> except perhaps that the serial connection had been lost.

OK, that sounds like what we want.  I'll clone Greg KH's tree and take a 
look.

I think I should also study the USB storage code, it seems to handle 
suspend/resume pretty well.  You can plug in a USB flash drive, mount 
it, suspend / resume, and it is still available, and still mounted.

Thanks for the pointer,

James Graves


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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