[PATCH] Fix tty speed handling on 8250

From: Alan Cox
Date: Wed Feb 20 2008 - 15:50:39 EST


We try and write the correct speed back but the serial midlayer already
mangles the speed on us and that means if we request B0 we report back
B9600 when we should not. For now we'll hack around this in the drivers
and serial code, pending a better long term solution.

Signed-off-by: Alan Cox <alan@xxxxxxxxxx>

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.25-rc2-mm1/drivers/serial/8250.c linux-2.6.25-rc2-mm1/drivers/serial/8250.c
--- linux.vanilla-2.6.25-rc2-mm1/drivers/serial/8250.c 2008-02-19 11:03:01.000000000 +0000
+++ linux-2.6.25-rc2-mm1/drivers/serial/8250.c 2008-02-20 16:31:16.000000000 +0000
@@ -2174,7 +2174,9 @@
}
serial8250_set_mctrl(&up->port, up->port.mctrl);
spin_unlock_irqrestore(&up->port.lock, flags);
- tty_termios_encode_baud_rate(termios, baud, baud);
+ /* Don't rewrite B0 */
+ if (tty_termios_baud_rate(termios))
+ tty_termios_encode_baud_rate(termios, baud, baud);
}

static void
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/