linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Osterlund <peter.osterlund@mailbox.swipnet.se>
To: Andrea Arcangeli <andrea@suse.de>
Cc: linux-kernel@vger.kernel.org
Subject: Printing to off-line printer in 2.4.0-prerelease
Date: 03 Jan 2001 19:44:19 +0100	[thread overview]
Message-ID: <m2k88czda4.fsf@ppro.localdomain> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2337 bytes --]

Hello,

When trying to print to an off-line printer with 2.4 kernels, the
"write" system call to /dev/lp0 stalls for 10 seconds and then returns
EIO.  This has the unfortunate effect that the printout will be lost,
because the redhat print filters (in rh7) use "cat" to send data to
the printer device, and cat gives up when EIO is returned.

In 2.2 kernels, the write call waited until the printer went on-line
again.

I think the problem is that the lp_write() function in lp.c calls
lp_check_status() before starting to write to the parport, and if the
printer is not ready, it simply gives up. (The LP_ABORT flag is not
used in that case.)

The following patch makes things work for me again. The kernel keeps
generating the following debug messages until the printer becomes
ready, but that doesn't seem to cause any problems.

  Jan  3 18:54:27 ppro kernel: DMA write timed out
  Jan  3 18:54:37 ppro kernel: parport0: FIFO is stuck
  Jan  3 18:54:37 ppro kernel: parport0: BUSY timeout (1) in compat_write_block_pio
  Jan  3 18:54:37 ppro kernel: lp0 off-line

Is there a better way to fix this problem?

--- linux-2.4.0-prerelease/drivers/char/lp.c.orig	Wed Jan  3 18:48:39 2001
+++ linux-2.4.0-prerelease/drivers/char/lp.c	Wed Jan  3 18:48:42 2001
@@ -259,7 +259,6 @@
 	parport_set_timeout (lp_table[minor].dev,
 			     lp_table[minor].timeout);
 
-	if ((retv = lp_check_status (minor)) == 0)
 	do {
 		/* Write the data. */
 		written = parport_write (port, kbuf, copy_size);

--- linux-2.4.0-prerelease/drivers/parport/ieee1284.c.orig	Wed Jan  3 18:50:02 2001
+++ linux-2.4.0-prerelease/drivers/parport/ieee1284.c	Wed Jan  3 18:50:16 2001
@@ -524,7 +524,8 @@
 					     PARPORT_STATUS_PAPEROUT,
 					     PARPORT_STATUS_PAPEROUT);
 		if (r)
-			DPRINTK (KERN_INFO "%s: Timeout at event 31\n");
+			DPRINTK (KERN_INFO "%s: Timeout at event 31\n",
+				 port->name);
 
 		port->ieee1284.phase = IEEE1284_PH_FWD_IDLE;
 		DPRINTK (KERN_DEBUG "%s: ECP direction: forward\n",

-- 
Peter Österlund             peter.osterlund@mailbox.swipnet.se
Sköndalsvägen 35            http://home1.swipnet.se/~w-15919
S-128 66 Sköndal            +46 8 942647
Sweden

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

             reply	other threads:[~2001-01-03 19:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-03 18:44 Peter Osterlund [this message]
2001-01-03 19:13 ` Printing to off-line printer in 2.4.0-prerelease Andrea Arcangeli
2001-01-03 21:00   ` Peter Osterlund
2001-01-03 21:35     ` Andrea Arcangeli
2001-01-04  0:08       ` Peter Osterlund
2001-01-04  0:41         ` Andrea Arcangeli
2001-01-04  1:09           ` Peter Osterlund
2001-01-04  1:39             ` Andrea Arcangeli
2001-01-04 11:17               ` Tim Waugh
2001-01-04  9:27         ` Tim Waugh
2001-01-04 13:50           ` Andrea Arcangeli
2001-01-04 11:20 ` Tim Waugh
2001-01-04 13:52   ` Andrea Arcangeli
2001-01-04 14:20     ` Tim Waugh
2001-01-04 14:39       ` Andrea Arcangeli
2001-01-04 14:54         ` Tim Waugh
2001-01-04 19:45           ` Peter Osterlund
2001-01-04 19:07       ` Peter Osterlund
2001-01-04 21:52         ` Tim Waugh
2001-01-05  0:33           ` Peter Osterlund
2001-01-04 15:30 Jesse Pollard
2001-01-04 19:22 ` Gunther Mayer
2001-01-05  1:13   ` Jesse Pollard
2001-01-04 23:20 ` David Ford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2k88czda4.fsf@ppro.localdomain \
    --to=peter.osterlund@mailbox.swipnet.se \
    --cc=andrea@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).