Commit 317a6842 authored by Kyle McMartin's avatar Kyle McMartin Committed by Greg Kroah-Hartman

Revert "serial: 8250: Make SERIAL_8250_RUNTIME_UARTS work correctly"

This reverts commit cfcec52e.

This regresses a longstanding behaviour on X86 systems, which end up with
PCI serial ports moving between ttyS4 and ttyS0 when you bisect to opposite
sides of this commit, resulting in the need to constantly modify the console
setting in order to bisect across it.

Please revert, we can work on solving this for ARM platforms in a less
disruptive way.
Signed-off-by: default avatarKyle McMartin <kyle@mcmartin.ca>
Cc: Karthik Manamcheri <karthik.manamcheri@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 60e93575
...@@ -2755,7 +2755,7 @@ static void __init serial8250_isa_init_ports(void) ...@@ -2755,7 +2755,7 @@ static void __init serial8250_isa_init_ports(void)
if (nr_uarts > UART_NR) if (nr_uarts > UART_NR)
nr_uarts = UART_NR; nr_uarts = UART_NR;
for (i = 0; i < UART_NR; i++) { for (i = 0; i < nr_uarts; i++) {
struct uart_8250_port *up = &serial8250_ports[i]; struct uart_8250_port *up = &serial8250_ports[i];
struct uart_port *port = &up->port; struct uart_port *port = &up->port;
...@@ -2916,7 +2916,7 @@ static int __init serial8250_console_setup(struct console *co, char *options) ...@@ -2916,7 +2916,7 @@ static int __init serial8250_console_setup(struct console *co, char *options)
* if so, search for the first available port that does have * if so, search for the first available port that does have
* console support. * console support.
*/ */
if (co->index >= UART_NR) if (co->index >= nr_uarts)
co->index = 0; co->index = 0;
port = &serial8250_ports[co->index].port; port = &serial8250_ports[co->index].port;
if (!port->iobase && !port->membase) if (!port->iobase && !port->membase)
...@@ -2957,7 +2957,7 @@ int serial8250_find_port(struct uart_port *p) ...@@ -2957,7 +2957,7 @@ int serial8250_find_port(struct uart_port *p)
int line; int line;
struct uart_port *port; struct uart_port *port;
for (line = 0; line < UART_NR; line++) { for (line = 0; line < nr_uarts; line++) {
port = &serial8250_ports[line].port; port = &serial8250_ports[line].port;
if (uart_match_port(p, port)) if (uart_match_port(p, port))
return line; return line;
...@@ -3110,7 +3110,7 @@ static int serial8250_remove(struct platform_device *dev) ...@@ -3110,7 +3110,7 @@ static int serial8250_remove(struct platform_device *dev)
{ {
int i; int i;
for (i = 0; i < UART_NR; i++) { for (i = 0; i < nr_uarts; i++) {
struct uart_8250_port *up = &serial8250_ports[i]; struct uart_8250_port *up = &serial8250_ports[i];
if (up->port.dev == &dev->dev) if (up->port.dev == &dev->dev)
...@@ -3178,7 +3178,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port * ...@@ -3178,7 +3178,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *
/* /*
* First, find a port entry which matches. * First, find a port entry which matches.
*/ */
for (i = 0; i < UART_NR; i++) for (i = 0; i < nr_uarts; i++)
if (uart_match_port(&serial8250_ports[i].port, port)) if (uart_match_port(&serial8250_ports[i].port, port))
return &serial8250_ports[i]; return &serial8250_ports[i];
...@@ -3187,7 +3187,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port * ...@@ -3187,7 +3187,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *
* free entry. We look for one which hasn't been previously * free entry. We look for one which hasn't been previously
* used (indicated by zero iobase). * used (indicated by zero iobase).
*/ */
for (i = 0; i < UART_NR; i++) for (i = 0; i < nr_uarts; i++)
if (serial8250_ports[i].port.type == PORT_UNKNOWN && if (serial8250_ports[i].port.type == PORT_UNKNOWN &&
serial8250_ports[i].port.iobase == 0) serial8250_ports[i].port.iobase == 0)
return &serial8250_ports[i]; return &serial8250_ports[i];
...@@ -3196,7 +3196,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port * ...@@ -3196,7 +3196,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *
* That also failed. Last resort is to find any entry which * That also failed. Last resort is to find any entry which
* doesn't have a real port associated with it. * doesn't have a real port associated with it.
*/ */
for (i = 0; i < UART_NR; i++) for (i = 0; i < nr_uarts; i++)
if (serial8250_ports[i].port.type == PORT_UNKNOWN) if (serial8250_ports[i].port.type == PORT_UNKNOWN)
return &serial8250_ports[i]; return &serial8250_ports[i];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment