[PARPORT] Re: lp fix

Andrea Arcangeli (arcangeli@mbox.queen.it)
Thu, 23 Jul 1998 18:34:11 +0200 (CEST)

On Fri, 10 Jul 1998, Andrea Arcangeli wrote:

>Please Linus apply this simple patch to the kernel. I noticed this bug
>only now ;-). People didn' t note it since they have fast printer and they
>don' t run with `tunelp /dev/lp0 -c 1` as me...

`tunelp /dev/lp0 -c 1` has nothing to do with that bug. The problem was
that developing the new lp irq logic I had not thought that a printing is
composed by many write(littlebuf) and not by only one write(infinitebuf)

>Patch against 108.

The patch I sent to you cured the problem but it caused CPU overloading
when the printer is offline when somebody try to print (not a big problem
but was not the best thing to do ;-).

In the last patch I set irq_detected to 1 and so with the printer down lp
was looping checking for the printer ready since when irq_detected is set
lp think that the printer will be ready soon and there' s no need to sleep
for a long time.

When irq_missed is set, lp instead revert to polling since lp understands
that the irq information is not more reliable. The polling mode per
definition must not overload the machine and everything seems to run
perfect this way.

So please apply this to 110.

--- linux/drivers/char/lp.c.110 Thu Jul 23 17:38:50 1998
+++ linux/drivers/char/lp.c Thu Jul 23 18:10:31 1998
@@ -323,8 +323,8 @@
                 return -ENXIO;
         lp_table[minor].last_error = 0;
- lp_table[minor].irq_detected = 1;
- lp_table[minor].irq_missed = 0;
+ lp_table[minor].irq_detected = 0;
+ lp_table[minor].irq_missed = 1;
         w_ctr(minor, LP_PSELECP | LP_PINITP);
Andrea[s] Arcangeli

-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --

This archive was generated by hypermail 2.0b3 on Wed 30 Dec 1998 - 10:18:03 EST