Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 43980 - USB scanner support broken with libusb in gentoo-dev-sources-2.6.3, development-sources-2.6.4-rc1
Summary: USB scanner support broken with libusb in gentoo-dev-sources-2.6.3, developme...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: x86-kernel@gentoo.org (DEPRECATED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-07 13:34 UTC by Mark Purtill
Modified: 2004-04-27 20:21 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Config file for kernel (.config,30.45 KB, text/plain)
2004-03-07 13:36 UTC, Mark Purtill
Details
/var/log/messages (scanner-bug-messages.txt,21.96 KB, text/plain)
2004-03-07 13:37 UTC, Mark Purtill
Details
/var/log/messages from the -mm kernel (messages,13.73 KB, text/plain)
2004-04-15 20:36 UTC, Mark Purtill
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Purtill 2004-03-07 13:34:37 UTC
In the 2.6.3 kernel, the old USB scanner module had vanished (I don't
know why).  Apparently one is supposed to use the libusb code instead,
and I eventually figured out how to get that set up.

Unfortunately, when I do that, while the scanner works for previews
and small scans, on larger scans, quite likely the scanner hangs, and
I find this in /var/log/messages:

Mar  7 12:59:40 localhost kernel: usb 2-1: control timeout on ep0out

At this point, the only thing I've found that will clear the problem
is rebooting; if I turn the scanner on and off, I get something like
this:

Mar  7 13:01:40 localhost kernel: usb 2-1: USB disconnect, address 2
Mar  7 13:01:56 localhost kernel: usb 2-1: new full speed USB device using address 3
Mar  7 13:02:01 localhost kernel: usb 2-1: control timeout on ep0out

Here si a forum posts(possibly) reporting similar problems:

<http://forums.gentoo.org/viewtopic.php?t=139874>

But neither this not anything else I found searching on google (for
"control timeout on ep0out" among other things), have any solution to
the problem (other than the one person who suggested putting back the
scanner module).

The scanner is question is an Epson Perfection 1650, and it works fine
with the 2.4 series (and even 2.6.2) with the scanner module.  Let me
know if you need more information.  For now I've reverted to the 2.4
series as this is blocker for me to go to 2.6.3+.


Reproducible: Sometimes
Steps to Reproduce:
1. Install kernel 2.6.3
2. Emerge libusb and re-emerge sane backends to get the scanner to work at all.
3. Figure out hotplug to get the scanner to work for non-root users.
4. Scan a bunch of stuff
Actual Results:  
Eventually the scanner will probably wedge as indicated above.

Expected Results:  
Scanner should work.

Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.6.3-gentoo-r1)
=================================================================
System uname: 2.6.3-gentoo-r1 i686 AMD Athlon(tm) XP 1900+
Gentoo Base System version 1.4.3.13
Autoconf: sys-devel/autoconf-2.58-r1
Automake: sys-devel/automake-1.7.7
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-g -O2 -fstack-protector"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.1/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config
/usr/share/config /usr/share/texmf/dvipdfm/config/
/usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-g -O2 -fstack-protector"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs fixpackages nostrip sandbox userpriv"
GENTOO_MIRRORS="ftp://mirrors.tds.net/gentoo
http://mirror.tucdemonic.org/gentoo/ ftp://gentoo.mirrors.pair.com/
http://gentoo.mirrors.pair.com/ http://gentoo.ccccom.com ftp://gentoo.ccccom.com
 http://gentoo.oregonstate.edu
http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow X Xaw3d aalib apm arts avi berkdb canna cdr cjk crypt cups debug doc
dvd encode esd foomaticdb freetype freewnn gdbm gif gnome gpm gtk gtk2 guile
imlib java joystick jpeg kde libg++ libwww mad maildir matrox mbox mikmod
mozilla mozsvg mpeg mule ncurses nls oggvorbis opengl oss pam pdflib perl png
python qt quicktime readline ruby scanner sdl slang spell sse ssl svga tcltk
tcpd tetex tiff truetype usb video_cards_matrox x86 xinerama xml2 xmms xv zlib"
Comment 1 Mark Purtill 2004-03-07 13:36:07 UTC
Created attachment 27002 [details]
Config file for kernel

This is the .config file from the kenrel exhibiting the problem.
Comment 2 Mark Purtill 2004-03-07 13:37:37 UTC
Created attachment 27003 [details]
/var/log/messages

This is the contents of /ver/log/messages for a day when I had the problem.
Comment 3 Tim Yamin (RETIRED) gentoo-dev 2004-03-10 10:07:57 UTC
OK; this looks like a possible upstream bug in 2.6.3. Can you try out development-sources-2.6.3 and see if you get it there?

Try this as a possible temporary fix: ``umount /proc/bus/usb''; reboot the scanner; and ``mount /proc/bus/usb'' again.
Comment 4 Mark Purtill 2004-03-12 13:55:44 UTC
Okay, I'll give those a try, though it may be a few days before I have a chance.  I also noticed that there was a USB bug fixed in 2.6.4, so maybe that will fix the problem.
Comment 5 Mark Purtill 2004-03-27 18:37:33 UTC
Thanks for the reply and suggestions.  I tried development-sources-2.6.4 (not 2.6.3 since I took so long to try), but had the same problem.  (Though it looks like my guess as it being the size of the image causing the problem was wrong; I have an image that seems to cause the problem most of the time, but some bigger scans work okay.  Again, no problems with the 2.4 series using the kernel usb scanner modules.)

Also, I tried the workaround you suggested, but it didn't help; I get the same sort of messages when I remount /proc/bus/usb and plug the scanner back in:

Mar 27 18:22:15 localhost kernel: usb 2-1: new full speed USB device using address 6
Mar 27 18:22:20 localhost kernel: usb 2-1: control timeout on ep0out

Note that I have a USB mouse, if that matters.

Another google search again turned up others with the problem (such as <http://www.mail-archive.com/newbie@linux-mandrake.com/msg153711.html> on a mandrake system) but no one with a solution.
Comment 6 Mark Purtill 2004-03-27 18:54:51 UTC
Sorry, that should be development-sources-2.6.4-r1.
Comment 7 Mark Purtill 2004-03-27 18:55:25 UTC
Sorry, development-sources-2.6.4-rc1 (not -r1).
Comment 8 Jason Cox (RETIRED) gentoo-dev 2004-04-02 00:49:10 UTC
Would you mind trying to pass pci=noacpi on the knerel line in {grub|lilo}.conf file and see what it does?
Comment 9 Mark Purtill 2004-04-02 17:38:33 UTC
I have ACPI turned off in the kernel configuration:

# CONFIG_ACPI is not set

So would pci=noacpi make any difference?
Comment 10 Jason Cox (RETIRED) gentoo-dev 2004-04-11 19:30:28 UTC
You're right, passing pci=noacpi on the kernel line wouldn't make any difference. Could you try enabling acpi and see if that sorts things out?
Comment 11 Greg Kroah-Hartman (RETIRED) gentoo-dev 2004-04-12 14:02:02 UTC
this was a kernel bug in usbfs, and is fixed in the latest -mm releases.

Can you try it to see if it is fixed in there?
Comment 12 Mark Purtill 2004-04-12 21:34:35 UTC
Okay, I'll give those a try (starting with the mm kernel).
Comment 13 Mark Purtill 2004-04-15 19:54:27 UTC
I tried mm-sources-2.6.5-r1.  It was worse: any attempt to access the scanner (e.g., scanimage -L) hangs the process, and nothing short of a reboot would get rid of it.  There aren't any helpful USB messages in /var/log/messages (though I'll attach it anyway), even though I had CONFIG_USB_DEBUG=y in my .config.

Oddly, during all this, the USB mouse works fine.  (Note that there seem to be two USB hubs; the mouse and the scanner are on different hubs.)

I'll try turning on ACPI when I have a change, hopefully this weekend.

Comment 14 Mark Purtill 2004-04-15 20:35:24 UTC
I tried swapping where the scanner was plugged in, so it was on the same hub as the mouse.  That made no difference.

Also, I keep forgetting to mention: after one of the these USB hangs (with any of the kernels), shutdown hangs when its shutting down the USB subsystem.  "rmmod uhci_hcd" also hangs; I get this message (either in shutdown or rmmod):

Apr 15 20:34:21 localhost kernel: uhci_hcd 0000:00:11.2: remove, state 1
Apr 15 20:34:21 localhost kernel: usb usb1: USB disconnect, address 1
Apr 15 20:34:21 localhost kernel: usb 1-1: USB disconnect, address 2
Comment 15 Mark Purtill 2004-04-15 20:36:34 UTC
Created attachment 29391 [details]
/var/log/messages from the -mm kernel
Comment 16 Mark Purtill 2004-04-17 11:09:22 UTC
According to this, <http://bugme.osdl.org/show_bug.cgi?id=2342>, the mm2 version had the second USB problem, so maybe the -mm1 did too.  I see there's an -mm6 now in portage, so I'll give that a try.
Comment 17 Mark Purtill 2004-04-19 12:09:03 UTC
It looks like with the mm-sources-2.6.5-r6, my scanner is functioning without either of the problems I reported above.  (Since the first problem is sporatic, I can't be completely sure, but I've done more scans than I could before.)  I'm therefore reducing the severity level of the bug, but it shouldn't be closed until the fix makes it into the gentoo kernel.
Comment 18 Greg Kroah-Hartman (RETIRED) gentoo-dev 2004-04-21 17:16:49 UTC
Should be now in the 2.6.6-rc2 kernel.
Comment 19 Mark Purtill 2004-04-21 21:32:17 UTC
Thanks, I'll check that out as soon as it gets into Portage.
Comment 20 Michal Januszewski (RETIRED) gentoo-dev 2004-04-25 08:38:31 UTC
It's in Portage now - is the problem fixed?
Comment 21 Mark Purtill 2004-04-27 19:11:06 UTC
Yes, the bug appears to be fixed in development-sources-2.6.6_rc2.
Comment 22 Greg Kroah-Hartman (RETIRED) gentoo-dev 2004-04-27 20:21:48 UTC
Yeah, it's fixed then with no work from us :)