Re: [PATCHv3] OMAP3: Serial: Improved sleep logic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Tero Kristo <tero.kristo@xxxxxxxxx> [100211 03:48]:
> 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 disabled while entering idle if we have data in the transmit
>   buffer because having this enabled would prevent wakeups from the TX
>   interrupt and this would cause pauses while sending large blocks of data
> - Sleep prevent timer is changed to use ktime_get() instead of a jiffy timer
>   as jiffy timers are not valid within idle loop (tick scheduler is stopped)
> - Added RX ignore timer for ignoring the first character received during
>   first millisecond of wakeup, this prevents garbage character to be received
>   in low sleep states

Cool, sounds like the way to go. Note that current mainline kernel has
the DEFAULT_TIMEOUT set to 0 because of the lost/corrupt characters.
 
> --- a/arch/arm/mach-omap2/serial.c
> +++ b/arch/arm/mach-omap2/serial.c
> @@ -36,13 +39,14 @@
>  #define UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV	0x52
>  #define UART_OMAP_WER		0x17	/* Wake-up enable register */
>  
> -#define DEFAULT_TIMEOUT (5 * HZ)
> +#define DEFAULT_TIMEOUT (5LL * NSEC_PER_SEC)

Won't apply to mainline..
  
> @@ -420,9 +443,9 @@ static void omap_uart_idle_init(struct omap_uart_state *uart)
>  
>  	uart->can_sleep = 0;
>  	uart->timeout = DEFAULT_TIMEOUT;
> -	setup_timer(&uart->timer, omap_uart_idle_timer,
> -		    (unsigned long) uart);
> -	mod_timer(&uart->timer, jiffies + uart->timeout);
> +
> +	uart->expire_time = ktime_add_ns(ktime_get(), uart->timeout);
> +
>  	omap_uart_smart_idle_enable(uart, 0);
>  
>  	if (cpu_is_omap34xx()) {

And the above should probably be:

	if (uart->timeout)
		uart->expire_time = ktime_add_ns(ktime_get(), uart->timeout); 

In order to support zero default timeout. Some other changes
may be necessary too if DEFAULT_TIMEOUT is 0.

Regards,

Tony
--
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

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux