From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: Linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: How to identify serial ports (ttySn)?
Date: Sat, 26 Aug 2006 00:38:55 +0100 [thread overview]
Message-ID: <20060825233855.GD725@flint.arm.linux.org.uk> (raw)
In-Reply-To: <44EF5677.8060304@tls.msk.ru>
On Fri, Aug 25, 2006 at 11:58:47PM +0400, Michael Tokarev wrote:
> For example, we've a PCI serial card (NetMos in
> this case), with, say, one serial port on it.
> Plus some ports on the motherboard (usually one
> or two). The question is where's the NetMos port,
> on which /dev/ttySnn?
/sys/devices/pciwhatever/tty:ttyS*
> Next, with 2.6.something which was the first 2.6
> I tried, it suddenly become ttyS4. I don't remember
> the details already. So I reconfigured all the
> machines (it was UPS control program which is
> sitting on that port) to use another device.
>
> At least 2.6.11 assigns ttyS3 to the device, saying
> the first two ports are reserved for the onboard
> devices. So I again reconfigured the app to use
> ttyS3 (or ttyS2 - I'm not sure).
>
> Now, with 2.6.17, the netmos port is ttyS1. Because
> in reality, on the motherboard there's only one
> serial port soldered (that's the reason why we
> got the netmos card in the first place), so "next
> unused" device is ttyS1.
>
> So the question is: how to find where's the thing
> on the running kernel, and where it will be with
> next version? Is there a way to assign a name for
> the thing, so it will be independent of the current
> kernel? I just want to use it, the hardware is
> *constant* for several years, but each kernel
> release gives yet another surprize, here or there.
No idea, but at a guess your kernel configuration changed in some way,
or you didn't think enough about the new options which were added.
The behaviour of serial has not changed - if the port is already known
to the kernel, it does it's damnest best to keep the same port.
If it isn't already known, it will look for the first totally unused
port and unassigned port which has not been previously used.
If it can't find one, it'll find an unused port which has been
previously used.
No idea what changed between 2.6.something and 2.6.11 - do you have the
contents of /proc/tty/driver/serial without the PCI driver loaded in
each case? If not, can't help, sorry.
In the 2.6.11 to 2.6.17 case, you've been bitten by the "only want present
ports to appear in my kernel thankyou" udev-based lobby. There's now a
configuration option/kernel command line/8250 module option to set the
number of ports. It sounds like your kernel has it set to 2, causing
only ttyS0 and ttyS1 to be available.
In the kernel configuration, it's called 'SERIAL_8250_RUNTIME_UARTS'.
On the kernel command line, it's something like '8250.nr_uarts', and
the module option is 'nr_uarts'.
If you set this to 4 + number of PCI serial ports, you'll get your
PCI ports starting at ttyS4 as it was in old times.
(Note: this is not a change I approved of - I knew it would cause people
problems, so please don't direct your anger, which is obvious from your
email, at me.)
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
prev parent reply other threads:[~2006-08-25 23:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-25 19:58 How to identify serial ports (ttySn)? Michael Tokarev
2006-08-25 23:38 ` Russell King [this message]
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=20060825233855.GD725@flint.arm.linux.org.uk \
--to=rmk+lkml@arm.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=mjt@tls.msk.ru \
/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