Subject: Re: is TIOCMGET supposed to reflect reality?
To: Tom Yu <tlyu@mit.edu>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 09/29/2004 15:10:05
--q9KOos5vDmpwPx9o
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Sep 27, 2004 at 09:50:18AM -0400, Tom Yu wrote:
> >>>>> "David" =3D=3D David Laight <david@l8s.co.uk> writes:
>=20
> >> Is there any reason not to always enable DCD and CTS interrupts?  I
> >> gather that there might be performance reasons for disabling DCD and
> >> CTS interrupts, but if the interrupts are disabled, TIOCMGET would
> >> have to explicitly read RR0 to get the correct state of the modem
> >> status lines.

I think it'd be simpler to just read the current value of the flags.=20
TIOCMGET is an uncommon call.

[snip]

> Also, at some point in the past (around rev 1.39), z8530tty.c did have
> DCD_IE and CTS_IE unconditionally enabled, but there was a change in
> rev 1.53 to only enable them if the tty layer expects to track the
> status lines.  It looks like this change was in response to some
> problems on mac68k machines.

The "problem" on mac68k machines is also present on macppc (which doesn't
use the MI driver as I recall), and it is that the software (the driver)
shouldn't assume that enabling interrupts is sane.

The mac68k and macppc serial ports are wired up so that an external input,=
=20
on either DCD or CTS, can be used to drive the bit rate generators. See=20
the external clock input code in sys/arch/mac68k/dev/zs.c. Since these=20
clocks need to be on the order of 16x the bit rate, you can see that they=
=20
would generate an interrupt storm if they were let in. Specifically, MIDI=
=20
interfaces use the external clock source to feed in a clock to generate=20
the MIDI bit rate.

Take care,

Bill

--q9KOos5vDmpwPx9o
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFBWzK9Wz+3JHUci9cRAvWHAJ92F34UhCstaXNBLNjQRmFOld8HFQCfSd5D
bpHZip9wK1Cy08p/ejWDyz4=
=zm5d
-----END PGP SIGNATURE-----

--q9KOos5vDmpwPx9o--