aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2012-01-19 14:28:56 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2012-01-24 19:29:40 -0500
commit773598357c0baf03081cf87f2b444f97744faf1e (patch)
tree07f8ce8410a1f779e8a16c614b52ec739366b49d /drivers/tty
parenta5492e6591b8fdf171236046f9d6194f9bb4062b (diff)
serial: Fix wakeup init logic to speed up startup
The synchronize_rcu() call resulting from making every serial driver wake-up capable (commit b3b708fa) slows boot down on my Tegra2x system (with CONFIG_PREEMPT disabled). But this is avoidable since it is the device_set_wakeup_enable() and then subsequence disable which causes the delay. We might as well just make the device wakeup capable but not actually enable it for wakeup until needed. Effectively the current code does this: device_set_wakeup_capable(dev, 1); device_set_wakeup_enable(dev, 1); device_set_wakeup_enable(dev, 0); We can just drop the last two lines. Before this change my boot log says: [ 0.227062] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled [ 0.702928] serial8250.0: ttyS0 at MMIO 0x70006040 (irq = 69) is a Tegra after: [ 0.227264] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled [ 0.227983] serial8250.0: ttyS0 at MMIO 0x70006040 (irq = 69) is a Tegra for saving of 450ms. Suggested-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/serial_core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index c7bf31a6a7e7..13056180adf5 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -2348,11 +2348,11 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *uport)
2348 */ 2348 */
2349 tty_dev = tty_register_device(drv->tty_driver, uport->line, uport->dev); 2349 tty_dev = tty_register_device(drv->tty_driver, uport->line, uport->dev);
2350 if (likely(!IS_ERR(tty_dev))) { 2350 if (likely(!IS_ERR(tty_dev))) {
2351 device_init_wakeup(tty_dev, 1); 2351 device_set_wakeup_capable(tty_dev, 1);
2352 device_set_wakeup_enable(tty_dev, 0); 2352 } else {
2353 } else
2354 printk(KERN_ERR "Cannot register tty device on line %d\n", 2353 printk(KERN_ERR "Cannot register tty device on line %d\n",
2355 uport->line); 2354 uport->line);
2355 }
2356 2356
2357 /* 2357 /*
2358 * Ensure UPF_DEAD is not set. 2358 * Ensure UPF_DEAD is not set.