mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ruud Linders <rkmp@xs4all.nl>
To: linux-kernel@vger.kernel.org
Subject: 2.6.x kernels and ttyS45 for 6 serial ports ?
Date: Mon, 05 Apr 2004 12:35:39 +0200	[thread overview]
Message-ID: <4071367B.2060103@xs4all.nl> (raw)


Some time ago I reported that serial ports numbering on 2.5.x/2.6.x
was rather weird when used with a 4-serial port PCI card and 2
standard onboard serial ports.
I got devices ttyS0/1/14/15/2/3 or something.

Now checking this on 2.6.5 it got more confusing, I now have with
total of 6 serial ports a device number ttyS45 !?

The way this device numbering seems to work is that many device names
are reserved in include/asm/serial.h for devices like fourport/boca/hub6.
Anything else (=all PCI cards?) gets a number still unassigned.

Note that eg. the SCSI disk equivalent of this strategy would be to
reserver eg. sda-sde for IBM disks and other brands start
numbering at sdf !

Attached patch 'fixes' this for me, been using it for past
6 months or so.

Regards,
         Ruud Linders

__

Dmesg from 2.6.5
================
Serial: 8250/16550 driver $Revision: 1.90 $ 48 ports, IRQ sharing enabled
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
ttyS14 at I/O 0xb800 (irq = 21) is a 16550A
ttyS15 at I/O 0xb808 (irq = 21) is a 16550A
ttyS44 at I/O 0xb810 (irq = 21) is a 16550A
ttyS45 at I/O 0xb818 (irq = 21) is a 16550A

Applied this patch on stock 2.6.5
=================================
--- serial_core.c.ORIG  2004-03-19 18:29:20.000000000 +0100
+++ serial_core.c       2004-04-05 12:32:33.000000000 +0200
@@ -2306,17 +2306,6 @@
                         return &drv->state[i];

         /*
-        * We didn't find a matching entry, so look for the first
-        * free entry.  We look for one which hasn't been previously
-        * used (indicated by zero iobase).
-        */
-       for (i = 0; i < drv->nr; i++)
-               if (drv->state[i].port->type == PORT_UNKNOWN &&
-                   drv->state[i].port->iobase == 0 &&
-                   drv->state[i].count == 0)
-                       return &drv->state[i];
-
-       /*
          * That also failed.  Last resort is to find any currently
          * entry which doesn't have a real port associated with it.
          */


And now I get this more logical numbering
=========================================
Serial: 8250/16550 driver $Revision: 1.90 $ 48 ports, IRQ sharing enabled
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
ttyS2 at I/O 0xb800 (irq = 21) is a 16550A
ttyS3 at I/O 0xb808 (irq = 21) is a 16550A
ttyS4 at I/O 0xb810 (irq = 21) is a 16550A
ttyS5 at I/O 0xb818 (irq = 21) is a 16550A


             reply	other threads:[~2004-04-05 10:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-05 10:35 Ruud Linders [this message]
2004-04-05 11:04 ` Russell King
2004-04-05 14:08   ` Ruud Linders
2004-04-05 14:21     ` Arjan van de Ven
2004-04-06 16:37 Bjorn Helgaas
2004-04-06 16:45 ` Bjorn Helgaas

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=4071367B.2060103@xs4all.nl \
    --to=rkmp@xs4all.nl \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®