Index Home About Blog
From: Theodore Tso <tytso@mit.edu>
Newsgroups: fa.linux.kernel
Subject: Re: [PATCH] Stop pmac_zilog from abusing 8250's device numbers.
Date: Wed, 04 Apr 2007 12:22:53 UTC
Message-ID: <fa.mbwAEgznv8drYkClqC3BRBTv80Y@ifi.uio.no>

On Wed, Apr 04, 2007 at 09:38:03AM +0100, Russell King wrote:
> I think your perception is more wrong than you could ever think.
> Montavista would absolutely love all serial ports to be under the
> ttyS* naming, especially on ARM where there is a wide variety of
> different possibilities - ttyAM, ttySA, ttyPXA, ttyAMA, and so
> the list goes on.  It apparantly gives their support department
> real headaches.
>
> There are similar feelings from the handhelds.org community.
>
> However, despite people pressing for it, there's yet to be a *sane*
> *technical* *solution* to the problem.  All I've seen so far is one
> bad hack.

It is certainly technically doable.  The problem is that there's a lot
of hard work between where we are and there, and serial ports have
never been important enough so that someone has been able to justify
the intensive amounts of work to get there.

What I've always wanted to do if I could clone myself and/or had
unlimited amounts of time/funding to work on the problem, is that a
huge amount of what is in the "serial layer" needs to be pushed into
the tty layer (and things like the hangup code needs to be pushed into
VFS as revoke(2), for which thankfully we're starting to see patches
that do this).  Essentially, there is a huge amount of *hair* in the
8250 driver which really should have gone into tty layer, and some of
the hair (like locked termios, the last remants of callout device
support, etc.) should just be removed.

The other thing I would probably do if I were to do it all over again
is allow serial devices to be named independent of /dev/ttySx
interface, these days probably using /sysfs, so that you could easily
query to figure out what serial controllers/cards were on the system,
and assign specific controllers/ports to specific /dev/ttySx devices.
We could also provide a registration system to allow on-line
configuration of non-probeable serial cards attached to primitive
buses that don't alllow probing, such as the ISA bus, although perhaps
that's much less important in this day and age.

The bottom line is thre's a huge amount of history and legacy in the
serial driver, but it hasn't been as _important_ for it to get the
kind of modern rewrite that we've had in our other device subsystems.
And such a rewrite is something that really evolve, but needs to be a
big-bang reorganization, and that's something rather painful that we
don't do as well as the gradual evolution approach.  But it works well
enough, and hey, my laptop doesn't even have any serial ports (unless
I plug in a USB serial card or I dock it in my docking station), and
after all, all right-thinking serial ports are implemented using
8250-derived UART's, so the current system has been Good Enough for
the vast majority of Linux users.  (And as Linus will tell you, he's a
big fan of the Good Enough/"Worse is Better"/New Jersey approach as
opposed to the exquisitely overdesigned MIT/Stanford approach.)

So if we're going to do the "Worse is Better" thing, what I'd suggest
doing is that someone simply submit a hack so that pmac_zilog can
steal minor numbers and use /dev/ttyS0.  I accepted the patch way back
when I was serial maintainer; Russell ripped it out when he became the
serial maintainer; but now that he's no longer the serial maintainer,
he doesn't get to complain about that any more :-)

So my suggestion would be to simply submit patch to share minor
numbers directly to Linus/Andrew (since there is no current serial
maintainer) and see if they accept it.

Regards,

					- Ted


From: Theodore Tso <tytso@mit.edu>
Newsgroups: fa.linux.kernel
Subject: Re: [PATCH] Stop pmac_zilog from abusing 8250's device numbers.
Date: Wed, 04 Apr 2007 17:43:29 UTC
Message-ID: <fa.oJ/CvNkP25I/NHCRHQb8XXsDgo0@ifi.uio.no>

On Wed, Apr 04, 2007 at 09:16:42AM -0700, H. Peter Anvin wrote:
> One option would be to move the 8250-based serial ports, to, say,
> /dev/ttyN* (for National Semiconductors -- the best I could come up
> with) and redefine /dev/ttyS* as a serial port multiplexer which maps in
> all the types, for the ones that really want dynamic mapping.

> Of course, now you have the potential of aliasing, again, which tends to
> cause all kinds of headaches w.r.t. locking.

That would break the 99.9% of the the world using Intel-based systems
which only have 8250's, for very little gain.

Like it or not, /dev/ttySx and 8250 UART's are to serial ports what
the PCI is to system buses....

						- Ted

Index Home About Blog