linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: Dominique Larchey-Wendling <Dominique.Larchey-Wendling@loria.fr>
Cc: linux-serial@vger.kernel.org
Subject: Re: New IOCTL for Modem Control Lines monitoring
Date: Mon, 29 Jan 2007 21:39:02 -0500	[thread overview]
Message-ID: <20070130023902.GB28035@thunk.org> (raw)
In-Reply-To: <45B8E44D.5050005@loria.fr>

On Thu, Jan 25, 2007 at 06:09:33PM +0100, Dominique Larchey-Wendling wrote:
> Even tough such an event would have a low probability to occur
> if the 2 ioctl are close enough, it is still possible. This is
> a race condition (outside the kernel but possibly locking some
> process).
> 
> I propose the introduction of a new ioctl to solve this race,
> implemented through the NEW function uart_wait_new_status associated
> to a NEW ioctl.
> 
> The idea is that this new call would detect a change not compared
> to the status at the beginning of the call but compared to some
> previously recorded state. This way, the new ioctl would not
> miss a status change, even if it occurs before the call to the
> ioctl.

You're right that this is a technical flaw in TIOCMIWAIT.  When it was
originally implemented, it was done to retain compatibility with older
implementations in other OS's.

The question is why do you need such functionality?  The only way to
implement what you propose would be pass a structure containing the
previous counts into your proposed new ioctl(), which won't be well
received by the folks who have to maintain 32/64-bit translation
tables for ioctl's for use by supporting architectures that have to
support 32 and 64 bit ABI's simultaneously.  Because of this issue
some folks have proposed killing off ioctl's entirely, which is
probably not the right answer, but the fact remains that adding new
ioctl's that require passing in pointers to arbitrary data structures
is definitely not going to be well received.

So what are you actually trying to *do*?  Is this just to fix a
theoretical shortcoming?  What does your application really need to
do, and perhaps there's a another way we can address it with perhaps a
cleaner interface.

					- Ted

  parent reply	other threads:[~2007-01-30  4:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-25 17:09 New IOCTL for Modem Control Lines monitoring Dominique Larchey-Wendling
2007-01-25 18:34 ` Tosoni
2007-01-25 19:00   ` Dominique Larchey
2007-01-30  2:39 ` Theodore Tso [this message]
2007-01-30 17:19   ` Dominique Larchey-Wendling

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=20070130023902.GB28035@thunk.org \
    --to=tytso@mit.edu \
    --cc=Dominique.Larchey-Wendling@loria.fr \
    --cc=linux-serial@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).