linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mayank Rana <mrana@codeaurora.org>
To: Ning Jiang <ning.jiang@marvell.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
	Alan Cox <alan@linux.intel.com>,
	Yin Kangkai <kangkai.yin@linux.intel.com>,
	linux-serial@vger.kernel.orglinux-serial@vger.kernel.org
Subject: Re: [PATCH] serial-core: power up uart port early before we do set_termios when resuming
Date: Mon, 05 Sep 2011 14:47:25 +0530	[thread overview]
Message-ID: <4E6493A5.50807@codeaurora.org> (raw)
In-Reply-To: <1315211298-17318-1-git-send-email-ning.jiang@marvell.com>

On 9/5/2011 1:58 PM, Ning Jiang wrote:
> The following patch removed uart_change_pm() in uart_resume_port():
>
> commit 5933a161abcb8d83a2c145177f48027c3c0a8995
> Author: Yin Kangkai<kangkai.yin@linux.intel.com>
>      serial-core: reset the console speed on resume
>
> It will break the pxa serial driver when the system resumes from suspend mode
> as it will try to set baud rate divider register in set_termios but with
> clock off. The register value can not be set correctly on some platform if
> the clock is disabled. The pxa driver will check the value and report the
> following warning:
>
> ------------[ cut here ]------------
> WARNING: at drivers/tty/serial/pxa.c:545 serial_pxa_set_termios+0x1dc/0x250()
> Modules linked in:
> [<c0281f30>] (unwind_backtrace+0x0/0xf0) from [<c029341c>] (warn_slowpath_common+0x4c/0x64)
> [<c029341c>] (warn_slowpath_common+0x4c/0x64) from [<c029344c>] (warn_slowpath_null+0x18/0x1c)
> [<c029344c>] (warn_slowpath_null+0x18/0x1c) from [<c044b1e4>] (serial_pxa_set_termios+0x1dc/0x250)
> [<c044b1e4>] (serial_pxa_set_termios+0x1dc/0x250) from [<c044a840>] (uart_resume_port+0x128/0x2dc)
> [<c044a840>] (uart_resume_port+0x128/0x2dc) from [<c044bbe0>] (serial_pxa_resume+0x18/0x24)
> [<c044bbe0>] (serial_pxa_resume+0x18/0x24) from [<c0454d34>] (platform_pm_resume+0x40/0x4c)
> [<c0454d34>] (platform_pm_resume+0x40/0x4c) from [<c0457ebc>] (pm_op+0x68/0xb4)
> [<c0457ebc>] (pm_op+0x68/0xb4) from [<c0458368>] (device_resume+0xb0/0xec)
> [<c0458368>] (device_resume+0xb0/0xec) from [<c04584c8>] (dpm_resume+0xe0/0x194)
> [<c04584c8>] (dpm_resume+0xe0/0x194) from [<c0458588>] (dpm_resume_end+0xc/0x18)
> [<c0458588>] (dpm_resume_end+0xc/0x18) from [<c02c518c>] (suspend_devices_and_enter+0x16c/0x1ac)
> [<c02c518c>] (suspend_devices_and_enter+0x16c/0x1ac) from [<c02c5278>] (enter_state+0xac/0xdc)
> [<c02c5278>] (enter_state+0xac/0xdc) from [<c02c48ec>] (state_store+0xa0/0xbc)
> [<c02c48ec>] (state_store+0xa0/0xbc) from [<c0408f7c>] (kobj_attr_store+0x18/0x1c)
> [<c0408f7c>] (kobj_attr_store+0x18/0x1c) from [<c034a6a4>] (sysfs_write_file+0x108/0x140)
> [<c034a6a4>] (sysfs_write_file+0x108/0x140) from [<c02fb798>] (vfs_write+0xac/0x134)
> [<c02fb798>] (vfs_write+0xac/0x134) from [<c02fb8cc>] (sys_write+0x3c/0x68)
> [<c02fb8cc>] (sys_write+0x3c/0x68) from [<c027c700>] (ret_fast_syscall+0x0/0x2c)
> ---[ end trace 88289eceb4675b04 ]---
>
> This patch fix the problem by adding the power on opertion back for uart
> console when console_suspend_enabled is true.
>
> Signed-off-by: Ning Jiang<ning.jiang@marvell.com>
> ---
>   drivers/tty/serial/serial_core.c |    2 ++
>   1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
> index 5c04cb9..4f75918 100644
> --- a/drivers/tty/serial/serial_core.c
> +++ b/drivers/tty/serial/serial_core.c
> @@ -1981,6 +1981,8 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport)
>   		if (port->tty&&  port->tty->termios&&  termios.c_cflag == 0)
>   			termios = *(port->tty->termios);
>
> +		if (console_suspend_enabled)
> +			uart_change_pm(state, 0);
>   		uport->ops->set_termios(uport,&termios, NULL);
>   		if (console_suspend_enabled)
>   			console_start(uport->cons);
I just found the same issue. Looks good to me.

Feel free to add,
Tested-by: Mayank Rana <mrana@codeaurora.org>

-- 
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

  reply	other threads:[~2011-09-05  9:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-05  8:28 [PATCH] serial-core: power up uart port early before we do set_termios when resuming Ning Jiang
2011-09-05  9:17 ` Mayank Rana [this message]
2011-09-06  2:23   ` Ning Jiang
2011-09-05 14:03 ` Yin Kangkai

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=4E6493A5.50807@codeaurora.org \
    --to=mrana@codeaurora.org \
    --cc=alan@linux.intel.com \
    --cc=gregkh@suse.de \
    --cc=kangkai.yin@linux.intel.com \
    --cc=linux-serial@vger.kernel.orglinux-serial \
    --cc=ning.jiang@marvell.com \
    /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).