Bug 243038

Summary: USB printer keeps disconnecting
Product: [Fedora] Fedora Reporter: Barry Stewart <blown.tire>
Component: kernelAssignee: Pete Zaitcev <zaitcev>
Status: CLOSED ERRATA QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: low    
Version: 7CC: cebbert, dave26, davej, hafflys, hawat.thufir, iny, saphipps, victor.lz
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-08-27 14:31:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
pl2305 usbmon trace
none
ML-2010 usbmon trace
none
/proc/bus/usb/devices file containing ML-2010 USB printer
none
proc bus usb devices none

Description Barry Stewart 2007-06-07 00:23:43 UTC
Description of problem:

When I plug in my Samsung ML-2010 usb printer, the kernel keeps disconnecting
and reconnecting it.

Version-Release number of selected component (if applicable):

kernel-2.6.21-1.3194.fc7
hal-0.5.9-8.fc7

How reproducible:

Every time

Steps to Reproduce:
1. Plug in your Samsung ML-2010 usb printer.
2. Watch the log.
3. Cry.
  
Actual results:

dmesg shows:

usb 1-5: new full speed USB device using ohci_hcd and address 32
usb 1-5: configuration #1 chosen from 1 choice
drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 32 if 0 alt 0
proto 2 vid 0x04E8 pid 0x326C
usb 1-5: USB disconnect, address 32
drivers/usb/class/usblp.c: usblp0: removed
usb 1-5: new full speed USB device using ohci_hcd and address 33
usb 1-5: configuration #1 chosen from 1 choice
drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 33 if 0 alt 0
proto 2 vid 0x04E8 pid 0x326C
usb 1-5: USB disconnect, address 33
drivers/usb/class/usblp.c: usblp0: removed
usb 1-5: new full speed USB device using ohci_hcd and address 34
usb 1-5: configuration #1 chosen from 1 choice
drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 34 if 0 alt 0
proto 2 vid 0x04E8 pid 0x326C
usb 1-5: USB disconnect, address 34
drivers/usb/class/usblp.c: usblp0: removed

This keeps repeating, with the "address" incrementing by 1 each time.

Expected results:

Printer should connect, and not keep disconnecting.

Additional info:

Relevant (I hope) lsmod:

usblp                  23361  0
lp                     22800  0
parport                48973  2 lp,parport_pc
ehci_hcd               42957  0
ohci_hcd               30277  0
uhci_hcd               34145  0

This guy also has the same problem:

http://permalink.gmane.org/gmane.org.user-groups.ale/52285

Comment 1 David Zeuthen 2007-06-07 00:37:01 UTC
That's a hardware and/or driver problem.

Comment 2 Pete Zaitcev 2007-06-07 02:19:12 UTC
Typically it's hardware, yes. A Linux host does not disconnect devices
(although in theory it can). But driver or HAL can precipitate it.

Barry, could you get me a trace with usbmon, please?
There's a HOWTO in
/usr/share/doc/kernel-doc-2.6.21/Documentation/usb/usbmon.txt

Comment 3 Chuck Ebbert 2007-06-07 16:22:57 UTC
*** Bug 243063 has been marked as a duplicate of this bug. ***

Comment 4 Pete Zaitcev 2007-06-07 18:33:16 UTC
OK, this seems like a bad pattern. Provisionally, I blame autosuspend,
because there weren't any changes to usblp.

Dave, I'll need your usbmon trace too, to compare it with Barry's.
Please do not drop it into the comments box, attach as a file instead.

Comment 5 dave 2007-06-07 22:56:40 UTC
Created attachment 156524 [details]
pl2305 usbmon trace

Comment 6 Barry Stewart 2007-06-08 19:38:30 UTC
Created attachment 156607 [details]
ML-2010 usbmon trace

Comment 7 Victor Lorenz 2007-06-11 21:13:59 UTC
Just upgraded to F7 (i386). Samsung ML-2010 printer installs ok but applications
(OOo Writer etc) say that printer is not connected to USB. Also was not able to
print test page when printer was added. Tried the remedy in bug #214189 but did
not work this time. Was working prior to upgrade FC6->F7.

Comment 8 dave 2007-06-14 23:45:44 UTC
upgraded to 2.6.21-1.3228.fc7, and new system-config-printer packages today,
hoping for a change, but no luck...

bad thing about this is i can't leave this device plugged in all of the time,
only when i need to print something... system will not boot up because the
kernel is waiting for all USB devices to be initialized.  Didn't find this out
until i removed the "quiet" option in grub.

anyway just wondering if the traces helped at all, or if there is anything else
i can do to help, any more info or testing or ideas...  Thanks.

Comment 9 Pete Zaitcev 2007-06-15 02:16:19 UTC
Yes, the traces were helpful. Here are the key excerpts, annotated:

Victor's:
ffff810076bb90c0 1796196332 S Ci:036:00 s a1 00 0000 0000 03ff 1023 <
ffff810076bb90c0 1796198338 C Ci:036:00 0 58 = 003a4d46 473a5361 6d73756e
673b434d 443a4744 493b4d44 4c3a4d4c 2d323031
  ---    2992us difference
ffff8100648ed1c0 1796201330 C Bi:036:03 -2 0
  <--- unlink
  --- 1999ms    difference
