* [PATCH] serial: sh-sci: fix deadlock when resuming from S3 sleep
@ 2011-03-03 8:04 Alexandre Courbot
2011-03-04 6:57 ` Paul Mundt
0 siblings, 1 reply; 2+ messages in thread
From: Alexandre Courbot @ 2011-03-03 8:04 UTC (permalink / raw)
To: linux-sh
S3 sleep invokes the shutdown callback of the sh-sci driver, which
suspends the clocks until they are reactivated by a call to startup.
However, before the latter is invoked, sci_set_termios may be called on
the port by uart_resume_port. In such cases it will endlessly wait for
the TEND bit to raise, which will never happen since the clocks are
disabled.
This patch ensures that clocks are enabled when ports registers are
manipulated within sci_set_termios.
Signed-off-by: Alexandre Courbot <gnurou@gmail.com>
---
drivers/tty/serial/sh-sci.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index e180bc9..264209c 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -1504,6 +1504,9 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
if (likely(baud && port->uartclk))
t = sci_scbrr_calc(s->cfg->scbrr_algo_id, baud, port->uartclk);
+ if (s->enable)
+ s->enable(port);
+
do {
status = sci_in(port, SCxSR);
} while (!(status & SCxSR_TEND(port)));
@@ -1571,6 +1574,9 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
if ((termios->c_cflag & CREAD) != 0)
sci_start_rx(port);
+
+ if (s->disable)
+ s->disable(port);
}
static const char *sci_type(struct uart_port *port)
--
1.7.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] serial: sh-sci: fix deadlock when resuming from S3 sleep
2011-03-03 8:04 [PATCH] serial: sh-sci: fix deadlock when resuming from S3 sleep Alexandre Courbot
@ 2011-03-04 6:57 ` Paul Mundt
0 siblings, 0 replies; 2+ messages in thread
From: Paul Mundt @ 2011-03-04 6:57 UTC (permalink / raw)
To: linux-sh
On Thu, Mar 03, 2011 at 05:04:42PM +0900, Alexandre Courbot wrote:
> S3 sleep invokes the shutdown callback of the sh-sci driver, which
> suspends the clocks until they are reactivated by a call to startup.
> However, before the latter is invoked, sci_set_termios may be called on
> the port by uart_resume_port. In such cases it will endlessly wait for
> the TEND bit to raise, which will never happen since the clocks are
> disabled.
>
> This patch ensures that clocks are enabled when ports registers are
> manipulated within sci_set_termios.
>
> Signed-off-by: Alexandre Courbot <gnurou@gmail.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-03-04 6:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-03 8:04 [PATCH] serial: sh-sci: fix deadlock when resuming from S3 sleep Alexandre Courbot
2011-03-04 6:57 ` Paul Mundt
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).