Kevin Hilman <khilman@xxxxxxxxxxxxxxxxxxx> writes: > Tero Kristo <tero.kristo@xxxxxxxxx> writes: > >> From: Tero Kristo <tero.kristo@xxxxxxxxx> >> >> 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. OK, I'm dropping this patch from the PM branch. It has caused me more problems that it has solved so far, and I just noticed that UART2-based consoles (n900, beagle) stop working all together when I enable UART timeouts with this patch. Seems to be again related to the garbage timer. What I would like to see instead is UART hwmods finished and the omap-serial driver merged so that we can start moving this PM logic into the omap-serial driver using the runtime PM layer. 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 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html