Re: usblp: breakage with Canon BJC-3000

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 03 Jan 2009 00:04:56 +0000, Daniel Drake <dsd@xxxxxxxxxx> wrote:

> A change introduced somewhere between 2.6.21 and 2.6.24 resulted in 
> breakage when using usblp with a Canon BJC-3000. After printing one 
> page, the next job will hang indefinitely. Running "lsusb" resumes printing.

> https://bugs.gentoo.org/attachment.cgi?id=176041&action=view

> Any thoughts?

I'm not looking forward to cancelling any outstanding work entries,
so what do you think about something simpler:

diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index b5775af..9592a92 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -879,16 +879,19 @@ static int usblp_wwait(struct usblp *usblp, int nonblock)
 		if (rc <= 0)
 			break;
 
-		if (usblp->flags & LP_ABORT) {
-			if (schedule_timeout(msecs_to_jiffies(5000)) == 0) {
+		if (schedule_timeout(msecs_to_jiffies(1500)) == 0) {
+			if (usblp->flags & LP_ABORT) {
 				err = usblp_check_status(usblp, err);
 				if (err == 1) {	/* Paper out */
 					rc = -ENOSPC;
 					break;
 				}
+			} else {
+				/* Prod the printer, Gentoo#251237. */
+				mutex_lock(&usblp->mut);
+				usblp_read_status(usblp, usblp->statusbuf);
+				mutex_unlock(&usblp->mut);
 			}
-		} else {
-			schedule();
 		}
 	}
 	set_current_state(TASK_RUNNING);

Greetings,
-- Pete
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux