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

Bug#293927: marked as done (Can't print more than once from serial port in 2.6 kernel)

Your message dated Thu, 21 Jul 2005 08:40:36 +1000
with message-id <20050720224036.GC11876@enc.com.au>
and subject line Bug#293927: More information about lprng bug
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

Received: (at submit) by bugs.debian.org; 6 Feb 2005 21:37:51 +0000
>From dave@lafn.org Sun Feb 06 13:37:51 2005
Return-path: <dave@lafn.org>
Received: from zoot.lafn.org [] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1Cxu6J-0005GJ-00; Sun, 06 Feb 2005 13:37:51 -0800
Received: from davespc (Debian-exim@host-66-81-17-39.rev.o1.com [])
	by zoot.lafn.org (8.12.3p3/8.12.3) with ESMTP id j16LbifF082088
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO)
	for <submit@bugs.debian.org>; Sun, 6 Feb 2005 13:37:48 -0800 (PST)
	(envelope-from dave@lafn.org)
Received: from dave by davespc with local (Exim 4.34)
	id 1Cxtt2-0001Jq-TC
	for submit@bugs.debian.org; Sun, 06 Feb 2005 13:24:08 -0800
Date: Sun, 6 Feb 2005 13:24:08 -0800
From: David Lawyer <dave@lafn.org>
To: submit@bugs.debian.org
Subject: Re: Can't print more than once from serial port in 2.6 kernel
Message-ID: <20050206212408.GA4231@lafn.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/
X-Virus-Scanned: ClamAV 0.80/680/Sun Jan 23 15:16:15 2005
	clamav-milter version 0.80j
	on zoot.lafn.org
X-Virus-Status: Clean
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02

Package: lprng
Version 3.8.28-1

I submitted this bug over a month ago.  It was rejected as not being a
lprng bug.  But new information I just obtained indicates that it may be
in part a lprng bug.

On Mon, Dec 27, 2004 at 02:57:28PM -0800, David Lawyer wrote:
> Once I type lpr (or pr) to print something, it hangs if I try to print
> something more (use lpr or pr again).  Also cat test-file > /dev/ttyS1
> will not work either.  It just hangs and nothing gets printed.  I'm
> using kernel 2.6.8-1 but the old kernel 2.4.26 prints fine and doesn't
> have this problem.

By using lpc and typing lpq I read: Status: cannot open /dev/ttyS1
'Interrupted system call", attempt 1, sleeping 10.  So the problem is
that the serial port can't be opened.  But the minicom program can open
this port and then I can type to the printer from the PC keyboard (like
an old typewriter).  Also, the modemstat program can open ttyS1. So why
can't lprng open it?

I think this problem has to do with the modem control lines in the
printer cable.  When I turn on the printer (25 years old, but of the
highest quality --all metal and heavy) CTS and DSR at the PC are
asserted (from the printer).  Note that CD is not asserted.  If I
disconnect the printer cable and assert CD with a jumper cable, then the
serial port opens when I try to print (second try) per lsof.  But
nothing gets printed of course since the cable to the printer is
disconnected.  Thus I suspect the problem with opening the serial port
is due to no CD on the port.

Here's the code modemstat uses to open the serial port where

void open_my_device()
   fh =  open (device,O_RDONLY);
   if    (fh == -1)
         printf ("\nCannot open %s\n",device);
         exit (1);

This works.  But actually there may be CD on the port when it opens.
That's because my printer asserts CD to the PC as soon as the PC asserts
DTR->DSR to the printer.  DTR->DSR means the PC send out DTR which
asserts the DSR pin on the printer (crossover cable).  When lpr tries to
open the port, I see DTR (and CD) get asserted at the PC for several
seconds.  Then both of these are negated and it seems that the open
fails.  All this may have to do with race conditions.  Perhaps if the
test for CD is made before asserting DTR, then open() fails.  But if DTR
is asserted in time for CD to be asserted before the test for CD, then
all is OK.  This is just a hypothesis that may be wrong.

If I set stty clocal (disable modem control signals) and put stty=clocal
in /etc/printcap then the problem is fixed.  But I didn't have to do
this previously and didn't discover until just now that this will still
permit CTS/RTS hardware flow control which I need due to a printer
buffer size of 256 bytes.

> I'm printing via the serial port to an old serial printer.  If I don't
> use lpr/pr, but first use cat test-file > /dev/ttyS1, all is OK and I
> can repeat sending files to the printer.  But if I use the lpr or pr
> print commands, then I can't print anymore.  Before using the cat
> command to send data to the printer, I of course have to use stty to set
> the baud rate to that of the printer, etc.  
> I think something may be different in the serial driver for the 2.6
> kernel that's causing this problem
> 			David Lawyer

Received: (at 293927-done) by bugs.debian.org; 20 Jul 2005 22:40:39 +0000
>From csmall@enc.com.au Wed Jul 20 15:40:39 2005
Return-path: <csmall@enc.com.au>
Received: from ppp114-209.static.internode.on.net (mail.enc.com.au) [] 
	by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
	id 1DvNF1-0005cu-00; Wed, 20 Jul 2005 15:40:39 -0700
Received: from localhost (localhost [])
	by mail.enc.com.au (Postfix) with ESMTP id 7D581B9B26
	for <293927-done@bugs.debian.org>; Thu, 21 Jul 2005 08:40:36 +1000 (EST)
Received: from mail.enc.com.au ([])
	by localhost (gonzo []) (amavisd-new, port 10024) with LMTP
	id 25695-01 for <293927-done@bugs.debian.org>;
	Thu, 21 Jul 2005 08:40:36 +1000 (EST)
Received: by mail.enc.com.au (Postfix, from userid 1000)
	id 301B6B9C00; Thu, 21 Jul 2005 08:40:36 +1000 (EST)
Date: Thu, 21 Jul 2005 08:40:36 +1000
To: 293927-done@bugs.debian.org
Subject: Re: Bug#293927: More information about lprng bug
Message-ID: <20050720224036.GC11876@enc.com.au>
References: <20050718232441.GD7884@enc.com.au> <20050720200054.GC2269@lafn.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20050720200054.GC2269@lafn.org>
User-Agent: Mutt/1.5.6+20040907i
From: csmall@enc.com.au (Craig Small)
X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at enc.com.au
Delivered-To: 293927-done@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02

On Wed, Jul 20, 2005 at 01:00:54PM -0700, David Lawyer wrote:
> My serial printer had mechanical problems so I replaced it with a
> parallel port printer.  I junked the serial printer so there's no way
> to test it.

OK, unfortunately I'll have to close the bug.  I suppose if someone
else gets this problem it can be re-opened, though I also suspect
most serial printers are sharing your printer's fate.

 - Craig
Craig Small      GnuPG:1C1B D893 1418 2AF4 45EE  95CB C76C E5AC 12CA DFA5
Eye-Net Consulting http://www.enc.com.au/   MIEE         Debian developer
csmall at : enc.com.au                      ieee.org           debian.org

Reply to: