From patchwork Mon Oct 24 11:27:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9064 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp444487wru; Mon, 24 Oct 2022 06:11:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Oa7aNTRbKfAaKT0VWbITdkEgF5+4hTxt7XJ9hEngidtB2sYnVEA6p3DPnt1b5NgnD3DFG X-Received: by 2002:a17:903:2347:b0:181:33f0:f64e with SMTP id c7-20020a170903234700b0018133f0f64emr34742860plh.106.1666617076626; Mon, 24 Oct 2022 06:11:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666617076; cv=none; d=google.com; s=arc-20160816; b=Lgh1m4U7W2Tk3g+MEqxip5AHoykWPRgVVXTF5/l58NsZEZ2mRXwm1KAQktRrmqdHfC ZpBSwtzab94F7gdChd0sYDZx6RoNAcbMY8qHD1f9uhZbsSDg+ygeidaJxDWRF1UJC04D Ba2TJ9aoNxIY9CCF5CgfOGxPafSKVRN1Tgh/u/u+rR8+fM9wlYggv5Q2O1Xl7IVf3tNj 4Ejd1gu3Lswv43bQO1Cndo8tBwGvra25G4XUePPk3uXX1awyLqjmgfcxdCniBoM4OqMS EzYbe4WX+rjQ4aQTU6e6LgWRG/IT3N0ys9SnSGSXVnrhGfzodHxqnw0pHoLuUZHTRlE8 NPXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+LKN5+Eg7FxgD9yxKrDIVNuci2hpFSLkHH7nCxtENiU=; b=bEPdfNM/L+Jw6FIEmv3m2ilwkG10MjGC8v1Vn/19z0wUXPrqn/Nd77yIqoaH7UsNMz frBIEx2UzXOwT+Lmg+vIDaYG30eeGhxpmWA+VmxUk467FmBhMaTf6vbrWihVHUPROavJ LskPSJOKQjeYRMPOUr2iOHl4sRd5ipVX2+G3+dvfH/QDDPtoJd1PWLD9IoY6+33Biemt l0Fvz/swXvTi/647iB36yw7PS4jUqQSKw4qIUahqJRaetKADlgpDK2u2eqvT1qQpkC6i tuFKaObk0hpgfbOYXlrAxK5Mh3qmZD02OQmuAPc5/fZD7h8IXrxgCYdEgiYxds3NmtAK Fr3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wqoy5r9A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q34-20020a635c22000000b0043c9db24662si34901503pgb.269.2022.10.24.06.10.57; Mon, 24 Oct 2022 06:11:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wqoy5r9A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235454AbiJXNKl (ORCPT + 99 others); Mon, 24 Oct 2022 09:10:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235398AbiJXNIh (ORCPT ); Mon, 24 Oct 2022 09:08:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86D079E695; Mon, 24 Oct 2022 05:21:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 73916612B7; Mon, 24 Oct 2022 12:17:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86366C433D6; Mon, 24 Oct 2022 12:17:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613868; bh=8j/hBLOsYo8yX4R150T2KOPNdqBx1AJPZk1FWeqZP6Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wqoy5r9A97FgNBIihVjXI0Q/0ML/L+l6F7ouqfncRLXzgFwZFkkj0AoBSosK+C1xT VsIlQdIPhRK8Fcqkl+cRCUJmOFe0B6kKAgpzO9LeN7I9lclLbqaqacdT/rwublECsX azemMnXy2EAZ390lb2N/T1YelbK9hDHmGEP/qK3o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Anders Blomdell , "Maciej W. Rozycki" Subject: [PATCH 5.10 044/390] serial: 8250: Let drivers request full 16550A feature probing Date: Mon, 24 Oct 2022 13:27:21 +0200 Message-Id: <20221024113024.492214172@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747574667640278231?= X-GMAIL-MSGID: =?utf-8?q?1747574667640278231?= From: Maciej W. Rozycki commit 9906890c89e4dbd900ed87ad3040080339a7f411 upstream. A SERIAL_8250_16550A_VARIANTS configuration option has been recently defined that lets one request the 8250 driver not to probe for 16550A device features so as to reduce the driver's device startup time in virtual machines. Some actual hardware devices require these features to have been fully determined however for their driver to work correctly, so define a flag to let drivers request full 16550A feature probing on a device-by-device basis if required regardless of the SERIAL_8250_16550A_VARIANTS option setting chosen. Fixes: dc56ecb81a0a ("serial: 8250: Support disabling mdelay-filled probes of 16550A variants") Cc: stable@vger.kernel.org # v5.6+ Reported-by: Anders Blomdell Signed-off-by: Maciej W. Rozycki Link: https://lore.kernel.org/r/alpine.DEB.2.21.2209202357520.41633@angie.orcam.me.uk Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_port.c | 3 ++- include/linux/serial_core.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -1021,7 +1021,8 @@ static void autoconfig_16550a(struct uar up->port.type = PORT_16550A; up->capabilities |= UART_CAP_FIFO; - if (!IS_ENABLED(CONFIG_SERIAL_8250_16550A_VARIANTS)) + if (!IS_ENABLED(CONFIG_SERIAL_8250_16550A_VARIANTS) && + !(up->port.flags & UPF_FULL_PROBE)) return; /* --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -100,7 +100,7 @@ struct uart_icount { __u32 buf_overrun; }; -typedef unsigned int __bitwise upf_t; +typedef u64 __bitwise upf_t; typedef unsigned int __bitwise upstat_t; struct uart_port { @@ -207,6 +207,7 @@ struct uart_port { #define UPF_FIXED_PORT ((__force upf_t) (1 << 29)) #define UPF_DEAD ((__force upf_t) (1 << 30)) #define UPF_IOREMAP ((__force upf_t) (1 << 31)) +#define UPF_FULL_PROBE ((__force upf_t) (1ULL << 32)) #define __UPF_CHANGE_MASK 0x17fff #define UPF_CHANGE_MASK ((__force upf_t) __UPF_CHANGE_MASK)