From: Al Borchers <alborchers@steinerpoint.com>
To: linux-kernel@vger.kernel.org, macro@ds2.pg.gda.pl, tytso@mit.edu
Cc: Peter Berger <pberger@brimson.com>, James Puzzo <jamesp@dgii.com>
Subject: Re: [patch] 2.4.0, 2.2.18: A critical problem with tty_io.c
Date: Thu, 17 May 2001 15:00:25 -0500 [thread overview]
Message-ID: <3B042DD9.3BDA84D1@steinerpoint.com> (raw)
Maciej, Ted --
Maciej's patch to tty_io.c from lkml 2/22/01
http://www.uwsg.indiana.edu/hypermail/linux/kernel/0101.2/1049.html
has been incorporated in RH 7.1's kernel (for example) but not in the
main 2.4.x kernels.
This presents two different interfaces for serial drivers, and it is
awkward to detect and support both interfaces. The change breaks some
drivers from Digi International, for example.
In Maciej's patch, if a driver open is interrupted the driver close
IS NOT called. In the 2.4.x series the close IS called.
A serial driver needs to know whether close is going to be called or
not after an interrupted open, so it can do clean up--like DEC_MOD_USE_COUNT--
appropriately.
Suppose the driver open calls INC_MOD_USE_COUNT, sleeps for the port to get
carrier, then gets interrupted. If the open calls DEC_MOD_USE_COUNT after
the interrupt, the use count will be right under Maciej's patch but too low on
2.4.x. If the open does not call DEC_MOD_USE_COUNT after an interrupt, instead
deferring that for the close, then the use count will be too high under
Maciej's patch, but right under 2.4.x. This is particularly a problem if there
is another outstanding open on the port--in that case you can end up with zero
use count (and a closed port!) while the port is open or a non-zero use count
when no one has the port open.
Personally, I think Maciej's patch is correct and interrupted opens should
clean up after themselves--however, this is a different interface than presented
by the tty subsystem up to now, and will require changes in some serial drivers.
Ted can you get this patch in the kernel or ban it as interface breaking
heresy? It would be much nicer for us device driver writers to have just
one interface to support.
Thanks,
-- Al Borchers, Peter Berger
PS. James Puzzo at Digi first pointed out this problem to us.
next reply other threads:[~2001-05-17 20:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-17 20:00 Al Borchers [this message]
2001-05-17 21:23 ` [patch] 2.4.0, 2.2.18: A critical problem with tty_io.c Alan Cox
2001-05-18 2:12 ` Al Borchers
2001-05-18 7:50 ` Alan Cox
2001-05-18 8:24 ` Alan Cox
2001-05-18 9:08 ` Al Borchers
2001-05-18 11:25 ` Alan Cox
2001-05-18 15:22 ` Al Borchers
2001-05-18 10:09 ` Andrew Morton
2001-05-18 11:29 ` Alan Cox
-- strict thread matches above, loose matches on Subject: below --
2001-01-22 13:55 Maciej W. Rozycki
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=3B042DD9.3BDA84D1@steinerpoint.com \
--to=alborchers@steinerpoint.com \
--cc=jamesp@dgii.com \
--cc=linux-kernel@vger.kernel.org \
--cc=macro@ds2.pg.gda.pl \
--cc=pberger@brimson.com \
--cc=tytso@mit.edu \
/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