Skip to contentSkip to conversation

8250 fix for unconfigured FIFO size

PATCH New Ian Abbott 1 participant 1 message Nov 26, 2004 TTY layer and serial drivers

lore
Share & tools
lore

Ian Abbott

author
#0 lore raw

PATCH 1/1 8250 fix for unconfigured FIFO size

[Reposting due to Cc: address mix-up the first time!]

Hi,

In the 8250 driver, for a serial port manually configured by setserial (not using autoconfig), the FIFO size and the TX load size do not get set. The attached patch fixes that. During UART startup, it sanitizes the FIFO size and the TX load size.

This might also fix Alexandre Courbot's problem (which I suspect is due to the old FIFO size being remembered):

Quoted 2 lines

Subject: Bug with 2.6 serial driver when in UART 8250 mode
Date: Thu, 19 Aug 2004 18:53:49 +0200

drivers/serial/8250.c +8 -0
diff -urN linux-2.6.10-rc2-bk9/drivers/serial/8250.c linux-2.6.10-rc2-bk9-ia/drivers/serial/8250.c
@@ -1359,6 +1359,14 @@
 	up->capabilities = uart_config[up->port.type].flags;
 	up->mcr = 0;
 
+	if (up->port.fifosize <= 0 ||
+	    up->port.fifosize > uart_config[up->port.type].fifo_size)
+		up->port.fifosize = uart_config[up->port.type].fifo_size;
+	if (up->tx_loadsz == 0)
+		up->tx_loadsz = uart_config[up->port.type].tx_loadsz;
+	if (up->tx_loadsz > up->port.fifosize)
+		up->tx_loadsz = up->port.fifosize;
+
 	if (up->port.type == PORT_16C950) {
 		/* Wake up and initialize UART */
 		up->acr = 0;