Commit dd44be6b authored by Pete Zaitcev's avatar Pete Zaitcev Committed by Greg Kroah-Hartman

usblp: continuously poll for status

The usblp in 2.6.18 polled for status regardless if we actually needed it.
At some point I dropped it, to save the batteries if nothing else.
As it turned out, printers exist (e.g. Canon BJC-3000) that need prodding
this way or else they stop. This patch restores the old behaviour.
If you want to save battery, don't leave jobs in the print queue.

I tested this on my printers by printing and examining usbmon traces
to make sure status is being requested and printers continue to print.
Tuomas Jäntti verified the fix on BJC-3000.
Signed-off-by: default avatarPete Zaitcev <zaitcev@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 5c16034d
...@@ -880,16 +880,19 @@ static int usblp_wwait(struct usblp *usblp, int nonblock) ...@@ -880,16 +880,19 @@ static int usblp_wwait(struct usblp *usblp, int nonblock)
if (rc <= 0) if (rc <= 0)
break; break;
if (usblp->flags & LP_ABORT) { if (schedule_timeout(msecs_to_jiffies(1500)) == 0) {
if (schedule_timeout(msecs_to_jiffies(5000)) == 0) { if (usblp->flags & LP_ABORT) {
err = usblp_check_status(usblp, err); err = usblp_check_status(usblp, err);
if (err == 1) { /* Paper out */ if (err == 1) { /* Paper out */
rc = -ENOSPC; rc = -ENOSPC;
break; 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); set_current_state(TASK_RUNNING);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment