Kernel Bug Tracker – Bug 23012
ftdi_sio /dev/ttyUSB error: "Resource Temporarily Unavailable"
Last modified: 2011-01-27 16:49:35 UTC
I am using a ftdi USB-to-serial device, which has worked in previous kernels. After a recent update to mainline 2.6.37, I am no longer able to access the device. Upon plugging in the device, the ftdi_sio module loads and /dev/ttyUSB0 appears. However, when I try to access the device, I get the error "Resource Temporarily Unavailable". There is no other process trying to access the device. After downgrading to 2.6.36, the problem is fixed.
On Tue, Nov 16, 2010 at 06:25:31AM +0000, firstname.lastname@example.org wrote:
> I am using a ftdi USB-to-serial device, which has worked in previous kernels.
> After a recent update to mainline 2.6.37, I am no longer able to access the
> device. Upon plugging in the device, the ftdi_sio module loads and
> /dev/ttyUSB0 appears. However, when I try to access the device, I get the
> error "Resource Temporarily Unavailable". There is no other process trying to
> access the device. After downgrading to 2.6.36, the problem is fixed.
Can you run 'git bisect' to determine which patch caused the problem?
And there is no 2.6.37 yet, only 2.6.37-rc2.
I am installing from the Ubuntu PPA, not source. The hash of the non-working revision is e53beacd23d9cb47590da6a7a7f6d417b941a994 and the working version is tag v2.6.36. I went to report the bug through my distribution, but since it's a build of mainline, the bug tool referred me to the kernel bugzilla.
Sorry to not be more help. If this is not enough information, please feel free to close.
Please attach the output of dmesg.
Created attachment 37782 [details]
dmesg from v2.6.37-rc2
dmesg output from v2.6.37-rc2 when repeatedly attaching and detaching a ftdi_sio USB-to-Serial converter.
I'm encountering the same bug... Have attached dmesg for v2.6.37-rc2 from the tar-ball.
will do a git bisect now.
After bisecting I found this: the "Resource temporarily unavailable" message occurs first with commit 1bfee5bc86fdaecc912e06080583eddab7263df2, "PM / Runtime: Merge synchronous and async runtime routines".
Did you send Alan an email?
Could you run strace on the program which is accessing the ttyUSB0?
I don't think this can be coming from the open() call because that would have printed a error message if it returned -EAGAIN.
Simon, can you try a little debugging? In drivers/usb/serial/usb-serial.c, in the serial_install() routine, make sure that usb_autopm_get_interface() is getting called and see what value it returns.
Sure, will look into this tonight.
Ok, figured out how to enable debugging in usb-serial.c... This is what I got:
Nov 27 23:35:39 gryphon kernel: [ 416.482926] drivers/usb/serial/usb-serial.c: serial_install
Nov 27 23:35:39 gryphon kernel: [ 416.482935] drivers/usb/serial/usb-serial.c: serial_install: usb_autopm_get_interface returned -11
For good measure I also did a strace on minicom (which is what I use to access ttyUSB0 at the moment).
Created attachment 38352 [details]
strace on minicom
Created attachment 38372 [details]
Set the supports_autosuspend for all USB serial drivers
It looks like the autosuspend support for USB serial drivers wasn't done quite correctly. This patch should fix the problem. Let me know how it works out.
The patch in #12 fixes the issue for me.
Handled-By : Alan Stern <email@example.com>
Patch : https://bugzilla.kernel.org/attachment.cgi?id=38372
On Friday, December 03, 2010, Alan Stern wrote:
> On Fri, 3 Dec 2010, Rafael J. Wysocki wrote:
> > This message has been generated automatically as a part of a summary report
> > of recent regressions.
> > The following bug entry is on the current list of known regressions
> > from 2.6.36. Please verify if it still should be listed and let the tracking team
> > know (either way).
> > Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=23012
> > Subject : ftdi_sio /dev/ttyUSB error: "Resource Temporarily Unavailable"
> > Submitter : Kevin Smith <firstname.lastname@example.org>
> > Date : 2010-11-16 06:25 (17 days old)
> > Handled-By : Alan Stern <email@example.com>
> > Patch : https://bugzilla.kernel.org/attachment.cgi?id=38372
> This has been fixed by commit bf03184a31a3286fc0ab30f838ddee8ba9f9b7b
> (USB: fix autosuspend bug in usb-serial).
This is still happening for at least Keyspan USA-19H and many 3G sticks using the option driver on stable 2.6.37.
It can't be the same thing, because 2.6.37 includes the bug fix above. It must be a different problem.
An additional, related problem has shown up in the meantime. It would affect some devices using the keyspan driver but not the option driver. The fix is posted here:
Hm, will try that patch thanks. I'll google for the 3g sticks' problems.