Re: [PATCH] serial: core: don't set console cflag to zero

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

> -		}
> +
>  		/*
>  		 * Initialise the hardware port settings.
>  		 */
> 

--
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




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux