From: Alan Cox Date: Mon, 28 Apr 2008 09:14:06 +0000 (-0700) Subject: Fix tty speed handling on 8250 X-Git-Tag: v2.6.25.8~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30bc30a080f7e3cdf74f5cf58a1d8eba5ad85cc9;p=thirdparty%2Fkernel%2Fstable.git Fix tty speed handling on 8250 commit e991a2bd4fa0b2f475b67dfe8f33e8ecbdcbb40b upstream. 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 77f7a7f0646e0..d60705e9d0076 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -2174,7 +2174,9 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios, } 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