From nobody Thu Apr 2 21:53:37 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A11A9C6FA8E for ; Tue, 20 Sep 2022 23:41:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231608AbiITXlX (ORCPT ); Tue, 20 Sep 2022 19:41:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231578AbiITXlF (ORCPT ); Tue, 20 Sep 2022 19:41:05 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [78.133.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C20007C76D; Tue, 20 Sep 2022 16:38:19 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id BBF0292009E; Wed, 21 Sep 2022 01:35:37 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id B644892009B; Wed, 21 Sep 2022 00:35:37 +0100 (BST) Date: Wed, 21 Sep 2022 00:35:37 +0100 (BST) From: "Maciej W. Rozycki" To: Greg Kroah-Hartman , Jiri Slaby cc: Josh Triplett , Anders Blomdell , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH v2 2/3] serial: 8250: Request full 16550A feature probing for OxSemi PCIe devices In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Oxford Semiconductor PCIe (Tornado) 950 serial port devices need to=20 operate in the enhanced mode via the EFR register for the Divide-by-M=20 N/8 baud rate generator prescaler to be used in their native UART mode. =20 Otherwise the prescaler is fixed at 1 causing grossly incorrect baud=20 rates to be programmed. Accessing the EFR register requires 16550A features to have been probed=20 for, so request this to happen regardless of SERIAL_8250_16550A_VARIANTS=20 by setting UPF_FULL_PROBE in port flags. Signed-off-by: Maciej W. Rozycki Reported-by: Anders Blomdell Fixes: 366f6c955d4d ("serial: 8250: Add proper clock handling for OxSemi PC= Ie devices") Cc: stable@vger.kernel.org # v5.19+ --- No change from v1. --- drivers/tty/serial/8250/8250_pci.c | 5 +++++ 1 file changed, 5 insertions(+) linux-serial-8250-oxsemi-efr.diff Index: linux-macro/drivers/tty/serial/8250/8250_pci.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- linux-macro.orig/drivers/tty/serial/8250/8250_pci.c +++ linux-macro/drivers/tty/serial/8250/8250_pci.c @@ -1232,6 +1232,10 @@ static void pci_oxsemi_tornado_set_mctrl serial8250_do_set_mctrl(port, mctrl); } =20 +/* + * We require EFR features for clock programming, so set UPF_FULL_PROBE + * for full probing regardless of CONFIG_SERIAL_8250_16550A_VARIANTS setti= ng. + */ 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 =3D priv->dev; =20 if (pci_oxsemi_tornado_p(dev)) { + up->port.flags |=3D UPF_FULL_PROBE; up->port.get_divisor =3D pci_oxsemi_tornado_get_divisor; up->port.set_divisor =3D pci_oxsemi_tornado_set_divisor; up->port.set_mctrl =3D pci_oxsemi_tornado_set_mctrl;