linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
	linux-serial@vger.kernel.org, Simon Glass <sjg@chromium.org>
Subject: [PATCH 2/3] serial: Make wakeup_capable a flag to reduce boot time
Date: Tue, 17 Jan 2012 10:56:02 -0800	[thread overview]
Message-ID: <1326826563-32215-2-git-send-email-sjg@chromium.org> (raw)
In-Reply-To: <1326826563-32215-1-git-send-email-sjg@chromium.org>

The synchronize_rcu() call resulting from making every serial driver
wake-up capable (commit b3b708fa) slows boot down by 600ms on my Tegra2x
system (with CONFIG_PREEMPT disabled).

Waking up the machine from a serial port seems to be an unlikely
requirement, so make serial_core default to not using the behaviour.

Before:
[    0.338809] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.951861] serial8250.0: ttyS0 at MMIO 0x70006040 (irq = 69) is a Tegra
[    1.666042] console [ttyS0] enabled

After:
[    0.338452] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.339016] serial8250.0: ttyS0 at MMIO 0x70006040 (irq = 69) is a Tegra
[    1.041860] console [ttyS0] enabled

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 drivers/tty/serial/serial_core.c |    6 ++++--
 include/linux/serial_core.h      |    3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index c7bf31a..0129551 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -2348,8 +2348,10 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *uport)
 	 */
 	tty_dev = tty_register_device(drv->tty_driver, uport->line, uport->dev);
 	if (likely(!IS_ERR(tty_dev))) {
-		device_init_wakeup(tty_dev, 1);
-		device_set_wakeup_enable(tty_dev, 0);
+		if (uport->wakeup_capable) {
+			device_init_wakeup(tty_dev, 1);
+			device_set_wakeup_enable(tty_dev, 0);
+		}
 	} else
 		printk(KERN_ERR "Cannot register tty device on line %d\n",
 		       uport->line);
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index c91ace7..9a87975 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -377,7 +377,8 @@ struct uart_port {
 	unsigned char		hub6;			/* this should be in the 8250 driver */
 	unsigned char		suspended;
 	unsigned char		irq_wake;
-	unsigned char		unused[2];
+	unsigned char		wakeup_capable;	/* 1 if wake-up capable */
+	unsigned char		unused;
 	void			*private_data;		/* generic platform data pointer */
 };
 
-- 
1.7.7.3


  reply	other threads:[~2012-01-17 18:56 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-17 18:56 [PATCH 1/3] serial: 8250: Remove trailing space in 8250 driver Simon Glass
2012-01-17 18:56 ` Simon Glass [this message]
2012-01-17 20:09   ` [PATCH 2/3] serial: Make wakeup_capable a flag to reduce boot time Alan Cox
2012-01-17 18:56 ` [PATCH 3/3] serial: 8250: Add a wakeup_capable module param Simon Glass
2012-01-17 20:10   ` Alan Cox
2012-01-18  4:17     ` Paul E. McKenney
2012-01-18 21:08       ` Simon Glass
2012-01-18 21:42         ` Paul E. McKenney
2012-01-18 22:15           ` Simon Glass
2012-01-18 22:43             ` Paul E. McKenney
2012-01-18 22:51               ` Simon Glass
2012-01-19  0:02               ` Rafael J. Wysocki
2012-01-19  1:37                 ` Paul E. McKenney
2012-01-19  2:35                   ` Simon Glass
2012-01-19 19:13                     ` Paul E. McKenney
2012-01-20  0:03                   ` Rafael J. Wysocki
2012-01-20  6:12                     ` Paul E. McKenney
2012-01-20 23:49                       ` Rafael J. Wysocki
2012-01-23 16:45                         ` Paul E. McKenney
2012-01-23 21:04                           ` Rafael J. Wysocki
2012-01-18 22:12         ` Alan Cox
2012-01-18 22:19           ` Simon Glass
2012-01-19  0:08         ` Rafael J. Wysocki
2012-01-19  0:58           ` Simon Glass
2012-01-18 23:07   ` [PATCH 1/2] power: Add function to init wakeup capability without enabling Simon Glass
2012-01-18 23:07     ` [PATCH 2/2] serial: Use device_init_wakeup_flag() to make device wakeup-capable Simon Glass
2012-01-19  0:10     ` [PATCH 1/2] power: Add function to init wakeup capability without enabling Rafael J. Wysocki

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=1326826563-32215-2-git-send-email-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /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 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 NNTP newsgroup(s).