From patchwork Sat Oct 22 07:19:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7826 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1147182wrr; Sat, 22 Oct 2022 03:46:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Vun+L/Xp60iuBef2przGaV6rVbCuLBk7cNZFm7wvgc8r9l0gHRi/q8VuupWHHimiG+oX6 X-Received: by 2002:aa7:cf0b:0:b0:461:2271:8559 with SMTP id a11-20020aa7cf0b000000b0046122718559mr10042400edy.92.1666435591716; Sat, 22 Oct 2022 03:46:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666435591; cv=none; d=google.com; s=arc-20160816; b=tFvRVqNCZN1pVfeiHPBs0/+3WGmmbaXjc5pO2non2WSY26jN1OeOYn5S4p0vI7kNRy d8U19+TPYYtPiZ2Fc1Q+TrNT6BtoGWbeqowJ5HwqzZqjx3JaaI99+op6u8hL1kp5e0+b 2m8pdQYLbKqLBAZt7DcHgIDEIdQbzZsS+jJg+HAbf0JdMyLp0l31b3WDwu5ERsMSaYhq w9sWm4Et15TA6jEbrGmnYHj4DG4lNNk3xODTMWZrQVrpdND77Xj7EFeB+HeL2a+3zx85 xCJ//g7Zrc18EOpSKj5XDPhyZB2pnTXjEnIt58zOLA9KhvH/TfIwwl/oFPP5WvLz4MoK DW5w== 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=MT5fLglLmvmQg0ud0fu57zeWJSmnarkoApGK6TvTKM8=; b=rXj1CwDKt4n2VgsStQZBi68f3AJ/bwwzDI0vRMadwboW6aiI7CDh9A9RvKE7paYKtp JCIvDQa7ko7b5jI6B06EPgsMMVmU8qEHhkWmlfwgUVK91NoXsVoB3SEZ2UwdcoQj9PAT Scz9tWnnJ5YFO9onw3qG6RrPh+59etAlMLW4Vbu+OsbPlqesP0mCXdaCYqMtFoDg79mQ HSM5MYE/uxkBbBg9yxzrGG53ytBFVPmbxDR7/PShjvl2TT+RBLvqNRMROiZUS0j2G3Tt QwhVnb7/4ZfS5xqlVnnrkz+6/HRSED58A2AiEUP6oCZ1gEBura1Rx4X+lkqAAJVXfNar H2vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Mynq8NWP; 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 u20-20020a17090617d400b0078d93325645si20231688eje.405.2022.10.22.03.46.07; Sat, 22 Oct 2022 03:46:31 -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=Mynq8NWP; 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 S230254AbiJVKjm (ORCPT + 99 others); Sat, 22 Oct 2022 06:39:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230015AbiJVKjQ (ORCPT ); Sat, 22 Oct 2022 06:39:16 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D97156BBB; Sat, 22 Oct 2022 02:56:55 -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 ams.source.kernel.org (Postfix) with ESMTPS id 6B987B82DF4; Sat, 22 Oct 2022 07:37:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6EACC433C1; Sat, 22 Oct 2022 07:37:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424272; bh=q+8IZv14OH8z7nHWlSQwAYSMLSmzzRxf767zndaIaCM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mynq8NWPVt8bXR6JOMsTmXEKSNNR9NumMm4V/U8ErMNo1e0KOyFzCIBD6BAj/d+Dd EgX+BSrFsnz57h+ekRORAHU3x5nzWhm5nuPuZAgK4yllbfuq176JQjXODMrQ35gkJ/ P0LC1JeI/ZrjrPYu4nuy5Jr7pwjL51ysdLibrOJ4= 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.19 084/717] serial: 8250: Let drivers request full 16550A feature probing Date: Sat, 22 Oct 2022 09:19:23 +0200 Message-Id: <20221022072430.217746516@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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?1747384367055233032?= X-GMAIL-MSGID: =?utf-8?q?1747384367055233032?= 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 @@ -1029,7 +1029,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 @@ -101,7 +101,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 { @@ -208,6 +208,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)