Message ID | 20231011173829.10508-7-l.sanfilippo@kunbus.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp706657vqb; Wed, 11 Oct 2023 10:39:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHMIGZexhTYip4DYEateUg4rGC1bTGnp8l77iBemdc6nykYb7JsejHUg+XPuGzvUYt+8yaC X-Received: by 2002:a17:90a:4d88:b0:263:730b:f568 with SMTP id m8-20020a17090a4d8800b00263730bf568mr19726945pjh.3.1697045995174; Wed, 11 Oct 2023 10:39:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697045995; cv=pass; d=google.com; s=arc-20160816; b=rJRyDOr2COOrC3/aSRQrfSnfQJZ4Qtlr7uWtsOJMSFYtOz1B+UTfqymgjpM61OlZWF cO2owKrOQ9gIx8Dp7sBua6zbXk8GY0uVssb1nXofC9SNWJEmA07u05Y5OqQoZEfRp46z Pz/VMwU3kigIrh5V0c52HeFKL/T8nJ2vs73ueeRpWjXOBkDLaWqDPD4oLChr8w0Ly4va RoFcdFivqlT7WlWLb0lE3ec8dz34S/v4ZmHyPV4vo+D91f2yT2Y/SUke1FgHshVFD7/i XV+TcfvLzm6LNchphs394p1VbXwK4doW1aSM0ryotbL0Qw4iS+qA9UI1skyxKKkZ27rt F46Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=g9VNnrRh+93b9tiZ7+fqQ29BWG2jfMJ+okhxSduWaaw=; fh=Ocz+Y2u7bhoP659IxE7LNF1gvwEDr2znXfLmnknrN6Q=; b=uSSlpzg3VlI2L7fjAtYP/6DGdd+P4UgEyRxIr68FkXFfpf5ZoDthlZjIbeOeQZCDsK srZSY5F+9yWnPjLE5kkAOFAAuE+e9Inl7mlzllxqg6vRnYaqsvK4HO7scQhrwHar1bgg j6cF1McAxxCozekUYbNUrDsIhQP/nlu+U0OobiX5nvxBvhU6VpikCHdzS3AUs1dcuT2V FpEOEzk9CZHudceDUoch6dbh8auix6iop/lO6RQTmPRzFBjj1PrNR8TkNk4FEOZZMOts sPxaZjvKs+K29ATutnmyUlAk6XIM62s92fd00gUsyDpjobyF1QWXk3uo9pGhScrzDgE4 srpA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kunbus.com header.s=selector1 header.b="aAO/cdrv"; arc=pass (i=1 spf=pass spfdomain=kunbus.com dkim=pass dkdomain=kunbus.com dmarc=pass fromdomain=kunbus.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kunbus.com Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id om10-20020a17090b3a8a00b0027762d380f7si361435pjb.8.2023.10.11.10.39.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 10:39:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kunbus.com header.s=selector1 header.b="aAO/cdrv"; arc=pass (i=1 spf=pass spfdomain=kunbus.com dkim=pass dkdomain=kunbus.com dmarc=pass fromdomain=kunbus.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kunbus.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 3D09C8112472; Wed, 11 Oct 2023 10:39:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234913AbjJKRjh (ORCPT <rfc822;kartikey406@gmail.com> + 18 others); Wed, 11 Oct 2023 13:39:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233183AbjJKRj0 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 11 Oct 2023 13:39:26 -0400 Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2088.outbound.protection.outlook.com [40.107.249.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82388CC; Wed, 11 Oct 2023 10:39:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XAh2drSLMhIDGnpgmbeR5QxKNfoLgrTmzxZj3wqU08yayWnBU4t3w03PaPJG/8GPpIhBSSSjtzrVAZIhlsGd1y1qzYbyJU/XEvj90rbrQyZSGhqq5e/X5PaYYIq96gyZYd2zCeC3Obxh1wk4O7fxfGv/UAs5XKrZ1Qu3SKZHRXj0B25LpNvRhgCPJa2b/bPqrA8gh0yRU2UfCOJts7ifoVqT24T3ROAqIFGT2oU4txiwI3HcuenRiaFr+RheOEWhtwlMl1IbLhCJiUkrY4sGj/nXB4sqWawIF5Swf9t49O9SnNESAt+n6j/Pbk1qS3NA7Vkg3ytrWuTFxBmjQ6rwTA== 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=bBeAblgk4q/AM/hZYIdL5SHKWSx35276mQ/idQ9keKNchocVM+RCfsW4IH8pAeb1U9nxV9CTA3Xy+jG9kH19mGjSjpoVNO1bq8oORQM/VxgZCceBR8+2t0Jz51jlXMvZkNqmvWxcGXyDIK3Ls0dp1KSGd196U+F+soorjGPJeDOvyMT8e3W9ESyw/lHF17hAZHw0ZSVWVBrxhzx7vHyYUeujv6cvmzNNKBMCyiXtO06vbmC103NAfpm38e/bmr2GXsu2EE2rgTL3GQ4WCssnDqTEKThE0T9s4gWXeA+dofGXBUjBNoUI94FfI8vtpJ5hFJdBDjSTXwrhAT/4toGgpg== 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=aAO/cdrvJeQ7KrAch7thEVyxuqGaSN5jU0IxrAIquJXnO8kRwSMYGd7C6IAOGlWthsjeQjg4CaLu066BgAS94rUJV6pf3jb+0BBp9vmkc0lAeWoP5zeu0RG8nlJ0Hbvj4GWsdubrWf1HrcEW41rfoYNxzKwY2nfCpixV+2vM9KM= 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 AM8P193MB1187.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:362::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.41; Wed, 11 Oct 2023 17:39:08 +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 17:39:08 +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 v2 6/7] serial: core, imx: do not set RS485 enabled if it is not supported Date: Wed, 11 Oct 2023 19:38:28 +0200 Message-Id: <20231011173829.10508-7-l.sanfilippo@kunbus.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231011173829.10508-1-l.sanfilippo@kunbus.com> References: <20231011173829.10508-1-l.sanfilippo@kunbus.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-ClientProxiedBy: FR2P281CA0093.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:9b::18) To VI1P193MB0413.EURP193.PROD.OUTLOOK.COM (2603:10a6:803:4e::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1P193MB0413:EE_|AM8P193MB1187:EE_ X-MS-Office365-Filtering-Correlation-Id: 7563fd0f-131b-4ca1-b310-08dbca80f8a2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 58WR2e9qytcd68wapZlInQB0RgQtzyhh+s/A+CUeJqJIyQS5PDGb8QgP/UiSxn1AEwkKSBVfKkCRiuOPoMuGKL/ImF+7QakoAuPjZQ6Tqxh2h3DB3CsmMIzfPJ3kzFv8YIHmt6gBwyOZOy0HZSGXCzKDtJpYMvMhVdeV9br2L1j2ZO5XI44Sg15Dy3i/tTkvtt6MhGirONesdrUfTQMF6dh5HIPMD/uRuRjZS7rwCwWYaYmr4L9TKrLJ505rcp7tS/66/h6CiEKc9o1hNumk13Y6MJQ0RUR51cjqxwIJSHXWYJGOOy2oR7iJPg7zHWrSKWNxSSH5bTdYSk5a4yugE2Cy8R+5Aoigufm258uoiFFZx+vG7of2XhQiLj4vvgLoVyossx52PvcLWjbxhzOAaL6s8qNEo0c9fRyQ4cZz5fciwv1IEmQDSUqMB5+FjiNoMjTKCtZmbiSkaJDoOj9HnVdPqXzHDgu6f1tnvGU6CXTLIctzDZOBhUojrKTBWiubJjfXYZSg4kciB1fb3rVz/ELrYeymehic3t+gi8k9JOnMizht/BHHp9uCgPNYLTHQ 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)(136003)(39840400004)(376002)(366004)(346002)(396003)(230922051799003)(186009)(64100799003)(451199024)(1800799009)(6666004)(2616005)(83380400001)(6486002)(478600001)(1076003)(52116002)(38100700002)(6506007)(6512007)(66476007)(66946007)(66556008)(4326008)(8676002)(8936002)(41300700001)(316002)(86362001)(7416002)(2906002)(54906003)(36756003)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?3XLJh4itFinlueTudjCJxV2NwAwu?= =?utf-8?q?W+9unnrk7N0+M92K5pkhOGTltrOGD8KLdCcP5M8d+6sQ4td2fcixlHfIJ0eYZqBTF?= =?utf-8?q?JZPveht/efI6SEx3JlfB952MUOYRWgK6Pz6QvTX2CRa2y55tL9lkebVf6BrHqur+/?= =?utf-8?q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kOj0YtW8QVZ6bQNYocqxYUpJSwYKLVdb2J0Lh9qp2bQp2N5S0IabffEKc1Lv?= =?utf-8?q?UkGqq8Vp6Ht19KDVtDHp4ApDORFMlih7nP9b9/tVGTb10qOdhFx91g1UaM14rZCGY?= =?utf-8?q?uowBjVQofI08LRnvB/yMuTbMh/wgF4zymsv+28/qx/ND56zxjheEEdHquJykKtRY6?= =?utf-8?q?PRua3yVoL7hNn5u5G9WHTPIlYvf97Ajk5JVrLmmHdYPc8smqJ+GmkYLJI41DVnece?= =?utf-8?q?lkWsjBVznPMbccq9QGteMxySznZalckyO/UkF+++jEMJTPXrKwM4YcyYeO0iJx9Gs?= =?utf-8?q?5uU+IvxgF4Jv6x/sk/Ag9TAoUGlOql2JpgBx/tNDkiKQ0PvpPZQUL/DC+iiXBOgGq?= =?utf-8?q?28URD/YrftBX1qNr2VRfdqu/fCXdvMKY6lcGTsjgcw+x4pLpVyCzlenbKRmiAHE/+?= =?utf-8?q?XpLlp4G7o8V/ZxGF4HHuOPveW19SfNewINDPxno/aRQdknscwy8nUezuwed1C8UiU?= =?utf-8?q?JOr4/ZBdj9UJJJPONEyNBKK6tY3cOgQDcaBeGvRCazl5t2cme45FSmvfuLvBaj9Ol?= =?utf-8?q?xOvaoQ1p8Gf?= X-OriginatorOrg: kunbus.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7563fd0f-131b-4ca1-b310-08dbca80f8a2 X-MS-Exchange-CrossTenant-AuthSource: VI1P193MB0413.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2023 17:39:08.0536 (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: 3G/BcBG+MR0SKgB0v9OH9fWXUk4Z96ezoa242iKnjMLz/idaDYLIuT7767KHxp4W8c/vim2rxhhbVa9f0eLhMA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8P193MB1187 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 11 Oct 2023 10:39:52 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779481701532368313 X-GMAIL-MSGID: 1779481701532368313 |
Series |
Fixes and improvements for RS485
|
|
Commit Message
Lino Sanfilippo
Oct. 11, 2023, 5:38 p.m. UTC
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(-)
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) {