Re: [PATCH] serial: 8250: add option to disable registration of legacy ISA ports

Started by Måns Rullgård on Jan 31, 2021 · 2 messages from 2 authors · Last reply Jan 31, 2021

open the first message on its own page

Message details and related content
Greg Kroah-Hartman [off-list ref] writes:
On Sun, Jan 31, 2021 at 01:18:47PM +0000, Måns Rullgård wrote:
quoted
Greg Kroah-Hartman [off-list ref] writes:
quoted
On Thu, Jan 28, 2021 at 05:22:44PM +0000, Mans Rullgard wrote:
quoted
On systems that do not have the traditional PC ISA serial ports, the
8250 driver still creates non-functional device nodes.  This change
makes only ports that actually exist (PCI, DT, ...) get device nodes.

Signed-off-by: Mans Rullgard <redacted>
---
 drivers/tty/serial/8250/8250_core.c | 26 ++++++++++++++++++++------
 drivers/tty/serial/8250/Kconfig     |  5 +++++
 2 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index cae61d1ebec5..49695dd3677c 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -555,6 +555,7 @@ static void __init serial8250_isa_init_ports(void)
 	}
 }
 
+#ifdef CONFIG_SERIAL_8250_ISA
This is just making a mess of the code. 
It was already a mess.
True, but don't make it a worse one please.
quoted
quoted
To do this right, pull the isa code out into a separate file and put
the #ifdef in a .h file, so we can properly maintain and support this
code over time.  This change as-is is not going to make that any
easier :(
I might put in that effort if there's a reasonable chance this change
will be accepted.  If it's going to be rejected regardless, I'd rather
not waste my time.

19 more quoted lines

On a Beaglebone Black based system with some of the UARTs enabled, those
keep their numbers such that e.g. ttyS0, ttyS1, and ttyS4 show up in
/dev while ttyS2 and ttyS3 do not since they don't correspond to any
(enabled) ports.

If any of the very many variants of this driver do not assign fixed
numbers, those would possibly be renumbered.  Should that be the case,
the numbering was never guaranteed to begin with, so I fail to see any
problem.

-- 
Måns Rullgård
Message details and related content
On Sun, Jan 31, 2021 at 03:47:42PM +0000, Måns Rullgård wrote:
Greg Kroah-Hartman [off-list ref] writes:
quoted
On Sun, Jan 31, 2021 at 01:18:47PM +0000, Måns Rullgård wrote:
quoted
Greg Kroah-Hartman [off-list ref] writes:
quoted
On Thu, Jan 28, 2021 at 05:22:44PM +0000, Mans Rullgard wrote:
quoted
On systems that do not have the traditional PC ISA serial ports, the
8250 driver still creates non-functional device nodes.  This change
makes only ports that actually exist (PCI, DT, ...) get device nodes.

Signed-off-by: Mans Rullgard <redacted>
---
 drivers/tty/serial/8250/8250_core.c | 26 ++++++++++++++++++++------
 drivers/tty/serial/8250/Kconfig     |  5 +++++
 2 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index cae61d1ebec5..49695dd3677c 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -555,6 +555,7 @@ static void __init serial8250_isa_init_ports(void)
 	}
 }
 
+#ifdef CONFIG_SERIAL_8250_ISA
This is just making a mess of the code. 
It was already a mess.
True, but don't make it a worse one please.
quoted
quoted
To do this right, pull the isa code out into a separate file and put
the #ifdef in a .h file, so we can properly maintain and support this
code over time.  This change as-is is not going to make that any
easier :(
I might put in that effort if there's a reasonable chance this change
will be accepted.  If it's going to be rejected regardless, I'd rather

31 more quoted lines

Ok, if that's the case, then yes, a cleaned up version of this patch
would be nice, thanks!

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help