linux-mips
[Top] [All Lists]

Re: [patch] Incorrect mapping of serial ports to lines

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [patch] Incorrect mapping of serial ports to lines
From: "Maciej W. Rozycki" <macro@linux-mips.org>
Date: Fri, 2 Jul 2004 17:09:28 +0200 (CEST)
Cc: Geert Uytterhoeven <geert@linux-m68k.org>, Linux/MIPS Development <linux-mips@linux-mips.org>
In-reply-to: <20040629150316.GB23741@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <Pine.LNX.4.55.0406281513120.23162@jurand.ds.pg.gda.pl> <20040628235908.GC5736@linux-mips.org> <Pine.LNX.4.55.0406291345590.31801@jurand.ds.pg.gda.pl> <Pine.GSO.4.58.0406291408020.29058@waterleaf.sonytel.be> <Pine.LNX.4.55.0406291546480.31801@jurand.ds.pg.gda.pl> <20040629150316.GB23741@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
On Tue, 29 Jun 2004, Ralf Baechle wrote:

> How about you leave CONFIG_HAVE_STD_PC_SERIAL_PORT disabled for Malta then
> and supply your own MALTA_SERIAL_PORT_DEFNS instead then?  That would
> require some small changes to no longer nest the CONFIG_SERIAL_MANY_PORTS
> ifdef inside CONFIG_HAVE_STD_PC_SERIAL_PORT - about as below.

 I couldn't care less about CONFIG_SERIAL_MANY_PORTS for Malta -- the
ports it adds are AFAIK all ISA boards.  While in theory one can have a
PCI-ISA bridge and a bus extender on an option card (such devices exist,
I'm told), I don't think it's possible to use one with Malta as it already
includes a PCI-ISA bridge onboard.  If there's a need for such stuff in
the future, it can be added then.  After a brief look at the sources I
think the option itself might actually depend on CONFIG_ISA.

 So I propose the following simpler patch instead.  I'd like to have the
comment included so that no one tries to "fix" the order in the future
without a careful consideration.  It works for me.

 OK to apply?

  Maciej

patch-mips-2.4.26-20040531-mips-serial-2
diff -up --recursive --new-file 
linux-mips-2.4.26-20040531.macro/include/asm-mips/serial.h 
linux-mips-2.4.26-20040531/include/asm-mips/serial.h
--- linux-mips-2.4.26-20040531.macro/include/asm-mips/serial.h  2004-06-13 
23:16:56.000000000 +0000
+++ linux-mips-2.4.26-20040531/include/asm-mips/serial.h        2004-07-02 
00:40:52.000000000 +0000
@@ -410,14 +410,23 @@
 #define DDB5477_SERIAL_PORT_DEFNS
 #endif
 
+/*
+ * The order matters here and should be as follows:
+ *
+ * 1. board-specific ports (please keep sorted)
+ * 2. STD_SERIAL_PORT_DEFNS
+ * 3. EXTRA_SERIAL_PORT_DEFNS
+ * 4. HUB6_SERIAL_PORT_DFNS
+ *
+ * otherwise serial line numbers may change across
+ * kernel builds if configuration changes. --macro
+ */
 #define SERIAL_PORT_DFNS                       \
        ATLAS_SERIAL_PORT_DEFNS                 \
        AU1000_SERIAL_PORT_DEFNS                \
        COBALT_SERIAL_PORT_DEFNS                \
        DDB5477_SERIAL_PORT_DEFNS               \
        EV96100_SERIAL_PORT_DEFNS               \
-       EXTRA_SERIAL_PORT_DEFNS                 \
-       HUB6_SERIAL_PORT_DFNS                   \
        ITE_SERIAL_PORT_DEFNS                   \
        IVR_SERIAL_PORT_DEFNS                   \
        JAZZ_SERIAL_PORT_DEFNS                  \
@@ -426,8 +435,11 @@
        MOMENCO_OCELOT_C_SERIAL_PORT_DEFNS      \
        MOMENCO_JAGUAR_ATX_SERIAL_PORT_DEFNS    \
        SEAD_SERIAL_PORT_DEFNS                  \
-       STD_SERIAL_PORT_DEFNS                   \
        TITAN_SERIAL_PORT_DEFNS                 \
-       TXX927_SERIAL_PORT_DEFNS
+       TXX927_SERIAL_PORT_DEFNS                \
+                                               \
+       STD_SERIAL_PORT_DEFNS                   \
+       EXTRA_SERIAL_PORT_DEFNS                 \
+       HUB6_SERIAL_PORT_DFNS
 
 #endif /* _ASM_SERIAL_H */
diff -up --recursive --new-file 
linux-mips-2.4.26-20040531.macro/include/asm-mips64/serial.h 
linux-mips-2.4.26-20040531/include/asm-mips64/serial.h
--- linux-mips-2.4.26-20040531.macro/include/asm-mips64/serial.h        
2003-12-18 03:57:25.000000000 +0000
+++ linux-mips-2.4.26-20040531/include/asm-mips64/serial.h      2004-07-02 
00:41:05.000000000 +0000
@@ -146,13 +146,23 @@
 #define IP27_SERIAL_PORT_DEFNS
 #endif /* CONFIG_SGI_IP27 */
 
+/*
+ * The order matters here and should be as follows:
+ *
+ * 1. board-specific ports (please keep sorted)
+ * 2. STD_SERIAL_PORT_DEFNS
+ *
+ * otherwise serial line numbers may change across
+ * kernel builds if configuration changes. --macro
+ */
 #define SERIAL_PORT_DFNS                               \
        IP27_SERIAL_PORT_DEFNS                          \
        MOMENCO_OCELOT_C_SERIAL_PORT_DEFNS              \
        MOMENCO_JAGUAR_ATX_SERIAL_PORT_DEFNS            \
        SEAD_SERIAL_PORT_DEFNS                          \
-       STD_SERIAL_PORT_DEFNS                           \
-       TITAN_SERIAL_PORT_DEFNS
+       TITAN_SERIAL_PORT_DEFNS                         \
+                                                       \
+       STD_SERIAL_PORT_DEFNS
 
 #define RS_TABLE_SIZE  64
 

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [patch] Incorrect mapping of serial ports to lines, Maciej W. Rozycki <=