Re: 2.6.25.3: serial problem (minicom)

From: R.L. Horn
Date: Tue Jun 17 2008 - 06:52:14 EST


On Mon, 16 Jun 2008, Alan Cox wrote:

Whatever it implies the behaviour should not have changed between 2.6.24 and 2.6.25.

Okay, I think I may have figured this out.

serial8250_set_termios() (8250.c) gets a baud rate using uart_get_baud_rate() (serial_core.c) which returns 9600 if the termios rate is B0.

The function does some stuff.

Right before returning, it calls tty_termios_encode_baud_rate() with the abovementioned rate. That function obediently changes the c_cflag baud bits from B0 to B9600. Presumably, this causes confusion in other functions (they never know that B0 was set).

I've now changed:

tty_termios_encode_baud_rate(termios, baud, baud);

to:

if ((termios->c_cflag & CBAUD) == B0)
baud = 0;
tty_termios_encode_baud_rate(termios, baud, baud);

And everybody's happy, I guess.

It looks like the DECstation DZ driver (drivers/serial/dz.c) will have the same problem, but I believe the others are okay (as of 2.6.25.6).
--
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/