All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: Tero Kristo <tero.kristo@nokia.com>
Cc: linux-omap@vger.kernel.org, Peter Tseng <tsenpet09@gmail.com>
Subject: Re: [PATCHv7] OMAP3: Serial: Improved sleep logic
Date: Thu, 08 Apr 2010 10:32:11 -0700	[thread overview]
Message-ID: <87vdc14zqc.fsf@deeprootsystems.com> (raw)
In-Reply-To: <1268408332-15579-1-git-send-email-tero.kristo@nokia.com> (Tero Kristo's message of "Fri\, 12 Mar 2010 17\:38\:52 +0200")

Tero Kristo <tero.kristo@nokia.com> writes:

> From: Tero Kristo <tero.kristo@nokia.com>
>
> This patch contains following improvements:
> - Only RX interrupt will now kick the sleep prevent timer
> - TX fifo status is checked before disabling clocks, this will prevent
>   on-going transmission to be cut
> - Smartidle is now enabled/disabled only while switching clocks, as having
>   smartidle enabled while RX/TX prevents any wakeups from being received
>   from UART module
> - Added workqueue for wakeup checks, as jiffy timer access within the
>   idle loop results into skewed timers as jiffy timers are stopped
> - Added garbage_timer for ignoring the first character received during
>   the first tick after clock enable, this prevents garbage characters to be
>   received in low sleep states
> - omap_uart_enable_irqs() changed to use enable_irq / disable_irq instead
>   of request / free. Using request/free changes the behavior after first
>   suspend due to reversed interrupt handler ordering

Hi Tero,

FYI... I had to make one additional change (diff below) to this patch
after discovering a regression pointed out by Peter Tseng.

If the UART timeouts are disabled (set to zero), which they are by
default, and you suspend the system, the UART would not be usable
after wakeup.   Simply enabling a timeout was fixing the problem.

I tracked the problem to the garbage timer being enabled even when
the UART timeout was not enabled.  Since the garbage_ignore flag
is only ever cleared when a uart->timeout is set, the garbage
timer was never being disabled, effectively disabling the UART.

I've folded this fix below into your patch in the pm-fixes branch
and pushed a new PM branch.

Kevin


diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index b731556..b709cf8 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -396,7 +396,8 @@ void omap_uart_prepare_idle(int num)
 
 static void serial_wakeup(struct omap_uart_state *uart)
 {
-	uart->garbage_ignore = 1;
+	if (uart->timeout)
+		uart->garbage_ignore = 1;
 	schedule_work(&uart->wakeup_work);
 }
 
k

  parent reply	other threads:[~2010-04-08 17:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-12 15:38 [PATCHv7] OMAP3: Serial: Improved sleep logic Tero Kristo
2010-03-15 18:49 ` Kevin Hilman
2010-04-08 17:32 ` Kevin Hilman [this message]
2010-05-11 23:15   ` Kevin Hilman

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=87vdc14zqc.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=tero.kristo@nokia.com \
    --cc=tsenpet09@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.