# /dev/usb/lp0 disappears intermittently

## phajdan.jr

I have a small print server and a HP LaserJet 1022 USB printer, and I keep having intermittent problems with printing. I think it's actually many problems, but let me start with the first one: /dev/usb/lp0 disappears intermittently.

Today I ssh-ed to the server, and there was no /dev/usb/lp0. dmesg said "usblp0: removed". The USB cable between the server and the printer was connected, the printer was powered on. The server has not been rebooted recently. I'm not sure about the printer. Somebody could have disconnected it temporarily, or power-cycled it. Or pressed that little red button on it, I dunno.

Anyway, after power-cycling the printer (i.e. flipping the hardware on-off switch to off and back on) dmesg said "usblp0: USB Bidirectional printer dev 5 if 0 alt 0 proto 2 vid 0x03F0 pid 0x2C17" and /dev/usb/lp0 is here again.

But this is not the first time it has happened, and I suspect it's going to happen again. Maybe you'll have some ideas what's going on, or share your tips for printing to HP printers.

```

Linux hq 2.6.32-hardened-r22 #1 SMP Wed Oct 27 09:38:42 CEST 2010 i686 AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ AuthenticAMD GNU/Linux

[ebuild   R   ] sys-fs/udev-151-r4  USE="-devfs-compat -extras -old-hd-rules (-selinux) -test" 0 kB

[ebuild   R   ] net-print/cups-1.3.11-r2  USE="acl avahi dbus jpeg pam perl png ppds python samba tiff zeroconf -X -gnutls -java -kerberos -ldap -php -slp -ssl -static -xinetd" LINGUAS="-de -en -es -et -fr -he -id -it -ja -pl -sv -zh_TW" 0 kB

```

Let me know if you need more info.

----------

## BradN

A couple suggestions:

Turn on verbose USB debugging and submit dmesg output with that on when the problem occurs (may want to use a script to monitor the device node and then take a dmesg snapshot in case this results in an overflow of messages)

This is more of a long shot, but if you're overclocking your motherboard, don't.  Some use a shared clock to drive lots of stuff, potentially including USB.  I have a motherboard where the USB can become unstable when the FSB is overclocked.

----------

## salahx

Actually, this is likely hplip and usblp fighting; HPLIP accesses the raw USB device - not through the lp interface. If you have no USB lp devices, you can blacklist the usblp driver.

----------

## MotivatedTea

One more thing that's a long shot, but usually an easy fix: if you're using a USB extension cable - don't. The USB specs limit the cable length to 3m for USB 1.1 and 5m for USB 2.0 (see here). That sounds like a lot, but I've seen a number of people try to go longer than that without realizing it. I've seen webcams, scanners, and printers all fail weirdly because of it. That might not be the problem in your case, but it also might be something easy for you to rule out. In case you're wondering, the "correct" way to reach a longer distance is to use a hub as a repeater.

----------

## phajdan.jr

 *BradN wrote:*   

> Turn on verbose USB debugging and submit dmesg output with that on when the problem occurs (may want to use a script to monitor the device node and then take a dmesg snapshot in case this results in an overflow of messages)

 

Good idea, done. Will post when the problem occurs again.

 *BradN wrote:*   

> This is more of a long shot, but if you're overclocking your motherboard, don't.

 

Right. I don't overclock.

 *salahx wrote:*   

> Actually, this is likely hplip and usblp fighting; HPLIP accesses the raw USB device - not through the lp interface. If you have no USB lp devices, you can blacklist the usblp driver.

 

Yeah, I was suspecting something like that. However, I have two USB printers connected to that box. Here's how they're configured in cups:

hp:/usb/HP_LaserJet_1022?serial=XXXXXXX

usb://Xerox/Phaser%206110

Do you think I can disable usblp in kernel?

 *MotivatedTea wrote:*   

> One more thing that's a long shot, but usually an easy fix: if you're using a USB extension cable - don't.

 

Right. I'm not using an extension cable.

----------

## aCOSwt

<trolling>  :Evil or Very Mad:  I am happy a dev gets into printing troubles !   :Twisted Evil:   I always thought we were alone facing these...   :Twisted Evil:   :Twisted Evil:  </trolling>

1/  *phajdan.jr wrote:*   

> dmesg said "usblp0: removed".

 

I have had this one too.

This is *not* an error per se. It just means that another driver wishes to control the device and first asks for usblp removal.

This is usually the case when using the hpcups backend which is incompatible with usblp.

And you seem be using the hpcups backend because of your connection link hp:/usb...

