]> git.baikalelectronics.ru Git - kernel.git/commit
serial: Fix wakeup init logic to speed up startup
authorSimon Glass <sjg@chromium.org>
Thu, 19 Jan 2012 19:28:56 +0000 (11:28 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 25 Jan 2012 00:29:40 +0000 (16:29 -0800)
commitee2dd25d9ca919054638680a8ed15543e03eb00e
tree07f8ce8410a1f779e8a16c614b52ec739366b49d
parent9d7e94707cf62b78f4b8d108cc11a9db8cbb54cf
serial: Fix wakeup init logic to speed up startup

The synchronize_rcu() call resulting from making every serial driver
wake-up capable (commit 93250b02) 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>
drivers/tty/serial/serial_core.c