LKML Archive mirror
 help / color / mirror / Atom feed
* [RFC] serial: omap-serial: Enable the UART wake-up bits always
@ 2011-01-24 15:51 Jarkko Nikula
  2011-02-04 15:47 ` Jarkko Nikula
  0 siblings, 1 reply; 2+ messages in thread
From: Jarkko Nikula @ 2011-01-24 15:51 UTC (permalink / raw
  To: linux-omap
  Cc: linux-kernel, Greg Kroah-Hartman, Tony Lindgren, Jarkko Nikula,
	Govindraj.R

OMAP can do also dynamic idling so wake-up enable register should be set
also while system is running. If UART_OMAP_WER is not set, then for instance
the RX activity cannot wake up the UART port that is sleeping.

This RX wake-up feature was working when the 8250 driver was used instead
of omap-serial. Reason for this is that the 8250 doesn't set the
UART_OMAP_WER and then arch/arm/mach-omap2/pm34xx.c ends up saving and
restoring the reset default which is the same than value
OMAP_UART_WER_MOD_WKUP here.

Fix this by moving the conditional UART_OMAP_WER write from serial_omap_pm
into serial_omap_startup where wake-up bits are set unconditionally.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Cc: Govindraj.R <govindraj.raja@ti.com>
---
This problem has been here since 2.6.37 when the omap-serial was switched
into use so this patch is for 2.6.39.
---
 drivers/serial/omap-serial.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/serial/omap-serial.c b/drivers/serial/omap-serial.c
index 7f2f010..d40924a 100644
--- a/drivers/serial/omap-serial.c
+++ b/drivers/serial/omap-serial.c
@@ -517,6 +517,9 @@ static int serial_omap_startup(struct uart_port *port)
 	up->ier = UART_IER_RLSI | UART_IER_RDI;
 	serial_out(up, UART_IER, up->ier);
 
+	/* Enable module level wake up */
+	serial_out(up, UART_OMAP_WER, OMAP_UART_WER_MOD_WKUP);
+
 	up->port_activity = jiffies;
 	return 0;
 }
@@ -824,9 +827,6 @@ serial_omap_pm(struct uart_port *port, unsigned int state,
 	serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
 	serial_out(up, UART_EFR, efr);
 	serial_out(up, UART_LCR, 0);
-	/* Enable module level wake up */
-	serial_out(up, UART_OMAP_WER,
-		(state != 0) ? OMAP_UART_WER_MOD_WKUP : 0);
 }
 
 static void serial_omap_release_port(struct uart_port *port)
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RFC] serial: omap-serial: Enable the UART wake-up bits always
  2011-01-24 15:51 [RFC] serial: omap-serial: Enable the UART wake-up bits always Jarkko Nikula
@ 2011-02-04 15:47 ` Jarkko Nikula
  0 siblings, 0 replies; 2+ messages in thread
From: Jarkko Nikula @ 2011-02-04 15:47 UTC (permalink / raw
  To: linux-omap; +Cc: linux-kernel, Greg Kroah-Hartman, Tony Lindgren, Govindraj.R

On Mon, 24 Jan 2011 17:51:22 +0200
Jarkko Nikula <jhnikula@gmail.com> wrote:

> OMAP can do also dynamic idling so wake-up enable register should be set
> also while system is running. If UART_OMAP_WER is not set, then for instance
> the RX activity cannot wake up the UART port that is sleeping.
> 
> This RX wake-up feature was working when the 8250 driver was used instead
> of omap-serial. Reason for this is that the 8250 doesn't set the
> UART_OMAP_WER and then arch/arm/mach-omap2/pm34xx.c ends up saving and
> restoring the reset default which is the same than value
> OMAP_UART_WER_MOD_WKUP here.
> 
> Fix this by moving the conditional UART_OMAP_WER write from serial_omap_pm
> into serial_omap_startup where wake-up bits are set unconditionally.
> 
> Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
> Cc: Govindraj.R <govindraj.raja@ti.com>
> ---
> This problem has been here since 2.6.37 when the omap-serial was switched
> into use so this patch is for 2.6.39.
> ---
For omap folks:

1. This patch is coming through tty tree
http://git.kernel.org/?p=linux/kernel/git/gregkh/tty-2.6.git;a=commit;h=78841462d72fe7038cb7ea48adecc6fc395f2dc5

2. This patch helps those boards that don't have UART RTS signal (e.g.
BeagleBoard) and thus padconf wakeup mechanism is not available.

-- 
Jarkko

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-02-04 15:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-24 15:51 [RFC] serial: omap-serial: Enable the UART wake-up bits always Jarkko Nikula
2011-02-04 15:47 ` Jarkko Nikula

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 read-only IMAP folder(s) and NNTP newsgroup(s).