Message ID | 20231011181544.7893-6-l.sanfilippo@kunbus.com |
---|---|
State | Superseded |
Headers | show
Return-Path: <linux-serial-owner@vger.kernel.org> 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 DE4BDCDB475 for <linux-serial@archiver.kernel.org>; Wed, 11 Oct 2023 18:16:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235157AbjJKSQc (ORCPT <rfc822;linux-serial@archiver.kernel.org>); Wed, 11 Oct 2023 14:16:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235150AbjJKSQR (ORCPT <rfc822;linux-serial@vger.kernel.org>); Wed, 11 Oct 2023 14:16:17 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2048.outbound.protection.outlook.com [40.107.22.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54038D9; Wed, 11 Oct 2023 11:16:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BXdHBdnC6WhmN9PlfkTirPaEkYkML65kRjl2re4nlkNJ09jx80JT2vVIDD/0Mr8xybvrNUazc9hrsS+YF8Ur4HNNq0sOq5xE4Swlvh7HpkMPZR2fdGxrIMaWHSxHqSJdVC2sFxyhwUEJxBJu1Bp2bWcoV6AiV10+G/lUOwOTULe2JH/Gumy5IZQz19RmT6nNWWO7GE5b+Lqe4pu6F+ZgWOXpow5gkmbYnqKvSSmPSZOtyOncxxXXd5yX15gf9OgbywGHH2xKTNZr+9HD2cZp2QMrqQBOQhyPY3TLLbhQFIA0+0bJen+/3QtGXSpGWYHc8MU6+nFLKgtLn2JVfIeHOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=g9VNnrRh+93b9tiZ7+fqQ29BWG2jfMJ+okhxSduWaaw=; b=KdKdLg1RH1oN4WpVsw111jvDuzHpMVxO30wO8tcQBrUH+DPm2kGksKw7Qz8puEsoo7C0fUfPMnCD2nB/Uex9tzs9kmx+f2t3D/TxmJ9hrWsA10wHLiiN/xX2Gv4G8cUN//CmW15pciNEswH+WwKZYzegS7iYUioj9KL8kjD8n0WBZkQ+Fcti7IhSgMuKm+eWcaZxMS39cmEsz0/JsRHKZKNbe+64MJolkxfu19IZbY+vjjiXmS8hiKU8PYEJNgJ7O39ZF4tY6q8oTDSu5eOnCPI56LkDBXv3fho6GNd5hrirKOm/g+yy8GaF3/OV2CJDUanGdWAlqR29rIozfFe2Sw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=kunbus.com; dmarc=pass action=none header.from=kunbus.com; dkim=pass header.d=kunbus.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kunbus.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g9VNnrRh+93b9tiZ7+fqQ29BWG2jfMJ+okhxSduWaaw=; b=rB+J3iFT50VeuhTkAs28X/9WcLga4mwUGKh6aQ4/J8vaw12cNBJjUdliK6j3iKJ8+MSZXVFz0sl+jzsJODsdNxyvbOGrj4T6ZL8FwAJw4WsNtZ3lipM2XSuTZS6JArLKo6LI/ufMedS72LEGAcN3D0M9NLdEu0+bJGxa1egVXwk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=kunbus.com; Received: from VI1P193MB0413.EURP193.PROD.OUTLOOK.COM (2603:10a6:803:4e::14) by AS8P193MB1925.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:3fa::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.38; Wed, 11 Oct 2023 18:16:13 +0000 Received: from VI1P193MB0413.EURP193.PROD.OUTLOOK.COM ([fe80::550d:2425:c0ed:3e59]) by VI1P193MB0413.EURP193.PROD.OUTLOOK.COM ([fe80::550d:2425:c0ed:3e59%3]) with mapi id 15.20.6863.032; Wed, 11 Oct 2023 18:16:13 +0000 From: Lino Sanfilippo <l.sanfilippo@kunbus.com> To: gregkh@linuxfoundation.org, jirislaby@kernel.org, ilpo.jarvinen@linux.intel.com Cc: shawnguo@kernel.org, s.hauer@pengutronix.de, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, cniedermaier@dh-electronics.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, LinoSanfilippo@gmx.de, lukas@wunner.de, p.rosenberger@kunbus.com, Lino Sanfilippo <l.sanfilippo@kunbus.com>, stable@vger.kernel.org, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de> Subject: [PATCH v3 5/6] serial: core, imx: do not set RS485 enabled if it is not supported Date: Wed, 11 Oct 2023 20:15:43 +0200 Message-Id: <20231011181544.7893-6-l.sanfilippo@kunbus.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231011181544.7893-1-l.sanfilippo@kunbus.com> References: <20231011181544.7893-1-l.sanfilippo@kunbus.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-ClientProxiedBy: FR3P281CA0163.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a2::9) To VI1P193MB0413.EURP193.PROD.OUTLOOK.COM (2603:10a6:803:4e::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1P193MB0413:EE_|AS8P193MB1925:EE_ X-MS-Office365-Filtering-Correlation-Id: 431bd925-95d4-4136-c32b-08dbca8626cf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xxAimYXLwWIUiYQznvLn5SMTRgidD2blBXwI6wau5ivXhaMed3u79M3uB2dcLynqk7ET9SECfQGGOKwQoupurBgYM5ylILXyoTxeyWwn+gLGE7NiK1G0x9dzyOdtSXGL0JsMn5iqoVTFHXoM3gq7BJlV7dfJmJn8pdKw/uhQaEqaE5XnbdClAh7stEN6AREMZu9j2MozqIjqof01n8/oc/oLAkd6zISZz5XMSrqeG2xucFsjjVKdzKT/t96GgqnT2/dF5rky0IOQ3og/NKIklE4nz19JPMeeZFMHqwmrhAHd3nUzk4r9mbVgJRdS5MJh01lEN+yTcln6JXwOVr+yDiIcuYFOR8/q8QKYwythPx7rJWQTpnhlo6+lVp6rutIaxPiEc6dY6yPEOhtAykGaUGkDGoMaF0SfsP7L4r+imiYxzQEj87FKR6QYskgvDHQkg77HH04CDfKagLtvsXbbySZqUZkjeLxfEVD1nLrM1OpG5vbM2UAqDymHDxN+lHyk1QLpVzylT8YhcLQTZTt8kniN2M3xCMkXrntroYjlMhOO0Mku7ILdGusBeKZAAxBQ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1P193MB0413.EURP193.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230031)(366004)(39840400004)(396003)(346002)(376002)(136003)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(36756003)(6666004)(52116002)(83380400001)(6506007)(6486002)(6512007)(1076003)(2616005)(4326008)(41300700001)(2906002)(478600001)(8676002)(8936002)(5660300002)(7416002)(66556008)(54906003)(316002)(66946007)(66476007)(86362001)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?ELpE2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XB2f6M6oN+?= =?utf-8?q?cn5ZrWrNfdL9CJx5QwEoIXJwTCkBImMvokjVVq19NCjiOcRSgl0BU5ypWtT1aEBa7?= =?utf-8?q?mfMV2H1rN/QxEkU/eb4++IgRrE+HvL2SUvnlcil5mjRqSXP1b0JJfoYEkrX/X2BHW?= =?utf-8?q?fHKvmNSkPs3XCReAruROId9ZHPr2vWjSWv6iiFw5q1Na+IJ2DkT74g2FtQOQ5ESQ1?= =?utf-8?q?xWqvFrufxUC66QetVWeMipse9QbwlciNnFRAbeNxaqa4t7rZzbDDEMFbaGu7sOYii?= =?utf-8?q?crP2k6CPXQpm931wCpwiezs1ZjVG36lkwNzt2GBX1F+RSV73H4dODT6js4upVmga2?= =?utf-8?q?jqhIu/n9YFY/3z6BasZ4Ywf4w3ZISYDjkuxBT0FC6WYvajhoCx5DHkQUxKgPXjQlG?= =?utf-8?q?1ou4Ygbzj/gOCDNq4FiaXihI5a4zv/txrYqbpaAddVzHPA2RUR/bkgXO8Bx35bVJz?= =?utf-8?q?KxIRhyjvsA1W9YzieiF7UitiROAe/fXByEVDm4a2F9RO2dAVPypIDo1IHrbq4wQ4o?= =?utf-8?q?aqeMKB2SwysonSFPaf24aVz/H0Cj0jXVeEe80nKt+zUVnxNs40QbY2ophNDoX5hAx?= =?utf-8?q?3jTzZyHl8qn9ZcsiVS5dWa3uv8gAlB9O5Sa/11HMRliCecqkyChNYQgIf4KvKVXQZ?= =?utf-8?q?+4IFH3L8vU5OEdrer42mwjBtyQ3x2el0qHjIk8Sx5gqsmPF3HKP5MBzmocJCmYQ1E?= =?utf-8?q?np6B/yRqez1?= X-OriginatorOrg: kunbus.com X-MS-Exchange-CrossTenant-Network-Message-Id: 431bd925-95d4-4136-c32b-08dbca8626cf X-MS-Exchange-CrossTenant-AuthSource: VI1P193MB0413.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2023 18:16:12.9772 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: aaa4d814-e659-4b0a-9698-1c671f11520b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: q/tuzAMqmoaEiBKp4xbuH72d8BrsCnKnZiQgtEvcb20ar4O8W+J7Cwp3Cwh5MAOKghaTe5URiTw9Zj99P5Q/nw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8P193MB1925 Precedence: bulk List-ID: <linux-serial.vger.kernel.org> X-Mailing-List: linux-serial@vger.kernel.org |
Series |
Fixes and improvements for RS485
|
expand
|
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index edb2ec6a5567..c8c19bf8585d 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -2332,10 +2332,6 @@ static int imx_uart_probe(struct platform_device *pdev) return ret; } - if (sport->port.rs485.flags & SER_RS485_ENABLED && - (!sport->have_rtscts && !sport->have_rtsgpio)) - dev_err(&pdev->dev, "no RTS control, disabling rs485\n"); - /* * If using the i.MX UART RTS/CTS control then the RTS (CTS_B) * signal cannot be set low during transmission in case the diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index dca09877fabc..95cec2343b35 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -3576,6 +3576,9 @@ int uart_get_rs485_mode(struct uart_port *port) int ret; int rx_during_tx_gpio_flag; + if (!(port->rs485_supported.flags & SER_RS485_ENABLED)) + return 0; + ret = device_property_read_u32_array(dev, "rs485-rts-delay", rs485_delay, 2); if (!ret) {
If the imx driver cannot support RS485 it sets the ports rs485_supported structure to NULL. But it still calls uart_get_rs485_mode() which may set the RS485_ENABLED flag nevertheless. This may lead to an attempt to configure RS485 even if it is not supported when the flag is evaluated in uart_configure_port() at port startup. Avoid this by bailing out of uart_get_rs485_mode() if the RS485_ENABLED flag is not supported by the caller. With this fix a check for RTS availability is now obsolete in the imx driver, since it can not evaluate to true any more. Remove this check, too. Fixes: 00d7a00e2a6f ("serial: imx: Fill in rs485_supported") Cc: stable@vger.kernel.org Suggested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com> --- drivers/tty/serial/imx.c | 4 ---- drivers/tty/serial/serial_core.c | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-)