]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
tty: serial: omap-serial: wakeup latency constraint is in microseconds, not milliseconds
authorPaul Walmsley <paul@pwsan.com>
Thu, 26 Jan 2012 02:50:56 +0000 (19:50 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Feb 2012 18:48:36 +0000 (10:48 -0800)
The receive FIFO wakeup latency estimate in the omap-serial driver is
three orders of magnitude too small.  This effectively prevents the
MPU from going to a low-power state when CONFIG_CPU_IDLE=y.  This is a
major power management regression and masks some other FIFO-related
bugs in the driver.

Fix by correcting the most egregious problem in the RX wakeup latency
estimate.  There are several other flaws in the estimator; these will
be fixed by a separate patch series intended for 3.4.

The difference in low-power states with this patch can be observed via
debugfs in pm_debug/count.

This estimate does not have any effect when CONFIG_CPU_IDLE=n.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Alan Cox <alan@linux.intel.com>
Acked-by: Govindraj.R <govindraj.raja@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

index 18d13248d9bad6d36221bca3e163d66228d69144..f80904145fd4e3f5faeaa6a8440f7f5596115fde 100644 (file)
@@ -740,8 +740,7 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios,
        quot = serial_omap_get_divisor(port, baud);
        /* calculate wakeup latency constraint */
        quot = serial_omap_get_divisor(port, baud);
        /* calculate wakeup latency constraint */
-       up->calc_latency = (1000000 * up->port.fifosize) /
-                               (1000 * baud / 8);
+       up->calc_latency = (USEC_PER_SEC * up->port.fifosize) / (baud / 8);
        up->latency = up->calc_latency;
        up->latency = up->calc_latency;