2.6.3-bk9 QA testing: firewire good, USB printing dead
Subsystems (2)
Hi everyone,
Ben Collins pointed me to 2.6.3-bk9 for my firewire troubles, and I'm happy to report that firewire is working like a champ -- never better. I'm burning 3 CDs simultaneously via firewire (2 controllers) with no problems. I expect 4 simultaneous burns will also work well. My devices have Oxford 911 chips, controllers are soundblaster audigy and a generic 3-port 1394a card.
However, 2.6.3-bk9's USB printing support appears to be dead. I can't get it to work reliably. Tested on Epson Stylus Photo 960 and a Brother Laser printer. catting files to /dev/usb/lp? tends to fail (process will get "stuck") and printer data stops flowing. This is on an Athlon XP (NForce2) system using the on-board USB. The official 2.6.3 release works fine. I'd expect these USB printing death symptoms to be easily reproducable on quite a few systems -- the problems hit me in the first few seconds of print testing. If they end up being more elusive, I can try to dig up more info for anyone who's interested in trying to isolate the problem.
Regards,
Daniel
Quoted 10 lines · Daniel Robbins
However, 2.6.3-bk9's USB printing support appears to be dead. I can't get it to work reliably. Tested on Epson Stylus Photo 960 and a Brother Laser printer. catting files to
/dev/usb/lp? tends to fail (process will get "stuck") and printer data stops flowing. This is on an Athlon XP (NForce2) system using the on-board USB. The official 2.6.3 release works fine. I'd expect these USB printing death symptoms to be easily reproducable on quite a few systems -- the problems hit me in the first few seconds of print testing. If they end up being more elusive, I can try to dig up more info for anyone who's interested in trying to isolate the problem.
Yes, I am. Do you get any error messages in your syslog when the printer hangs?
thanks,
greg k-h
Quoted 2 lines · Greg KH
Yes, I am. Do you get any error messages in your syslog when the printer hangs?
In some cases, I did. In other cases, I did not. Here are some "greatest hits... and I was also turning printers on and off and changing cables and testing different USB ports, so this first batch of log messages could correspond to those types of changes:
Feb 27 10:52:11 [kernel] drivers/usb/class/usblp.c: usblp0: off-line
Feb 27 10:52:44 [kernel] drivers/usb/class/usblp.c: usblp0: error -71 reading printer status
- Last output repeated 1140 times -
Feb 27 10:52:45 [kernel] usb 1-4: USB disconnect, address 9
Feb 27 10:52:45 [kernel] drivers/usb/class/usblp.c: usblp0: error -71 reading printer status
Feb 27 10:52:45 [kernel] drivers/usb/class/usblp.c: usblp0: removedThen when I was doing my initial testing with the Epson Stylus Photo 960 and the escputil program (as well as catting printer data directly to the printer,) I saw a bunch of stuff like this:
Feb 27 10:30:30 [kernel] usb 1-4.3: new full speed USB device using address 11 Feb 27 10:30:30 [kernel] ehci_hcd 0000:00:02.2: qh c1b91700 (#0) state 1 Feb 27 10:30:30 [kernel] drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 11 if 0 alt 0 proto 2 vid 0x04B8 pid 0x0005 Feb 27 10:31:01 [kernel] drivers/usb/class/usblp.c: usblp0: on fire
Specific symptoms were not having the printers respond to an escputil (Epson printer utility from gimp-print) head cleaning run. On the laser printer, data would get to the printer, but seemingly slowly, and I'd need to hit the "go" button on the printer to get the sheet to print rather than have the printer print on its own. It seems that both printers did not get the full amount of data that they were expecting, and either didn't respond at all or didn't complete the print job without manual assistance.
The problems with the laser printer didn't generally produce any log messages. Those with the Epson (particularly escputil) generally did.
With 2.6.3-bk9, I also had a block of two mainboard USB ports simply stop functioning -- to the point of even no longer sending power to the USB hub that I was using.
Hope that helps and let me know if you need any more info,
Daniel
Quoted 2 lines · Daniel Robbins
Feb 27 10:52:44 [kernel] drivers/usb/class/usblp.c: usblp0: error -71 reading printer status
- Last output repeated 1140 times -I have this identical problem using a 2.6.3-bk snapshot from a few days ago. My hardware is a Samsung ML-2150 printer (USB 2 High Speed) connected to a VIA EHCI embedded in my VIA KT-600 chipset.
I sent a four page print job through CUPS; during page 4, the printer timed out, and the CUPS "usb" process was hung and would not respond to any signals (not even -9). When I unplugged the printer's USB cable, the "usb" process died, and my syslog reported these error messages (but not before I unplugged the cable). In my case I had 3,458 of them.
Plugging the printer back in, usblp re-registered it, so I tried sending a job again, but could not get any data to flow to the printer without restarting the Linux system.
Quoted 4 lines · Daniel Robbins
With 2.6.3-bk9, I also had a block of two mainboard USB ports simply stop functioning -- to the point of even no longer sending power to the USB hub that I was using.
That's not good. Are these real usb 2.0 printers? Can you run them in 1.1 mode instead (just don't load the ehci-hcd driver)?
If that also fails, here's the only usblp patch in 2.6.3-bk9. If you revert it, does that solve the problem?
thanks,
greg k-h
drivers/usb/class/usblp.c +8 -12
@@ -603,7 +603,7 @@ {DECLARE_WAITQUEUE (wait, current);struct usblp *usblp = file->private_data; -int timeout, err =0 ; +int timeout, err =0 , transfer_length;size_t writecount =0 ;while (writecount < count) {
@@ -654,19 +654,13 @@continue ; } - writecount += usblp->writeurb->transfer_buffer_length; - usblp->writeurb->transfer_buffer_length =0 ; + transfer_length=(count - writecount); +if (transfer_length >USBLP_BUF_SIZE ) + transfer_length =USBLP_BUF_SIZE ; -if (writecount == count) { -up (&usblp->sem); -break ; - } + usblp->writeurb->transfer_buffer_length = transfer_length; - usblp->writeurb->transfer_buffer_length = (count - writecount) <USBLP_BUF_SIZE ? - (count - writecount) :USBLP_BUF_SIZE ; - -if (copy_from_user (usblp->writeurb->transfer_buffer, buffer + writecount, - usblp->writeurb->transfer_buffer_length)) { +if (copy_from_user (usblp->writeurb->transfer_buffer, buffer + writecount, transfer_length)) {up (&usblp->sem);return writecount ? writecount : -EFAULT ; }
@@ -683,6 +677,8 @@break ; }up (&usblp->sem); + + writecount += transfer_length; }return count;
Quoted 41 lines · Daniel Robbins
Quoted 2 lines · Greg KH
Yes, I am. Do you get any error messages in your syslog when the printer hangs?
In some cases, I did. In other cases, I did not. Here are some "greatest hits... and I was also turning printers on and off and changing cables and testing different USB ports, so this first batch of log messages could correspond to those types of changes:
Feb 27 10:52:11 [kernel] drivers/usb/class/usblp.c: usblp0: off-line Feb 27 10:52:44 [kernel] drivers/usb/class/usblp.c: usblp0: error -71 reading printer status - Last output repeated 1140 times - Feb 27 10:52:45 [kernel] usb 1-4: USB disconnect, address 9 Feb 2710:52:45 [kernel]
drivers/usb/class/usblp.c: usblp0: error -71 reading printer status Feb 27 10:52:45 [kernel]drivers/usb/class/usblp.c:
usblp0: removedThen when I was doing my initial testing with the Epson Stylus Photo 960 and the escputil program (as well as catting printer data directly to the printer,) I saw a bunch of stuff like this:
Feb 27 10:30:30 [kernel] usb 1-4.3: new full speed USB device usingaddress 11 Feb 27 10:30:30 [kernel]
ehci_hcd0000:00:02.2: qhc1b91700(#0) state 1 Feb 27 10:30:30 [kernel]drivers/usb/class/usblp.c: usblp0:
USB Bidirectional printer dev 11 if 0 alt 0 proto 2 vid0x04B8pid0x0005Feb 27 10:31:01 [kernel]drivers/usb/class/usblp.c: usblp0: on fireSpecific symptoms were not having the printers respond to an escputil (Epson printer utility from gimp-print) head cleaning run. On the laser printer, data would get to the printer, but seemingly slowly, and I'd need to hit the "go" button on the printer to get the sheet to print rather than have the printer print on its own. It seems that both printers did not get the full amount of data that they were expecting, and either didn't respond at all or didn't complete the print job without manual assistance.
The problems with the laser printer didn't generally produce any log messages. Those with the Epson (particularly escputil) generally did.
Quoted 7 lines
With 2.6.3-bk9, I also had a block of two mainboard USB ports simply stop functioning -- to the point of even no longer sending power to the USB hub that I was using.
Hope that helps and let me know if you need any more info,
Daniel
FYI these problems started for me about two weeks ago. I don't know what event started it but I am running the Gentoo distro, with 2.6.3-mm2 (it started these probs before 2.6.3-mm2), usb 1.1 OHCI with an Epson C80. Print jobs would hang and I had to unplug my usb cable to clear the job. I have reinstalled everything having to do with printing and I can now at least print but it hangs on the last page. I have to turn the printer off/on to continue. I assumed this was a cups issue but it sounds like a usb issue with the kernel?
Quoted 12 lines · Greg KH
Quoted 10 lines · Daniel Robbins
However, 2.6.3-bk9's USB printing support appears to be dead. I can't get it to work reliably. Tested on Epson Stylus Photo 960 and a Brother Laser printer. catting files to
/dev/usb/lp? tends to fail (process will get "stuck") and printer data stops flowing. This is on an Athlon XP (NForce2) system using the on-board USB. The official 2.6.3 release works fine. I'd expect these USB printing death symptoms to be easily reproducable on quite a few systems -- the problems hit me in the first few seconds of print testing. If they end up being more elusive, I can try to dig up more info for anyone who's interested in trying to isolate the problem.
Quoted 2 lines
Yes, I am. Do you get any error messages in your syslog when the printer hangs?
FWIW, saw the same thing here today. 2.6.2-mm1 was the previous kernel and it worked, 2.6.3-mm4 gives me a bunch of:
kernel: drivers/usb/class/usblp.c: usblp0: off-line
kernel: drivers/usb/class/usblp.c: usblp0: ok
kernel: drivers/usb/class/usblp.c: usblp0: off-line
kernel: drivers/usb/class/usblp.c: usblp0: ok
kernel: drivers/usb/class/usblp.c: usblp0: off-line
kernel: drivers/usb/class/usblp.c: usblp0: ok
kernel: drivers/usb/class/usblp.c: usblp0: off-line
kernel: drivers/usb/class/usblp.c: usblp0: ok
kernel: drivers/usb/class/usblp.c: usblp0: off-line
kernel: drivers/usb/class/usblp.c: usblp0: ok
No usb 2.x at all on this box.
Signature · 1 line
Jens Axboe
Does this patch (following my signature) fix the printer hangs? (It does for me.)
BTW, it's also an attachment on OSDL bugzilla #2221:
http://bugme.osdl.org/show_bug.cgi?id=2221
-Barry K. Nathan <[email protected]>
drivers/usb/class/usblp.c +11 -3
@@ -603,7 +603,7 @@ {DECLARE_WAITQUEUE (wait, current);struct usblp *usblp = file->private_data; -int timeout, err =0 , transfer_length; +int timeout, err =0 , transfer_length =0 ;size_t writecount =0 ;while (writecount < count) {
@@ -654,6 +654,16 @@continue ; } +/* We must increment writecount here, and not at the +* end of the loop. Otherwise, the final loop iteration may +* be skipped, leading to incomplete printer output. +*/ + writecount += transfer_length; +if (writecount == count) { +up (&usblp->sem); +break ; + } + transfer_length=(count - writecount);if (transfer_length >USBLP_BUF_SIZE ) transfer_length =USBLP_BUF_SIZE ;
@@ -677,8 +687,6 @@break ; }up (&usblp->sem); - - writecount += transfer_length; }return count;
Quoted 5 lines · Barry K. Nathan
Does this patch (following my signature) fix the printer hangs? (It does for me.)
BTW, it's also an attachment on OSDL bugzilla #2221:
http://bugme.osdl.org/show_bug.cgi?id=2221
Works for me, thanks (applied on top of 2.6.4-rc1-mm1)
Signature · 1 line
Jens Axboe
Quoted 38 lines · Barry K. Nathan
Does this patch (following my signature) fix the printer hangs? (It does for me.)
BTW, it's also an attachment on OSDL bugzilla #2221:
http://bugme.osdl.org/show_bug.cgi?id=2221-Barry K. Nathan <[email protected]>
diff -ruN
linux-2.6.3-bk2/drivers/usb/class/usblp.clinux-2.6.3-bk2-bkn1/drivers/usb/class/usblp.c---linux-2.6.3-bk2/drivers/usb/class/usblp.c2004-02-29 23:18:26.000000000
-0800 +++linux-2.6.3-bk2-bkn1/drivers/usb/class/usblp.c2004-02-29
23:17:24.000000000 -0800 @@ -603,7 +603,7 @@
{drivers/usb/class/usblp.c +0
-1DECLARE_WAITQUEUE (wait, current);struct usblp *usblp = file->private_data; - int timeout, err = 0, transfer_length; + int timeout, err = 0,
transfer_length= 0;drivers/usb/class/usblp.c +1
-0size_t writecount =0 ;while (writecount < count) {@@ -654,6 +654,16 @@continue ; } +/* We must increment writecount here, and not at the + * end of the loop. Otherwise, the final loop iteration may + * be skipped, leading
to incomplete printer output. + */drivers/usb/class/usblp.c +6
-0+ writecount += transfer_length; +if (writecount == count) { +up (&usblp->sem); +break ; + } + transfer_length=(count - writecount);if (transfer_length >USBLP_BUF_SIZE ) transfer_length =USBLP_BUF_SIZE ;
drivers/usb/class/usblp.c line 692
Quoted 8 lines
drivers/usb/class/usblp.c +0
-2@@ -677,8 +687,6 @@break ; }up (&usblp->sem); - - writecount += transfer_length; }return count;
I also applied this patch to 2.6.4-rc1-mm1 and my printer problem seems to be solved. This is the first time in two weeks that printing has worked properly for me. Thx :)
drivers/usb/class/usblp.c line 660
Quoted 5 lines · Barry K. Nathan
drivers/usb/class/usblp.c +4
-0+/* We must increment writecount here, and not at the +* end of the loop. Otherwise, the final loop iteration may +* be skipped, leading to incomplete printer output. +*/
You are correct.
I'm affraid this is my fault, for correcting a bug and letting another one take its place :(
It seems that this patch squashes them both. It should go in ASAP.
Signature · 2 lines
Paulo Marques - www.grupopie.com "In a world without walls and fences who needs windows and gates?"
firewire good, USB printing fixed, CD-ROM block device IO errors near end of media
Quoted 11 lines · Paulo Marques
drivers/usb/class/usblp.c line 660
Quoted 5 lines · Barry K. Nathan
drivers/usb/class/usblp.c +4
-0+/* We must increment writecount here, and not at the +* end of the loop. Otherwise, the final loop iteration may +* be skipped, leading to incomplete printer output. +*/ I'm affraid this is my fault, for correcting a bug and letting another one take its place :(
Quoted 1 line
It seems that this patch squashes them both. It should go in ASAP.
Sorry I have been unable to test the fix; Gentoo Linux 2004.0 just got released and I just became... err... ultra-busy? But it does look like others who experienced the exact problem I was having now have functional USB, so I'd expect it to work for me too.
I'm now experiencing kernel problems (apparently this isn't a new thing) related to how Linux maps a CD-ROM to a block device -- problems using dd to verify a burnt CD, where the kernel spits back random IO error messages as it nears the end of the burned area.
If anyone is interested, you can learn more about the problems in the following thread (I am experiencing the exact problems of the original poster.) The posts from Joerg Schilling are probably most helpful in finding a kernel solution to this problem:
http://lists.debian.org/cdwrite/2003/cdwrite-200310/threads.html#00009
zisofs makes a filesystem-based verify of a CD quite a time-consuming and inefficient process (due to seeking,) so it would be nice if a "dd" or "readcd"-based linear CD verify worked reliably under Linux.
Regards,
Daniel
Quoted 12 lines · Paulo Marques
drivers/usb/class/usblp.c line 660
Quoted 5 lines · Barry K. Nathan
drivers/usb/class/usblp.c +4
-0+/* We must increment writecount here, and not at the +* end of the loop. Otherwise, the final loop iteration may +* be skipped, leading to incomplete printer output. +*/ You are correct.
Quoted 4 lines
I'm affraid this is my fault, for correcting a bug and letting another one take its place :(
It seems that this patch squashes them both. It should go in ASAP.
This patch is already in Linus's tree.
thanks,
greg k-h