From patchwork Sat Oct 22 07:19:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7317 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1093526wrr; Sat, 22 Oct 2022 00:57:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5A+ClYCnHXgqn0wmrAKhtb9wv54w3H0ZhSP6Yjz+LEOer+M0Mpy4kShgkVBPGui12c7Luq X-Received: by 2002:a17:902:bcc4:b0:181:899a:ac9c with SMTP id o4-20020a170902bcc400b00181899aac9cmr23164171pls.124.1666425455147; Sat, 22 Oct 2022 00:57:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666425455; cv=none; d=google.com; s=arc-20160816; b=S6ZV1r0kKyuwjLmJ3IhB5yCSJ3GaJbFxHtkAw3/lwCHmR6UifPZaoD8sHzYC+1+7uF QzYAfHPPJOAOsonwex/KFZS4p/akHasbhTiPf/MdWnEsI5R2RtBfEc9W9y5zdyPMed3K tKD9L1hX4nO7yfdYK8I90hDXe2JzoX+yOj3Ju7IzqP/4g6d3BKstlNjS/xwvfhxP3Hez +C2q+1FU4qeY5fsBDfrUvpnF0PZyzRiNeuWMyM2kNrnVxtWHM76gLYjC13MKB03bEZYI 1gwGoFYMCLXbmtGk0pVw5QyUm54rytLpNJsPZJJ4e/JiCNU2TySzriNOZWr8B2Y+oCCm zvzA== 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=35nkcKqg/djFkP+ku/hANpLWIdFwCEvViUVnXhUKETQ=; b=CYmYkxIvh67J2JJbWxN+efBtj6YdvHYxWn+fCqrAQmjbqU+lmPlA+mp9vljtO694r/ eLwG0hPzz1MdPfuOBOx8Qu9YxDiu/Ljt1vuHz8QmcSYDgMF/C0JVIDnA9w1memNgMNFV HXgFZ/JXxfp5NeSu+Q8EVaPnL90OiDKkFl/xOeAhv3NFjbJEUb6Ov3GuRzbxC4KGIPrG DaS2xdI8MeiA2j08/XmaH/rJN1tvMb0oApE20U01G0hooRdPtlGriyQ8zNUOeGay2CfL ZPlky3OlHoMXsxODDH2T61I2IQVyOPfmPtImZVwuR/I84tl3OkKGkt2tLnnsYODvKihG ZIpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vahydwHK; 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 d5-20020a170902b70500b0017f7e1387easi26464602pls.217.2022.10.22.00.57.22; Sat, 22 Oct 2022 00:57:35 -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=vahydwHK; 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 S230349AbiJVH5F (ORCPT + 99 others); Sat, 22 Oct 2022 03:57:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231986AbiJVHxS (ORCPT ); Sat, 22 Oct 2022 03:53:18 -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 AFB0E66F0D; Sat, 22 Oct 2022 00:47:06 -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 93EF2B82DF1; Sat, 22 Oct 2022 07:37:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0279CC433D6; Sat, 22 Oct 2022 07:37:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424275; bh=4utioZOXlyo9oAiwlzw67riLL6LaXsoNJjJMJzcvKEs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vahydwHKt+tKAaC1cVTTHKhc9h6xfbq9Ib9EMYCfi2AwGYKTzxGkao8VQpLi44EtN aAtC+/bOwAeWjh68EZdNcUMH/9ulRDe/8VM5zjDhFsudyIoibAh+gslpV4tcaCvSZD fb0xthaUELhYFstUQ8AMt28B5yh4wBG7Aney6ddk= 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 085/717] serial: 8250: Request full 16550A feature probing for OxSemi PCIe devices Date: Sat, 22 Oct 2022 09:19:24 +0200 Message-Id: <20221022072430.414870964@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.3 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?1747373738386630894?= X-GMAIL-MSGID: =?utf-8?q?1747373738386630894?= From: Maciej W. Rozycki commit 00b7a4d4ee42be1c515e56cb1e8ba0f25e271d8e upstream. Oxford Semiconductor PCIe (Tornado) 950 serial port devices need to operate in the enhanced mode via the EFR register for the Divide-by-M N/8 baud rate generator prescaler to be used in their native UART mode. Otherwise the prescaler is fixed at 1 causing grossly incorrect baud rates to be programmed. Accessing the EFR register requires 16550A features to have been probed for, so request this to happen regardless of SERIAL_8250_16550A_VARIANTS by setting UPF_FULL_PROBE in port flags. Fixes: 366f6c955d4d ("serial: 8250: Add proper clock handling for OxSemi PCIe devices") Cc: stable@vger.kernel.org # v5.19+ Reported-by: Anders Blomdell Signed-off-by: Maciej W. Rozycki Link: https://lore.kernel.org/r/alpine.DEB.2.21.2209210005040.41633@angie.orcam.me.uk Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_pci.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/tty/serial/8250/8250_pci.c +++ b/drivers/tty/serial/8250/8250_pci.c @@ -1232,6 +1232,10 @@ static void pci_oxsemi_tornado_set_mctrl serial8250_do_set_mctrl(port, mctrl); } +/* + * We require EFR features for clock programming, so set UPF_FULL_PROBE + * for full probing regardless of CONFIG_SERIAL_8250_16550A_VARIANTS setting. + */ static int pci_oxsemi_tornado_setup(struct serial_private *priv, const struct pciserial_board *board, struct uart_8250_port *up, int idx) @@ -1239,6 +1243,7 @@ static int pci_oxsemi_tornado_setup(stru struct pci_dev *dev = priv->dev; if (pci_oxsemi_tornado_p(dev)) { + up->port.flags |= UPF_FULL_PROBE; up->port.get_divisor = pci_oxsemi_tornado_get_divisor; up->port.set_divisor = pci_oxsemi_tornado_set_divisor; up->port.set_mctrl = pci_oxsemi_tornado_set_mctrl;