From patchwork Sat Dec 9 12:58:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 17789 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp6032853vqy; Sat, 9 Dec 2023 04:59:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IHHiMwPAB3KdR0y0PeyQFBt+vvKIhIMMqIbU6RmmJ6dvRQcS+XxjtXG0+go6+w2M95hIjVa X-Received: by 2002:a05:6830:1382:b0:6d9:f53d:47d9 with SMTP id d2-20020a056830138200b006d9f53d47d9mr1504554otq.59.1702126767728; Sat, 09 Dec 2023 04:59:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702126767; cv=pass; d=google.com; s=arc-20160816; b=xsO+s8VhE6FzwhXNgJRfA4s1+mlkOUrYRT9Ve/pGrhORP5wKgegb6QPxLnkt9n98cu cEFQT01+DaUqjbogfbQvTao/meCUGm7toqp5fqdEDSdNEly+fOUSg/ubVH+4P1HU1XXe b/Se/sQz4XQJiomMnVkapuyuxpW1HE8CpZD7nVlR17Jn4T1mB0j4vnR6zuz+9w/SnGMQ atyXB3Ul6OuIwQ5U4NAJ2wF7WKIxKKN8tOR53+T6LdvebTLftTyQ+wiUb9vkzj5aMAMT zJDFT5qzRy29KXRetb0HrJpcq5vwUKSamO0vMyKgadCMXd8wYPjPpAm9ao27tBUInyig Jr9A== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=/19jT5xjHvyfQoWOMyzF+oUc7qc5rYYEI2f2qQd3w3Y=; fh=+yR/6vdguIHQPouVWTJm5j1m7asWVUd1FqjwAGbc6tU=; b=UsFOTvbfvT+nrP/WuA2ZNhuAPcCvmlJlYLzeDGAXNcle/jQ86fdEspmdP+rf5cVVf3 IkDHylWQh6nmBHG2MRVMNgoomabhqsl5xuyfESUABttqy2nV9gKAv207/NBl/VLtmuNA sWYUPPYrZd4cp44G8U/Ap6r6rajOpQ2NGT5/QEFbwE2RTLaqrB5Qgq8bD81R5gCztluO r9ZUJQdFSC4RuSiSwlRDN4vnM37LjrZoBnSpEUWCtMmhbft7FAe+/9LOB6lERvpyVONU ZW3EgNu1RPTM9hc8iV4RR+ycdjsGy3vOp8Ujrw2kChD9FZfbljhD6+N6ECCd0SqPoemR i0FQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kunbus.com header.s=selector1 header.b=L1aHeqHs; 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 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id g3-20020a056a0023c300b006cedd840d8csi2611530pfc.62.2023.12.09.04.59.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Dec 2023 04:59:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kunbus.com header.s=selector1 header.b=L1aHeqHs; 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 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id AE89F806290E; Sat, 9 Dec 2023 04:59:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230012AbjLIM7Q (ORCPT + 99 others); Sat, 9 Dec 2023 07:59:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbjLIM7P (ORCPT ); Sat, 9 Dec 2023 07:59:15 -0500 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2043.outbound.protection.outlook.com [40.107.7.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61AD610D0; Sat, 9 Dec 2023 04:59:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P2ATX3KvYqafdrFZ8hAPo7RhIXR01Ael7YSTgBz/iAnYTrkPC+LSAJ24efq0I4dDlGdD42uXxlmPBkYOvSm2Kg71SIv0EpVbkcD2/HbuvcuaIyUgd9UdmPhrsHltMMkK4UVn13NVwcGKoxd/U6Vh7P2Me78Ci/sq3IR00oNeXw1KzXw0NyOh+sD00n31wgHRzkg41OlX9SU89Hxcjk51fR+m1xgNt9awJsZ3pvYX7LKb2kmWNB+m+UkBJtSq76fhbXCVIpK3iVqOAYqQOzyvA1urKhmElKTHjmUpjh1EG8u/PJ/j+FL26gHi0eeIYji0Xy97ePizdvsWV/MnrNYvdg== 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=/19jT5xjHvyfQoWOMyzF+oUc7qc5rYYEI2f2qQd3w3Y=; b=naxSZGDjjo1WubhnAXyEwNJ2lFSmvyNaSQbw2y3cLakaeNra+x0NI2wSTKdDjnuT9AHnZlEWBICGTDIhghr3uyIbd9wQhOJCAi6k7xHK2xe0ZDEc/71pSeKZwSKZgB0X9bE7E9YppKaus4PuTLQJDYMvS0tCcSJJwkGWChMSGrHPbaJx5S/gGuOTfqzXgEjeF0Uv7E90NKP//yhWA2EIGt5X1AcVehkQ695FLvPHPpNpbleFVuI80itxfizm9TvE5z0CMMEP/rMVizByguqVA9+5rVkq/hzvQVBcJ2/IExGQyquPJScrRQZZkFdJISTSLjA758No51gj7AbAjckrTA== 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=/19jT5xjHvyfQoWOMyzF+oUc7qc5rYYEI2f2qQd3w3Y=; b=L1aHeqHszH8rcv6xq9c8cbCcXwwL2e8Tuv5varUilNWDK7uZ0cPd2lzxgVElIaPZEjlr1rizXG14zRriAHgt3OsATR5DNJq1jfIwF5hmldhdE6eUnTiCb2sAgyFh97U2akJi8TWPPyKJxnFoqDK3f4XjPLtinEd6Iu7Uf3mhDSY= 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 PR3P193MB0555.EURP193.PROD.OUTLOOK.COM (2603:10a6:102:31::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.29; Sat, 9 Dec 2023 12:59:16 +0000 Received: from VI1P193MB0413.EURP193.PROD.OUTLOOK.COM ([fe80::653f:d0f3:e7f6:8c06]) by VI1P193MB0413.EURP193.PROD.OUTLOOK.COM ([fe80::653f:d0f3:e7f6:8c06%5]) with mapi id 15.20.7068.029; Sat, 9 Dec 2023 12:59:16 +0000 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org, ilpo.jarvinen@linux.intel.com Cc: u.kleine-koenig@pengutronix.de, shawnguo@kernel.org, s.hauer@pengutronix.de, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, cniedermaier@dh-electronics.com, hugo@hugovil.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, LinoSanfilippo@gmx.de, lukas@wunner.de, p.rosenberger@kunbus.com, Lino Sanfilippo Subject: [PATCH v5 0/7] Fixes and improvements for RS485 Date: Sat, 9 Dec 2023 13:58:29 +0100 Message-ID: <20231209125836.16294-1-l.sanfilippo@kunbus.com> X-Mailer: git-send-email 2.42.0 X-ClientProxiedBy: FR3P281CA0070.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:4b::22) To VI1P193MB0413.EURP193.PROD.OUTLOOK.COM (2603:10a6:803:4e::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1P193MB0413:EE_|PR3P193MB0555:EE_ X-MS-Office365-Filtering-Correlation-Id: 105869ad-628a-40c6-787e-08dbf8b6a622 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iFxsNEPVgTmWCAjfnLESy2HdSTkltn/SX3Cf5WwjXag5kqwtNdRf3iKboeyHeQSDLi0aV7L1A7S09I9NgZOAJoSzOKRvZZyxPfz26ZNg8mTVXW8NTheqHDeispmfl+vnk6C+XMnlXL4aB8ZLJc5iwziZdEPO58t0kdrc4fK/oMuQFIqIHtEV65MmMaVUMDpLo86ZdKtBdEwciZR9P2WyQYMFmn+MbmrUN863IJTUhf1M78zAuTxtiY0CgmYUDlhbvY5U2+0qIBkUlnk0bdbJhTi0pficSDNXAR2vvexQeONKYgBfJSJk529yd0e0URCX+u45g3g/+CLs5YId6sf3neBcuFnofcCj10jmdIGBIsIJY86dlzlhrRLiH3kuT5LOu3/JlBeL1CL9kk0o/xPDJveSczrLrP1+1QIZHfpuKBXzXtxjXN3/oFn/1DsKfN+XocA+4TcRnFMB5NTHa8heVwx35G5yp31CdMCv0vaTj4vK4s0esBE9BCssvvwbUslSyHIudO35hEPjzWqIIcDbz2msA6vEfL+mpEQq7R5hx17fcyzfWyA+JiyHoiSXyeWa 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)(39830400003)(366004)(376002)(396003)(346002)(136003)(230922051799003)(186009)(1800799012)(64100799003)(451199024)(2616005)(107886003)(1076003)(478600001)(6506007)(6666004)(52116002)(6512007)(41300700001)(83380400001)(5660300002)(2906002)(4326008)(8676002)(8936002)(7416002)(6486002)(66946007)(316002)(66476007)(66556008)(38100700002)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?vU5aTOf3qMWfktodbxbOaQY8hJPc?= =?utf-8?q?7E0ukDYWtehhyZ2pNJb3o2J216ELU2INdQfZDKLqL2yKdN3slxcRX1kS8AN7bFW0Y?= =?utf-8?q?PvqAG695zmCAeE9ndkpXleDNSFRzg67OexvX5iju6cJhGtL2RIroW8tzeZbk54NWK?= =?utf-8?q?1I/uyNnF7HKSo3653UD0kcRhaVO1ArLPj/I87YjyAK/qs+Wh7Ai/cNqlhzujRIVos?= =?utf-8?q?bbwsKu6lI6eRHIUU8NRpSbaNdDvz5wN4yrT4Ep2a55Hn5c58bCQ7mPb07L6ydrwcf?= =?utf-8?q?UpbfuI7as+enYR6A0/euOi4JlEgFyvOit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10SS0ukqZ5YmiARHmpum55HTV?= =?utf-8?q?zSp5yxZHFv1WrOJbpxV3mS0gTmr4PlvOQwpOzuipEAOKv2RElCWnEgBnrWaoZwAQn?= =?utf-8?q?YLr+rGEDWUdsg9eX1GOjsRtZ/eWd7wjxr23aFPPNxwQvrDDHrtH/SWP1/xJbappN/?= =?utf-8?q?tcObsUsIRclnFS8P99w4+BUC919LVWzTrF403shxDJuudzXHn+b+lwfYVCOQjiy2E?= =?utf-8?q?tEMvkSux9BxMFMC+K0gZ3aZEi+4xUK1KJ2h/9XkiTyJm+7Booyw7wTv8gdSvXfTAO?= =?utf-8?q?BweqtYJEcpYk2MaieU70u6fiSS53QGWqSM81UDxRyT/gR6ZioDB4Ik3yVF1/p4JzQ?= =?utf-8?q?ZIN5A1teOh2gC+g3AKqRS9buKFDSo8fIj/7RlK3xX/m9iCqiem9+zeeb3ZYfiefHz?= =?utf-8?q?6zC9vi4X9cl?= X-OriginatorOrg: kunbus.com X-MS-Exchange-CrossTenant-Network-Message-Id: 105869ad-628a-40c6-787e-08dbf8b6a622 X-MS-Exchange-CrossTenant-AuthSource: VI1P193MB0413.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2023 12:59:16.0334 (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: ZtXSs9145kxchKQ4hZzor4p0ZmwgZq64zrI0ppw7Lx9hRZrj4Db7SOlDSb/Ea5y7pxABNafV/+134+MHBo4H5Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3P193MB0555 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 09 Dec 2023 04:59:26 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784809277724099260 X-GMAIL-MSGID: 1784809277724099260 The following series includes some fixes and improvements around RS485 in the serial core and UART drivers: Patch 1: Do not hold the port lock when setting rx-during-tx GPIO Patch 2: set missing supported flag for RX during TX GPIO Patch 3: fix sanitizing check for RTS settings Patch 4: make sure RS485 is cannot be enabled when it is not supported Patch 5: imx: do not set RS485 enabled if it is not supported Patch 6: omap: do not override settings for rs485 support Patch 7: exar: set missing RS485 supported flag Changes in v5: - do not combine the functions that the RS484 GPIOs (as Hugo originally suggested) Changes in v4: - add comment for function uart_set_rs485_gpios after hint from Hugo - correct commit message as pointed out by Hugo - rephrase commit messages - add patch 7 after discussion with Ilpo Changes in v3 - Drop patch "Get rid of useless wrapper pl011_get_rs485_mode()" as requested by Greg Changes in v2: - add missing 'Fixes' tags as requested by Greg - corrected a typo as pointed out by Hugo - fix issue in imx driver in the serial core as suggested by Uwe - partly rephrase some commit messages - add patch 7 Lino Sanfilippo (7): serial: Do not hold the port lock when setting rx-during-tx GPIO serial: core: set missing supported flag for RX during TX GPIO serial: core: fix sanitizing check for RTS settings serial: core: make sure RS485 cannot be enabled when it is not supported serial: core, imx: do not set RS485 enabled if it is not supported serial: omap: do not override settings for RS485 support serial: 8250_exar: Set missing rs485_supported flag drivers/tty/serial/8250/8250_exar.c | 5 +-- drivers/tty/serial/imx.c | 8 ----- drivers/tty/serial/omap-serial.c | 8 ++--- drivers/tty/serial/serial_core.c | 50 ++++++++++++++++++++++------- drivers/tty/serial/stm32-usart.c | 5 +-- 5 files changed, 47 insertions(+), 29 deletions(-) base-commit: 33cc938e65a98f1d29d0a18403dbbee050dcad9a