Skip to contentSkip to conversation

tty: serial: 8250: remove U6715 16550A auto-detection

PATCH In review Philippe Langlais 3 participants 4 messages Mar 19, 2013 – Mar 21, 2013 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tty: serial: 8250: remove U6715 16550A auto-detection

The auto-detection based on 64 bytes fifo size causes troubles for the identification of the MultiTechZPX Modems (pci 11c1:0480). They loose the ability to do hardware flow control (specifically CTS is never set).

---
 drivers/tty/serial/8250/8250.c |    9 ---------
 1 file changed, 9 deletions(-)
drivers/tty/serial/8250/8250.c +0 -9
index cf6a538..3255014 100644
@@ -1026,15 +1026,6 @@ static void autoconfig_16550a(struct uart_8250_port *up)
 
 		return;
 	}
-
-	/*
-	 * We distinguish between 16550A and U6 16550A by counting
-	 * how many bytes are in the FIFO.
-	 */
-	if (up->port.type == PORT_16550A && size_fifo(up) == 64) {
-		up->port.type = PORT_U6_16550A;
-		up->capabilities |= UART_CAP_AFE;
-	}
 }
 
 /*
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 17 lines · Philippe Langlais

The auto-detection based on 64 bytes fifo size causes troubles for the identification of the MultiTechZPX Modems (pci 11c1:0480). They loose the ability to do hardware flow control (specifically CTS is never set).

---
 drivers/tty/serial/8250/8250.c |    9 ---------
 1 file changed, 9 deletions(-)
drivers/tty/serial/8250/8250.c +0 -0
index cf6a538..3255014 100644
@@ -1026,15 +1026,6 @@ static void autoconfig_16550a(struct uart_8250_port *up)
 
 		return;

drivers/tty/serial/8250/8250.c static void autoconfig_16550a(struct uart_8250_port *up) · line 1037

Quoted 10 lines
drivers/tty/serial/8250/8250.c +0 -9
 	}
-
-	/*
-	 * We distinguish between 16550A and U6 16550A by counting
-	 * how many bytes are in the FIFO.
-	 */
-	if (up->port.type == PORT_16550A && size_fifo(up) == 64) {
-		up->port.type = PORT_U6_16550A;
-		up->capabilities |= UART_CAP_AFE;
-	}

So you just broke this functionality for all of the other devices it does work properly for? That's not nice, and not acceptable.

Please fix this properly.

greg k-h

#2 lore raw

Hi guys,

Quoted 10 lines · Greg Kroah-Hartman

drivers/tty/serial/8250/8250.c static void autoconfig_16550a(struct uart_8250_port *up) · line 1037

Quoted 4 lines · Philippe Langlais
drivers/tty/serial/8250/8250.c +0 -4
-	if (up->port.type == PORT_16550A && size_fifo(up) == 64) {
-		up->port.type = PORT_U6_16550A;
-		up->capabilities |= UART_CAP_AFE;
-	}

So you just broke this functionality for all of the other devices it does work properly for? That's not nice, and not acceptable.

Please fix this properly.

Is there actually anything depending on this quirk? It looks like U6715 support newer made it to upstream, and I believe the type PORT_U6_16550A is designed for U6715 only.

In any case, replacing the type PORT_16550A with a type that has custom capabilities based on fifosize alone feels dangerous to me. 64B fifo for 16550 compatible UARTs is very common these days.

Since we have this conditions in autoconfig_16550a(), then would it be OK to replace it with something like:

- /*

-        * We distinguish between 16550A and U6 16550A by counting
-        * how many bytes are in the FIFO.
-        */

- if (up->port.type == PORT_16550A && size_fifo(up) == 64) {
- up->port.type = PORT_U6_16550A;
- up->capabilities |= UART_CAP_AFE;
- }
+ if (up->port.type == PORT_16550A && size_fifo(up) == 64)
+ up->port.fifosize = 64;
+
+ if (up->port.type == PORT_16550A && size_fifo(up) == 128)
+ up->port.fifosize = 128;
}

We set the port->up.fifosize for a few common fifo sizes, like 64 and 128, instead of replacing the type and capabilities?

Thanks,

Signature · 1 line
heikki
#3 lore raw
In reply to Greg Kroah-Hartman
Quoted 17 lines · Greg Kroah-Hartman
Quoted 16 lines · Philippe Langlais

The auto-detection based on 64 bytes fifo size causes troubles for the identification of the MultiTechZPX Modems (pci 11c1:0480). They loose the ability to do hardware flow control (specifically CTS is never set).

---
  drivers/tty/serial/8250/8250.c |    9 ---------
  1 file changed, 9 deletions(-)
drivers/tty/serial/8250/8250.c +0 -0
index cf6a538..3255014 100644
@@ -1026,15 +1026,6 @@ static void autoconfig_16550a(struct uart_8250_port *up)
 
Quoted 13 lines

drivers/tty/serial/8250/8250.c static void autoconfig_16550a(struct uart_8250_port *up) · line 1037

Quoted 11 lines
drivers/tty/serial/8250/8250.c +0 -9
  		return;
  	}
-
-	/*
-	 * We distinguish between 16550A and U6 16550A by counting
-	 * how many bytes are in the FIFO.
-	 */
-	if (up->port.type == PORT_16550A && size_fifo(up) == 64) {
-		up->port.type = PORT_U6_16550A;
-		up->capabilities |= UART_CAP_AFE;
-	}

So you just broke this functionality for all of the other devices it does work properly for? That's not nice, and not acceptable.

Yes, I know, but as U6715 & U6XXX kernel maintainer there is no risk to do that,
kernel for such platforms are not managed in mainstream, there are more risks
to keep these lines for other platforms.

Quoted 2 lines

Please fix this properly.

I don't know how to distinguish MultiTechZPX Modems, so I rather to remove these lines.

Quoted 2 lines

greg k-h

Philippe