]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
serial: 8250: Support disabling mdelay-filled probes of 16550A variants
authorJosh Triplett <josh@joshtriplett.org>
Sat, 11 Jan 2020 02:25:13 +0000 (18:25 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jan 2020 13:07:50 +0000 (14:07 +0100)
The 8250 driver can probe for many variants of the venerable 16550A
serial port. Some of those probes involve long (20ms) mdelay calls,
which delay system boot. Modern systems and virtual machines don't have
those variants.

Provide a Kconfig option to disable probes for 16550A variants.
Disabling this speeds up the boot of a virtual machine with a serial
console by more than 20ms (a substantial fraction of the ~100ms needed
to boot a carefully configured VM).

Before:
[  +0.021919] 00:04: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
After:
[  +0.000097] 00:04: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Link: https://lore.kernel.org/r/20200111022513.GA166267@localhost
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_port.c
drivers/tty/serial/8250/Kconfig

index 8243f280a2ec884c2d86867ea04943ff2bb943c7..c4330d40c63826a1ca3960e6fe0aa15ab9dab92c 100644 (file)
@@ -997,6 +997,9 @@ static void autoconfig_16550a(struct uart_8250_port *up)
        up->port.type = PORT_16550A;
        up->capabilities |= UART_CAP_FIFO;
 
+       if (!IS_ENABLED(CONFIG_SERIAL_8250_16550A_VARIANTS))
+               return;
+
        /*
         * Check for presence of the EFR when DLAB is set.
         * Only ST16C650V1 UARTs pass this test.
index fab3d4f20667cc3a8dde66c65ca1fee8f92b74b5..ffd167e886aeb24e3aac21eac37b9efef8341565 100644 (file)
@@ -60,6 +60,16 @@ config SERIAL_8250_PNP
          This builds standard PNP serial support. You may be able to
          disable this feature if you only need legacy serial support.
 
+config SERIAL_8250_16550A_VARIANTS
+       bool "Support for variants of the 16550A serial port"
+       depends on SERIAL_8250
+       help
+         The 8250 driver can probe for many variants of the venerable 16550A
+         serial port. Doing so takes additional time at boot.
+
+         On modern systems, especially those using serial only for a simple
+         console, you can say N here.
+
 config SERIAL_8250_FINTEK
        bool "Support for Fintek F81216A LPC to 4 UART RS485 API"
        depends on SERIAL_8250