All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Walmsley <paul@pwsan.com>
To: linux-omap@vger.kernel.org, linux-serial@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Cc: Kevin Hilman <khilman@ti.com>,
	Greg Kroah-Hartman <gregkh@suse.de>,
	"Govindraj.R" <govindraj.raja@ti.com>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Alan Cox <alan@linux.intel.com>
Subject: [PATCH v2 3/3] tty: serial: omap-serial: wakeup latency constraint is in microseconds, not milliseconds
Date: Wed, 25 Jan 2012 19:50:56 -0700	[thread overview]
Message-ID: <20120126025052.31613.37828.stgit@dusk> (raw)
In-Reply-To: <20120126024903.31613.24730.stgit@dusk>

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: Kevin Hilman <khilman@ti.com>
Cc: Govindraj.R <govindraj.raja@ti.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/tty/serial/omap-serial.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 11fa156..72fa783 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -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 */
-	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;
 	schedule_work(&up->qos_work);
 



WARNING: multiple messages have this Message-ID (diff)
From: paul@pwsan.com (Paul Walmsley)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/3] tty: serial: omap-serial: wakeup latency constraint is in microseconds, not milliseconds
Date: Wed, 25 Jan 2012 19:50:56 -0700	[thread overview]
Message-ID: <20120126025052.31613.37828.stgit@dusk> (raw)
In-Reply-To: <20120126024903.31613.24730.stgit@dusk>

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: Kevin Hilman <khilman@ti.com>
Cc: Govindraj.R <govindraj.raja@ti.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/tty/serial/omap-serial.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 11fa156..72fa783 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -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 */
-	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;
 	schedule_work(&up->qos_work);
 

  parent reply	other threads:[~2012-01-26  2:50 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-26  2:50 [PATCH v2 0/3] tty: serial: OMAP: work around broken IP block, driver Paul Walmsley
2012-01-26  2:50 ` Paul Walmsley
2012-01-26  2:50 ` [PATCH v2 1/3] tty: serial: OMAP: use a 1-byte RX FIFO threshold in PIO mode Paul Walmsley
2012-01-26  2:50   ` Paul Walmsley
2012-01-26  2:50 ` [PATCH 2/3] tty: serial: OMAP: block idle while the UART is transferring data " Paul Walmsley
2012-01-26  2:50   ` Paul Walmsley
2012-01-26  2:58   ` Paul Walmsley
2012-01-26  2:58     ` Paul Walmsley
2012-01-27  7:23   ` Govindraj
2012-01-27  7:23     ` Govindraj
2012-02-20 12:35   ` Cousson, Benoit
2012-02-20 12:35     ` Cousson, Benoit
2012-02-21 22:02     ` Paul Walmsley
2012-02-21 22:02       ` Paul Walmsley
2012-02-24 14:35       ` Cousson, Benoit
2012-02-24 14:35         ` Cousson, Benoit
2012-02-28 17:13         ` Paul Walmsley
2012-02-28 17:13           ` Paul Walmsley
2012-02-28 17:22   ` [PATCH] tty: serial: OMAP: Fix oops due to NULL pdata in DT boot Cousson, Benoit
2012-02-28 17:22     ` Cousson, Benoit
2012-02-28 17:28     ` Greg KH
2012-02-28 17:28       ` Greg KH
2012-02-28 18:23       ` Kevin Hilman
2012-02-28 18:23         ` Kevin Hilman
2012-01-26  2:50 ` Paul Walmsley [this message]
2012-01-26  2:50   ` [PATCH v2 3/3] tty: serial: omap-serial: wakeup latency constraint is in microseconds, not milliseconds Paul Walmsley
2012-01-27  7:19   ` Govindraj
2012-01-27  7:19     ` Govindraj
2012-01-30 19:13 ` [PATCH v2 0/3] tty: serial: OMAP: work around broken IP block, driver Kevin Hilman
2012-01-30 19:13   ` 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=20120126025052.31613.37828.stgit@dusk \
    --to=paul@pwsan.com \
    --cc=alan@linux.intel.com \
    --cc=govindraj.raja@ti.com \
    --cc=gregkh@suse.de \
    --cc=khilman@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=tomi.valkeinen@ti.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.