The real problem, if you actually get one, is usually reported in the next lines of dmesg... lines starting with hp.... reporting some error code and stating something about a communication problem with the device.

Do you get such following error ?

2/  *phajdan.jr wrote:*   

> dmesg said "usblp0: USB Bidirectional printer dev 5 if 0 alt 0 proto 2 vid 0x03F0 pid 0x2C17"

 

BTW, When you ask on some hp message lists about hpcups problems with bidirectional printers... the official answer is that you get troubles with your usb cable   :Rolling Eyes:   :Rolling Eyes: 

The truth is that hpcups has trouble handling correctly the bidirectional communication with old low-end products. There is an open bug on this topic about which nobody at upstream cares.  

3/  *phajdan.jr wrote:*   

> net-print/cups-1.3.11-r2.... Do you think I can disable usblp in kernel?

 

The answer is : not immediately !

a/ No if you use cups-1.3 with hpijs OR need your xerox

b/ Yes if you use cups-1.3 with hpcups backend, AND do not need your xerox

c/ Yes in any case if you upgrade to cups 1.4 which no longer needs usblp.

But depending on the real problem you get and did not describe, it might or might not be pertinent to.

=> What is your real problem with your HP ?

----------

## phajdan.jr

Thank you for helpful replies so far. Now let me update this thread with some more debugging info I got.

This time it's about usblp1, which does not use any HP stuff, but just "usb://Xerox/Phaser%206110". From dmesg:

```

Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: detected XactErr len 0/1024 retry 1

Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: detected XactErr len 0/1024 retry 2

Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: detected XactErr len 0/1024 retry 3

Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: detected XactErr len 0/1024 retry 4

Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: detected XactErr len 0/1024 retry 5

Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: detected XactErr len 0/1024 retry 6

Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: detected XactErr len 0/1024 retry 7

Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: detected XactErr len 0/1024 retry 8

Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: detected XactErr len 0/1024 retry 9

Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: detected XactErr len 0/1024 retry 10

Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: detected XactErr len 0/1024 retry 11

Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: detected XactErr len 0/1024 retry 12

Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: detected XactErr len 0/1024 retry 13

Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: detected XactErr len 0/1024 retry 14

Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: detected XactErr len 0/1024 retry 15

Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: detected XactErr len 0/1024 retry 16

Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: detected XactErr len 0/1024 retry 17

Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: detected XactErr len 0/1024 retry 18

Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: detected XactErr len 0/1024 retry 19

Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: detected XactErr len 0/1024 retry 20

Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: detected XactErr len 0/1024 retry 21

Nov  4 17:31:04 hq kernel: hub 1-0:1.0: state 7 ports 10 chg 0000 evt 0010

Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: GetStatus port 4 status 001002 POWER sig=se0 CSC

Nov  4 17:31:04 hq kernel: hub 1-0:1.0: port 4, status 0100, change 0001, 12 Mb/s

Nov  4 17:31:04 hq kernel: usb 1-4: USB disconnect, address 3

Nov  4 17:31:04 hq kernel: usb 1-4: unregistering device

Nov  4 17:31:04 hq kernel: usb 1-4: usb_disable_device nuking all URBs

Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: shutdown urb e2d63900 ep2in-bulk

Nov  4 17:31:04 hq kernel: usblp1: nonzero read bulk status received: -108

Nov  4 17:31:04 hq kernel: usblp1: error -108 reading from printer

Nov  4 17:31:04 hq kernel: usb 1-4: unregistering interface 1-4:1.0

Nov  4 17:31:04 hq kernel: drivers/usb/core/file.c: removing 1 minor

Nov  4 17:31:04 hq kernel: hub 1-0:1.0: debounce: port 4: total 100ms stable 100ms status 0x100

Nov  4 17:31:05 hq kernel: hub 1-0:1.0: state 7 ports 10 chg 0000 evt 0010

Nov  4 17:31:05 hq kernel: ehci_hcd 0000:00:13.5: GetStatus port 4 status 001c03 POWER sig=? CSC CONNECT

Nov  4 17:31:05 hq kernel: hub 1-0:1.0: port 4, status 0501, change 0001, 480 Mb/s

Nov  4 17:31:05 hq kernel: ehci_hcd 0000:00:13.5: GetStatus port 4 status 001002 POWER sig=se0 CSC

Nov  4 17:31:05 hq kernel: hub 1-0:1.0: debounce: port 4: total 125ms stable 100ms status 0x100

Nov  4 17:31:05 hq kernel: hub 1-0:1.0: state 7 ports 10 chg 0000 evt 0010

Nov  4 17:31:05 hq kernel: usblp1: removed

Nov  4 17:31:12 hq kernel: hub 1-0:1.0: state 7 ports 10 chg 0000 evt 0010

Nov  4 17:31:12 hq kernel: ehci_hcd 0000:00:13.5: GetStatus port 4 status 001803 POWER sig=j CSC CONNECT

Nov  4 17:31:12 hq kernel: hub 1-0:1.0: port 4, status 0501, change 0001, 480 Mb/s

Nov  4 17:31:12 hq kernel: hub 1-0:1.0: debounce: port 4: total 100ms stable 100ms status 0x501

Nov  4 17:31:12 hq kernel: ehci_hcd 0000:00:13.5: port 4 high speed

Nov  4 17:31:12 hq kernel: ehci_hcd 0000:00:13.5: GetStatus port 4 status 001005 POWER sig=se0 PE CONNECT

Nov  4 17:31:12 hq kernel: usb 1-4: new high speed USB device using ehci_hcd and address 6

Nov  4 17:31:13 hq kernel: ehci_hcd 0000:00:13.5: port 4 high speed

Nov  4 17:31:13 hq kernel: ehci_hcd 0000:00:13.5: GetStatus port 4 status 001005 POWER sig=se0 PE CONNECT

Nov  4 17:31:13 hq kernel: usb 1-4: default language 0x0409

Nov  4 17:31:13 hq kernel: usb 1-4: udev 6, busnum 1, minor = 5

Nov  4 17:31:13 hq kernel: usb 1-4: New USB device found, idVendor=04e8, idProduct=327b

Nov  4 17:31:13 hq kernel: usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3

Nov  4 17:31:13 hq kernel: usb 1-4: Product: Xerox Phaser 6110

Nov  4 17:31:13 hq kernel: usb 1-4: Manufacturer: Xerox

Nov  4 17:31:13 hq kernel: usb 1-4: SerialNumber: BBD247000.......

Nov  4 17:31:13 hq kernel: usb 1-4: usb_probe_device

Nov  4 17:31:13 hq kernel: usb 1-4: configuration #1 chosen from 1 choice

Nov  4 17:31:13 hq kernel: usb 1-4: adding 1-4:1.0 (config #1, interface 0)

Nov  4 17:31:13 hq kernel: usblp 1-4:1.0: usb_probe_interface

Nov  4 17:31:13 hq kernel: usblp 1-4:1.0: usb_probe_interface - got id

Nov  4 17:31:13 hq kernel: drivers/usb/core/file.c: looking for a minor, starting at 0

Nov  4 17:31:13 hq kernel: usblp1: USB Bidirectional printer dev 6 if 0 alt 0 proto 2 vid 0x04E8 pid 0x327B

Nov  4 17:31:13 hq kernel: drivers/usb/core/inode.c: creating file '006'

Nov  4 17:52:55 hq kernel: hub 1-0:1.0: state 7 ports 10 chg 0000 evt 0010

Nov  4 17:52:55 hq kernel: ehci_hcd 0000:00:13.5: GetStatus port 4 status 001002 POWER sig=se0 CSC

Nov  4 17:52:55 hq kernel: hub 1-0:1.0: port 4, status 0100, change 0001, 12 Mb/s

Nov  4 17:52:55 hq kernel: usb 1-4: USB disconnect, address 6

Nov  4 17:52:55 hq kernel: usb 1-4: unregistering device

Nov  4 17:52:55 hq kernel: usb 1-4: usb_disable_device nuking all URBs

Nov  4 17:52:55 hq kernel: usb 1-4: unregistering interface 1-4:1.0

Nov  4 17:52:55 hq kernel: drivers/usb/core/file.c: removing 1 minor

Nov  4 17:52:55 hq kernel: usblp1: removed

Nov  4 17:52:55 hq kernel: hub 1-0:1.0: debounce: port 4: total 100ms stable 100ms status 0x100

Nov  4 17:53:04 hq kernel: hub 1-0:1.0: state 7 ports 10 chg 0000 evt 0010

Nov  4 17:53:04 hq kernel: ehci_hcd 0000:00:13.5: GetStatus port 4 status 001803 POWER sig=j CSC CONNECT

Nov  4 17:53:04 hq kernel: hub 1-0:1.0: port 4, status 0501, change 0001, 480 Mb/s

Nov  4 17:53:05 hq kernel: hub 1-0:1.0: debounce: port 4: total 100ms stable 100ms status 0x501

Nov  4 17:53:05 hq kernel: ehci_hcd 0000:00:13.5: port 4 high speed

Nov  4 17:53:05 hq kernel: ehci_hcd 0000:00:13.5: GetStatus port 4 status 001005 POWER sig=se0 PE CONNECT

Nov  4 17:53:05 hq kernel: usb 1-4: new high speed USB device using ehci_hcd and address 7

Nov  4 17:53:05 hq kernel: ehci_hcd 0000:00:13.5: port 4 high speed

Nov  4 17:53:05 hq kernel: ehci_hcd 0000:00:13.5: GetStatus port 4 status 001005 POWER sig=se0 PE CONNECT

Nov  4 17:53:05 hq kernel: usb 1-4: default language 0x0409

Nov  4 17:53:05 hq kernel: usb 1-4: udev 7, busnum 1, minor = 6

Nov  4 17:53:05 hq kernel: usb 1-4: New USB device found, idVendor=04e8, idProduct=327b

Nov  4 17:53:05 hq kernel: usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3

Nov  4 17:53:05 hq kernel: usb 1-4: Product: Xerox Phaser 6110

Nov  4 17:53:05 hq kernel: usb 1-4: Manufacturer: Xerox

Nov  4 17:53:05 hq kernel: usb 1-4: SerialNumber: BBD247000.......

Nov  4 17:53:05 hq kernel: usb 1-4: usb_probe_device

Nov  4 17:53:05 hq kernel: usb 1-4: configuration #1 chosen from 1 choice

Nov  4 17:53:05 hq kernel: usb 1-4: adding 1-4:1.0 (config #1, interface 0)

Nov  4 17:53:05 hq kernel: usblp 1-4:1.0: usb_probe_interface

Nov  4 17:53:05 hq kernel: usblp 1-4:1.0: usb_probe_interface - got id

Nov  4 17:53:05 hq kernel: drivers/usb/core/file.c: looking for a minor, starting at 0

Nov  4 17:53:05 hq kernel: usblp1: USB Bidirectional printer dev 7 if 0 alt 0 proto 2 vid 0x04E8 pid 0x327B

Nov  4 17:53:05 hq kernel: drivers/usb/core/inode.c: creating file '007'

```

