On Wed, May 11, 2005 at 04:25:03PM -0400, Greg Lee wrote:
> Greg, I'm jumping in here with some information that I hope helps a bit.

Don't take people off of the CC: they might not notice :)

> I
> presently work with several different kernels (2.4.17, 2.4.19, 2.4.21 and a
> recent 2.6 kernel which I'm not sure of the version) and have experienced
> this problem as well when using usbserial.  First, let me define what I see
> as "the problem".
> 
> When you interface with mobile  phones via USB, they tend to "come and go"
> on the USB port due to various events that occur on the phone, the primary
> example being power cycling the phone which is something I have to do
> regularly for my application.  The standard command to switch the power
> state on the phone is "AT+CFUN=1" to power it on and "AT+CFUN=0" to power
> it off.  When you switch the power state the USB port typically disappears
> and then reappears several times over the course of 5 seconds or so until
> it settles down.  Naturally this should invalidate any file descriptors
> that you have open for the serial device, however, this does not appear to
> work correctly.  The symptom that you see is if you write data to the USB
> device on a handle that was opened before switching the power state you
> will get a kernel OPPS.  I work around this by closing the file handle
> immediately after sending the AT+CFUN command, waiting 10 seconds and then
> attempt to reopen the port.

What oops do you get?  On a recent 2.6 kernel?

And yes, if a device goes away with a open file descriptor, on 2.6, you
will get a new usb device node for when the device shows back up.  It
will not reconnect to the same open file descriptor, sorry.

thanks,

greg k-h


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
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