On 05/26/2015 10:26 AM, Duan Andy wrote: > From: Peter Hurley <peter@xxxxxxxxxxxxxxxxxx> Sent: Tuesday, May 26, 2015 9:27 PM >> To: Duan Fugang-B38611; gregkh@xxxxxxxxxxxxxxxxxxx >> Cc: linux-serial@xxxxxxxxxxxxxxx >> Subject: Re: [PATCH] serial: core: don't set console cflag to zero >> >> On 05/04/2015 03:56 AM, Fugang Duan wrote: >>> From: "Fugang Duan" <B38611@xxxxxxxxxxxxx> >>> >>> In android without shell environment (androidboot.selinux enable), do >>> suspend/resume test, console terminal has no message print out. The >>> issue is reproduced at i.MX serial platforms like i.MX6Q/DL/SX. >>> >>> In common code, cons->cflag is cleared to zero in >>> .uart_port_startup(), but after resume back, use the cons->cflag to set >> termios. >>> ...................... >>> uart_port_startup-> >>> uport->cons->cflag = 0; >>> >>> uart_resume_port()-> >>> termios.c_cflga = uport->cons->cflag; >>> ... >>> uport->ops->set_termios(uport, &termios, NULL); >>> ...................... >>> >>> If the console baud rate is 115200 bps, after Android resume back, the >>> console baud rate is initialized to 9600 bps. So the patch save the >> console cflag. >>> >>> Signed-off-by: Fugang Duan <B38611@xxxxxxxxxxxxx> >>> --- >>> drivers/tty/serial/serial_core.c | 5 ++--- >>> 1 files changed, 2 insertions(+), 3 deletions(-) >>> >>> diff --git a/drivers/tty/serial/serial_core.c >>> b/drivers/tty/serial/serial_core.c >>> index 0b7bb12..4b21091 100644 >>> --- a/drivers/tty/serial/serial_core.c >>> +++ b/drivers/tty/serial/serial_core.c >>> @@ -162,10 +162,9 @@ static int uart_port_startup(struct tty_struct >>> *tty, struct uart_state *state, >>> >>> retval = uport->ops->startup(uport); >>> if (retval == 0) { >>> - if (uart_console(uport) && uport->cons->cflag) { >>> + if (uart_console(uport) && uport->cons->cflag) >>> tty->termios.c_cflag = uport->cons->cflag; >>> - uport->cons->cflag = 0; >> >> NAK. Please fix your userspace, which is opening the serial port used by >> the console with incompatible line settings. >> >> Regards, >> Peter Hurley > > In Android with shell environment, and there have no app to open the serial port, how to fix it in userspace ? The only way that uart_port_startup() is called is if userspace opens the serial port. Regards, Peter Hurley -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html