And of course it made some print jobs stay in the queue. After restarting cups they printed fine though. Any ideas what's going on?

----------

## aCOSwt

 *phajdan.jr wrote:*   

> 
> 
> ```
> 
> Nov  4 17:31:04 hq kernel: ehci_hcd 0000:00:13.5: detected XactErr len 0/1024 retry 1
> ...

 

 *EHCI Specifications wrote:*   

> XactErr is Set to a one by the Host Controller during status update in the case where the host did not receive a valid response from the device (Timeout, CRC, Bad PID, etc.)

 

Hmmm... not lighting that much apart form suggesting at first some hardware problem.

Does you usb port provide enough power ?

BTW, these traces + my preceeding post : You do need usblp !

If you no longer want it, upgrade cups to 1.4

----------

## phajdan.jr

 *aCOSwt wrote:*   

> Does you usb port provide enough power ?

 

How do I check?

 *aCOSwt wrote:*   

> BTW, these traces + my preceeding post : You do need usblp !
> 
> If you no longer want it, upgrade cups to 1.4

 

Yeah, I know. I'm just reluctant to use unstable cups on a stable server. It seems it has its own set of problems that prevent stabilization.

----------

## aCOSwt

 *phajdan.jr wrote:*   

> 
> 
> ```
> Nov  4 17:52:55 hq kernel: hub 1-0:1.0: state 7 ports 10 chg 0000 evt 0010
> ```
> ...

 

Is this consecutive to an action from your part on the device ? (Switch off/on for example) ?

Well... do you remember having done something at this precise date ?

----------

## phajdan.jr

 *aCOSwt wrote:*   

>  *phajdan.jr wrote:*   
> 
> ```
> Nov  4 17:52:55 hq kernel: hub 1-0:1.0: state 7 ports 10 chg 0000 evt 0010
> ```
> ...

 

I don't think so.

----------

## aCOSwt

 *phajdan.jr wrote:*   

> I don't think so.

 

I deduce from your traces that your EHCI controller thinks that the device :

Was unplugged at 17.31.04 then replugged at 17.31.12 then unplugged at 17.52.55 then replugged at 17.53.04

If you are for nothing in these events => 

- Either there is an electrical problem in your link,

- Or your bios powers the link down from time to time behind your back.

BTW, your Xerox is USB1 or USB2 ?

----------

## BradN

Try switching to a different USB port, between front/rear ports as well

----------