ffff810076bb90c0 1798200631 S Co:001:00 s 23 03 0002 0005 0000 0
  <--- Set port feature 2 port 5
ffff810076bb90c0 1798200637 C Co:001:00 0 0
ffff810037cf9380 1798223770 C Ii:001:01 0 2 = 2000
  <--- Disconnect interrupt

Dave's:
ffff81007109d980 1023042899 S Ci:068:00 s a1 00 0000 0001 03ff 1023 <
ffff81007109d980 1023050293 C Ci:068:00 0 82 = 00524d41 4e554641 43545552
45523a48 65776c65 74742d50 61636b61 72643b43
ffff81002a793180 1023051302 C Bi:068:02 -2 0
 <------------------- unlink
 --- 1999624us difference
ffff81007109d980 1025050926 S Co:068:00 s 00 03 0001 0000 0000 0
 <---- Set device feature
ffff81007109d980 1025051989 C Co:068:00 0 0
ffff81007109d980 1025051993 S Co:001:00 s 23 03 0002 0002 0000 0
 <---- Set port feature, feature 0x0002, port 2
ffff81007109d980 1025051996 C Co:001:00 0 0
ffff810037fbc1c0 1025186903 C Ii:001:01 0 1 = 04

Feature 2 is USB_PORT_FEAT_SUSPEND. So, when kernel attempts to
suspend the port, printer disconnects and reconnects.

The code is supposed to just work, there's not even a tunable to
disable it (except rebuilding whole kernel without CONFIG_USB_SUSPEND).
I'll have to poke the author of this.

Comment 10 Barry Stewart 2007-06-15 13:37:08 UTC
FYI - problem still exists after updating to kernel-2.6.21-1.3228.fc7
Also should have mentioned before that printer works fine in fc6 and win2k.

rpm -q --changelog kernel | grep -B 2 SUSP

* Fri May 04 2007 Dave Jones <davej>
- Reenable CONFIG_USB_SUSPEND
--

* Fri May 04 2007 Dave Jones <davej>
- Reenable CONFIG_USB_SUSPEND


Comment 11 Pete Zaitcev 2007-06-15 15:05:49 UTC
Oh by the way, Dave, Victor: please attach your /proc/bus/usb/devices
(preferably with the printer attached, although I understand it may be
difficult to catch it while it's not being processed, because of endless
reconnects). I would like to see which specific controller drives it.

Comment 12 Victor Lorenz 2007-06-15 15:54:15 UTC
(In reply to comment #11)
> Oh by the way, Dave, Victor: please attach your /proc/bus/usb/devices
> (preferably with the printer attached, although I understand it may be
> difficult to catch it while it's not being processed, because of endless
> reconnects). I would like to see which specific controller drives it.
/proc/bus/usb/devices  is an empty document (o bytes according to Konqueror)


Comment 13 Barry Stewart 2007-06-15 16:27:17 UTC
Created attachment 157131 [details]
/proc/bus/usb/devices file containing ML-2010 USB printer

Comment 14 dave 2007-06-17 01:56:45 UTC
Created attachment 157209 [details]
proc bus usb devices

Comment 15 Pete Zaitcev 2007-06-23 01:04:35 UTC
Mental note: Alan Stern's reply:
 http://marc.info/?l=linux-usb-devel&m=118192695002702

"By the way, the symptoms with the two printers weren't quite the same.  
dave's disconnected itself, but Barry's issued a remote wakeup request 
(in spite of the fact that remote wakeup wasn't enabled) and then 
failed to respond to a Get-Device-Status query -- it returned 1 byte 
instead of 2.  That failure is why it was disconnected."

I still do not know what to do about it. Developing...


Comment 16 dave 2007-06-23 02:21:44 UTC
I have a USB keyboard and a USB mouse and i do not have any disconnects with
them  only the USB<->parallel adapter.
this is the device by the way:
http://www.newegg.com/Product/Product.aspx?Item=N82E16812119003

I recompiled 2.6.21.5 (from kernel.org) with USB_SUSPEND turned off and this
fixes the disconnects.  However I'd rather not have to do this... Is there a way
to add this device to a list so that it does not use SUSPEND?

Thanks.



Comment 17 thufir 2007-06-23 23:49:16 UTC
Could this effect a Samsung ML-2510 printer under FC6?  I hate USB on linux for 
this reason.  I never know if it's a USB issue or something else.


thanks,

Thufir

Comment 18 Barry Stewart 2007-06-29 20:59:07 UTC
WORKAROUND:  My ML-2010 printer now works (no more disconnects) after adding
"usbcore.autosuspend=0" (without the quotes) to the kernel command line in
/etc/grub.conf

Comment 19 Chuck Ebbert 2007-06-29 21:02:16 UTC
USB autosuspend is now disabled in the Fedora 7 kernel.
Film at 11...

Comment 20 Chuck Ebbert 2007-07-06 20:41:08 UTC
Patch is in kernel 2.6.21-1.3255.fc7, in updates-testing now.
USB autosuspend is disabled by default but can be enabled by the user.

Comment 21 Sitsofe Wheeler 2007-08-16 06:59:22 UTC
(There is also an Ubuntu bug tracking autosuspend issues over at
https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.20/+bug/85488 )