linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: peter@hurleysoftware.com (Peter Hurley)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] tty: serial: 8250_core: Do not call set_sleep for console port
Date: Thu, 09 Oct 2014 10:45:11 -0400	[thread overview]
Message-ID: <54369F77.5000906@hurleysoftware.com> (raw)
In-Reply-To: <1412862326-6147-1-git-send-email-ssreedharan@mvista.com>

Hi Sudhir,

On 10/09/2014 09:45 AM, Sudhir Sreedharan wrote:
> In ST16650V2 based serial uarts, while initalizing the PM state,
> LCR registers are being initialized to 0 in serial8250_set_sleep().
> If console port is already initialized and being used, this will
> throws garbage in the console.
> 
> Signed-off-by: Sudhir Sreedharan <ssreedharan@mvista.com>
> ---
>  drivers/tty/serial/8250/8250_core.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
> index ca5cfdc..994aa25 100644
> --- a/drivers/tty/serial/8250/8250_core.c
> +++ b/drivers/tty/serial/8250/8250_core.c
> @@ -2618,6 +2618,9 @@ void serial8250_do_pm(struct uart_port *port, unsigned int state,
>  {
>  	struct uart_8250_port *p = up_to_u8250p(port);
>  
> +	if (port->cons && (port->cons->flags & CON_ENABLED) && (state == 0))
> +		return;
> +
>  	serial8250_set_sleep(p, state != 0);
>  }
>  EXPORT_SYMBOL(serial8250_do_pm);

Please just fix serial8250_set_sleep() register programming to save and restore the
LCR.

You could also fix:
1. preserving the other EFR bits
2. acquiring the port lock around the register programming. Not entirely sure it's
absolutely necessary because the serial core serializes most heavy duty register
programming with port mutex, but it's probably wise anyway.

Regards,
Peter Hurley

  reply	other threads:[~2014-10-09 14:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1411367422-2095-1-git-send-email-ssreedharan@mvista.com>
2014-10-01 17:27 ` [PATCH] serial/core: Initialize the console pm state Kevin Hilman
2014-10-03  4:35   ` Greg KH
2014-10-03 12:22   ` Geert Uytterhoeven
2014-10-06  9:48     ` Sudhir Sreedharan
2014-10-06  9:27   ` Sudhir Sreedharan
2014-10-09 13:42     ` Sudhir Sreedharan
2014-10-09 13:45       ` [PATCH] tty: serial: 8250_core: Do not call set_sleep for console port Sudhir Sreedharan
2014-10-09 14:45         ` Peter Hurley [this message]
2014-10-15  6:43           ` [PATCH] tty: serial: 8250_core: restore the LCR register in set_sleep Sudhir Sreedharan
2014-10-16  7:21             ` Kevin Hilman
2014-10-16 10:15               ` Sudhir Sreedharan
2014-10-16 12:35             ` Peter Hurley
2014-10-17 10:25               ` Sudhir Sreedharan
2014-10-17 12:39                 ` [PATCH v1] " Sudhir Sreedharan
2014-10-17 12:46                   ` Peter Hurley
2014-10-20 15:01                   ` Kevin Hilman
2014-10-21  6:45                     ` Sudhir Sreedharan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54369F77.5000906@hurleysoftware.com \
    --to=peter@hurleysoftware.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).