1 |
Author: asn |
2 |
Date: 2009-03-29 20:45:07 +0000 (Sun, 29 Mar 2009) |
3 |
New Revision: 1539 |
4 |
|
5 |
Added: |
6 |
genpatches-2.6/trunk/2.6.28/2310_usblp-status-polling.patch |
7 |
Modified: |
8 |
genpatches-2.6/trunk/2.6.28/0000_README |
9 |
Log: |
10 |
Fixes print hanging in some printers (e.g. Canon BJC-3000) |
11 |
|
12 |
Modified: genpatches-2.6/trunk/2.6.28/0000_README |
13 |
=================================================================== |
14 |
--- genpatches-2.6/trunk/2.6.28/0000_README 2009-03-27 06:32:47 UTC (rev 1538) |
15 |
+++ genpatches-2.6/trunk/2.6.28/0000_README 2009-03-29 20:45:07 UTC (rev 1539) |
16 |
@@ -111,6 +111,10 @@ |
17 |
From: http://bugs.gentoo.org/252488 |
18 |
Desc: Move some PCI code around to fix compilation on alpha |
19 |
|
20 |
+Patch: 2310_usblp-status-polling.patch |
21 |
+From: http://bugs.gentoo.org/251237 |
22 |
+Desc: Fixes print hanging in some printers (e.g. Canon BJC-3000) |
23 |
+ |
24 |
Patch: 2400_iwl3945-adhoc-disconnect-fix.patch |
25 |
From: http://bugs.gentoo.org/254586 |
26 |
Desc: Fix adhoc disconnect issue in iwl3945 |
27 |
|
28 |
Added: genpatches-2.6/trunk/2.6.28/2310_usblp-status-polling.patch |
29 |
=================================================================== |
30 |
--- genpatches-2.6/trunk/2.6.28/2310_usblp-status-polling.patch (rev 0) |
31 |
+++ genpatches-2.6/trunk/2.6.28/2310_usblp-status-polling.patch 2009-03-29 20:45:07 UTC (rev 1539) |
32 |
@@ -0,0 +1,49 @@ |
33 |
+From: Pete Zaitcev <zaitcev@××××××.com> |
34 |
+Date: Wed, 7 Jan 2009 00:20:42 +0000 (-0700) |
35 |
+Subject: usblp: continuously poll for status |
36 |
+X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=dd44be6b17ac52238aa6c7f46b906d9fb76e7052 |
37 |
+ |
38 |
+usblp: continuously poll for status |
39 |
+ |
40 |
+The usblp in 2.6.18 polled for status regardless if we actually needed it. |
41 |
+At some point I dropped it, to save the batteries if nothing else. |
42 |
+As it turned out, printers exist (e.g. Canon BJC-3000) that need prodding |
43 |
+this way or else they stop. This patch restores the old behaviour. |
44 |
+If you want to save battery, don't leave jobs in the print queue. |
45 |
+ |
46 |
+I tested this on my printers by printing and examining usbmon traces |
47 |
+to make sure status is being requested and printers continue to print. |
48 |
+Tuomas Jäntti verified the fix on BJC-3000. |
49 |
+ |
50 |
+Signed-off-by: Pete Zaitcev <zaitcev@××××××.com> |
51 |
+Signed-off-by: Greg Kroah-Hartman <gregkh@××××.de> |
52 |
+--- |
53 |
+ |
54 |
+diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c |
55 |
+index 3f3ee13..d2747a4 100644 |
56 |
+--- a/drivers/usb/class/usblp.c |
57 |
++++ b/drivers/usb/class/usblp.c |
58 |
+@@ -880,16 +880,19 @@ static int usblp_wwait(struct usblp *usblp, int nonblock) |
59 |
+ if (rc <= 0) |
60 |
+ break; |
61 |
+ |
62 |
+- if (usblp->flags & LP_ABORT) { |
63 |
+- if (schedule_timeout(msecs_to_jiffies(5000)) == 0) { |
64 |
++ if (schedule_timeout(msecs_to_jiffies(1500)) == 0) { |
65 |
++ if (usblp->flags & LP_ABORT) { |
66 |
+ err = usblp_check_status(usblp, err); |
67 |
+ if (err == 1) { /* Paper out */ |
68 |
+ rc = -ENOSPC; |
69 |
+ break; |
70 |
+ } |
71 |
++ } else { |
72 |
++ /* Prod the printer, Gentoo#251237. */ |
73 |
++ mutex_lock(&usblp->mut); |
74 |
++ usblp_read_status(usblp, usblp->statusbuf); |
75 |
++ mutex_unlock(&usblp->mut); |
76 |
+ } |
77 |
+- } else { |
78 |
+- schedule(); |
79 |
+ } |
80 |
+ } |
81 |
+ set_current_state(TASK_RUNNING); |