Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1424334ybl; Fri, 10 Jan 2020 18:26:28 -0800 (PST) X-Google-Smtp-Source: APXvYqyhGZU/s33gkOauoVOpYhhxGzG7rgbQbSIsxtI4samqCMQOxtYkqL47hIjPN5cSNtxATmKj X-Received: by 2002:a05:6830:22c6:: with SMTP id q6mr5464308otc.244.1578709588213; Fri, 10 Jan 2020 18:26:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578709588; cv=none; d=google.com; s=arc-20160816; b=eh62I2nY8ZBOZ4mtae7jQxdH1bPo8au4rTWFwBoYWgH/n8h4v3srJS27o6VMAh+rYo SvFPa2cnSjvlXfys2PZkkx8o2k5+eWg2/FZhtZVTho0kobCIBZHUCi1AB/WhMUAq+zdw O1apQWE2wQ1OOAqsZgS5gRyaiQxscd8KoWMJ8zyZS1M0TkK0bp0A55z/s6xgZCvIOkZ8 8HNod43v5wjSLJFjGPNJAnjwdbT4/uuNtXcVJUu628t+jsJv+RlzIXvXwFUksnJfnLnf CftaV5nB6jnzipku0MRVmKYM6pP2XVIa01TdiRvPyczKzZsZ/VTiSap0TXR5BR2bGxR9 zlJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :message-id:subject:cc:to:from:date; bh=H8Kh3QJK1vGwh5dYAIy2JgoFZVDQ7OUMLBnbGbYDq04=; b=kioIeTArsvSve2Bcwq8aCYxsVX3phnQQdSfh1Ga9Knnu2s8Gx9FhAn1zxlfBe03vPu ZRYdIqiQMMd9zlLGsfi4gBQKAor8+Iej8GofJLVlnkp9oxEQDtxrUGbW0dMaGTxKbrs+ aB6+j3rDo67SYblzy7SlQRwcefvdqn6VJG09o2dTN3fcvZe/coRYxYrrEhrjRvWA/1Ma huW+SHm0w7bfRSUJ+IPgQd+wIa1LtQHGuug3+MlDz8G2Ml8/bNvL2x/5ahVjJaGgijwy AePFkEgmN50+xOQMBs+yqGqQzvKILM/DpkOjbC/uj8OiZSnqsQsIjbQO5iOqL4/ut/e7 U7sw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i20si2641216otk.270.2020.01.10.18.26.15; Fri, 10 Jan 2020 18:26:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728089AbgAKCZU (ORCPT + 99 others); Fri, 10 Jan 2020 21:25:20 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:48827 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728027AbgAKCZT (ORCPT ); Fri, 10 Jan 2020 21:25:19 -0500 X-Originating-IP: 50.39.173.182 Received: from localhost (50-39-173-182.bvtn.or.frontiernet.net [50.39.173.182]) (Authenticated sender: josh@joshtriplett.org) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 8F8E1240004; Sat, 11 Jan 2020 02:25:15 +0000 (UTC) Date: Fri, 10 Jan 2020 18:25:13 -0800 From: Josh Triplett To: Greg Kroah-Hartman , Jiri Slaby , Arjan van de Ven Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] serial: 8250: Support disabling mdelay-filled probes of 16550A variants Message-ID: <20200111022513.GA166267@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/tty/serial/8250/8250_port.c | 3 +++ drivers/tty/serial/8250/Kconfig | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 90655910b0c7..925bc26d3f15 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -1001,6 +1001,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. diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig index fab3d4f20667..ffd167e886ae 100644 --- a/drivers/tty/serial/8250/Kconfig +++ b/drivers/tty/serial/8250/Kconfig @@ -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 -- 2.25.0.rc2