linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* CLOCAL and TIOCMIWAIT
@ 2001-02-27  0:56 Ivan Passos
  2001-02-27  1:27 ` Paul Fulghum
  2001-02-27  3:19 ` Jeremy Jackson
  0 siblings, 2 replies; 4+ messages in thread
From: Ivan Passos @ 2001-02-27  0:56 UTC (permalink / raw)
  To: Linux Kernel List, Linux Serial List


Hello,

A customer has just brought to my attention that when you try to use the
TIOCMIWAIT ioctl with our boards and CLOCAL is enabled, you can't check
changes in the DCD signal. He also mentioned that that is possible with
the regular serial ports.

As I understood, CLOCAL meant disabling DCD sensitivity, so if CLOCAL is
disabled, no changes in DCD will be passed from hardware driver to the
kernel or userspace. The way the serial driver is implemented, this is not
true (i.e. even with CLOCAL enabled, you can still see DCD changes through
the TIOCMIWAIT command).

My question is: what's the correct interpretation of CLOCAL?? If the
serial driver's interpretation is the correct one, I'll be more than happy
to change the Cyclades' driver to comply with that, I just want to make
sure that this is the expected behavior before I patch the driver.

Thanks in advance for your comments.

Later,
Ivan


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: CLOCAL and TIOCMIWAIT
  2001-02-27  0:56 CLOCAL and TIOCMIWAIT Ivan Passos
@ 2001-02-27  1:27 ` Paul Fulghum
  2001-02-27  3:19 ` Jeremy Jackson
  1 sibling, 0 replies; 4+ messages in thread
From: Paul Fulghum @ 2001-02-27  1:27 UTC (permalink / raw)
  To: Ivan Passos, Linux Kernel List, Linux Serial List

> A customer has just brought to my attention that when you try to use the
> TIOCMIWAIT ioctl with our boards and CLOCAL is enabled, you can't check
> changes in the DCD signal. He also mentioned that that is possible with
> the regular serial ports.
>
> As I understood, CLOCAL meant disabling DCD sensitivity, so if CLOCAL is
> disabled, no changes in DCD will be passed from hardware driver to the
> kernel or userspace. The way the serial driver is implemented, this is not
> true (i.e. even with CLOCAL enabled, you can still see DCD changes through
> the TIOCMIWAIT command).
>
> My question is: what's the correct interpretation of CLOCAL?? If the
> serial driver's interpretation is the correct one, I'll be more than happy
> to change the Cyclades' driver to comply with that, I just want to make
> sure that this is the expected behavior before I patch the driver.
>
> Thanks in advance for your comments.
>
> Later,
> Ivan

I believe CLOCAL only governs how DCD is used (or ignored) when opening
a port (must be active to complete open) and maintaining a connection
(negation signals hangup).

So CLOCAL controls the driver's 'interpretation' of DCD but
TIOCMIWAIT monitors the signal transitions without regard to
a predefined interpretation (let's the application decide what
to do with DCD).

Paul Fulghum
paulkf@microgate.com



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: CLOCAL and TIOCMIWAIT
  2001-02-27  0:56 CLOCAL and TIOCMIWAIT Ivan Passos
  2001-02-27  1:27 ` Paul Fulghum
@ 2001-02-27  3:19 ` Jeremy Jackson
  2001-02-27 22:59   ` Theodore Y. Ts'o
  1 sibling, 1 reply; 4+ messages in thread
From: Jeremy Jackson @ 2001-02-27  3:19 UTC (permalink / raw)
  To: Ivan Passos; +Cc: Linux Kernel List, Linux Serial List

Ivan Passos wrote:

> Hello,
>
> A customer has just brought to my attention that when you try to use the
> TIOCMIWAIT ioctl with our boards and CLOCAL is enabled, you can't check
> changes in the DCD signal. He also mentioned that that is possible with
> the regular serial ports.
>
> As I understood, CLOCAL meant disabling DCD sensitivity, so if CLOCAL is
> disabled, no changes in DCD will be passed from hardware driver to the
> kernel or userspace. The way the serial driver is implemented, this is not
> true (i.e. even with CLOCAL enabled, you can still see DCD changes through
> the TIOCMIWAIT command).

I remember auditing the exact code where this happens, but on 2.0 or earlier.

I had written a simple program 10-20 lines C to count pulses at rate of 1 per

second give or take.  It turned out that the driver disabled the UART's
generation
of interrupts completely for certain signals.  I don't remember which
exactly, but
I think it was DCD; I was using CLOCAL so the hangups wouldn't close the
descriptor.  The problems was that by disabling the interrupt at the source,
the ioctl's to read the bits stopped working!  not what I wanted.

I'm afraid I can't help, other that to suggest that that behaviour can have
problems.
The extra irq traffic was probably the motivation for this optimisation, but
I don't know of anyone's modem hanging up frequently enough to measure the
extra load.  Only people crazy enough to use the built-in serial port ($0)
as opposed to an $500 industrial digital io card are likely to care though...

>
>
> My question is: what's the correct interpretation of CLOCAL?? If the
> serial driver's interpretation is the correct one, I'll be more than happy
> to change the Cyclades' driver to comply with that, I just want to make
> sure that this is the expected behavior before I patch the driver.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: CLOCAL and TIOCMIWAIT
  2001-02-27  3:19 ` Jeremy Jackson
@ 2001-02-27 22:59   ` Theodore Y. Ts'o
  0 siblings, 0 replies; 4+ messages in thread
From: Theodore Y. Ts'o @ 2001-02-27 22:59 UTC (permalink / raw)
  To: Jeremy Jackson; +Cc: Ivan Passos, Linux Kernel List, Linux Serial List

   Date: 	Mon, 26 Feb 2001 22:19:20 -0500
   From: Jeremy Jackson <jerj@coplanar.net>

   I had written a simple program 10-20 lines C to count pulses at rate
   of 1 per second give or take.  It turned out that the driver disabled
   the UART's generation of interrupts completely for certain signals.
   I don't remember which exactly, but I think it was DCD; I was using
   CLOCAL so the hangups wouldn't close the descriptor.  The problems
   was that by disabling the interrupt at the source, the ioctl's to
   read the bits stopped working!  not what I wanted.

This was a bug which was fixed for 2.2 in the 8250/16550 serial driver;
CLOCAL should change the behaviour open/close/hangup processing, as per
POSIX, but it shouldn't change the behaviour of TIOCMIWAIT or TIOCMGET.

   > My question is: what's the correct interpretation of CLOCAL?? If the
   > serial driver's interpretation is the correct one, I'll be more than happy
   > to change the Cyclades' driver to comply with that, I just want to make
   > sure that this is the expected behavior before I patch the driver.

CLOCAL's behaviour is defined under POSIX, although the behaviour of
TIOCMIWAIT and TIOMGET aren't.  So one could make the argument that 
(to use Al Gore's words) there "no controlling legal authority" saying
that an implementation where TIOCMIWAIT depending on CLOCAL being clear
is illegal or violates some standard.  However, it seems downright silly.

So I would argue that it would be better to make things consistent by
making CLOCAL only affect those things which are specifically specified
by POSIX.1, and not make it affect the behaviour of TIOCMIWAIT and
TIOCMGET, et. al.

							- Ted

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-02-27 22:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-27  0:56 CLOCAL and TIOCMIWAIT Ivan Passos
2001-02-27  1:27 ` Paul Fulghum
2001-02-27  3:19 ` Jeremy Jackson
2001-02-27 22:59   ` Theodore Y. Ts'o

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).