From patchwork Wed Oct 11 17:38:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 15232 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp706607vqb; Wed, 11 Oct 2023 10:39:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGK8y5hCV+eMwub0TK8OJ7MUriR6OnsdtPDjfCyC2xKHeCw2bc66kSKe1cKceZdGWZOzBnd X-Received: by 2002:a05:6a21:a587:b0:163:c167:964a with SMTP id gd7-20020a056a21a58700b00163c167964amr27327710pzc.1.1697045991413; Wed, 11 Oct 2023 10:39:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697045991; cv=pass; d=google.com; s=arc-20160816; b=MfM6HJHLsYzn+EnS+ntZHYSmNynIxtK8HvpBhz2gG/1vrl0G3WXIGkhJ+ST/mb0I08 I+6jtxli8C3s6ji57x3dAJBaoe5jDvv3fxBCzyucFBvLig474BZfihJbAP0GLaxIFIvy +zmltZP31DXmKPGWYCmWa3RxoHP6jlFEu9dYlltir+RdipxLEaslIp7n+T1ZtkJpcFk5 yfAuEme3g7mEUt3y5haQikqT2DgjPU8PbENYTUKaXoDSN9vYXqu87DTHWOmURPgfX0P+ TxvmqTSFR/tblLxT2VUsiQx4rsDcolDWLPWqpgiAU+ODM5gvraVxxxNr+7HPYqvtamL5 mPzQ== 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=q170O49BWb4vWVIGCynhtqlpm6sOEHUx3HPMx7DxdIo=; fh=aC1kYrcOZltFC3/MinKpgtHYGEwT3d4ZZtz9rrRPqLM=; b=xeaQwlpzW1v/XNLe/4/2dzH8bj0DJ+MuvUFy4JG0+A0StwBcBpzmawv1MUnFNotL5m b17+v1H6HekZ+yKHv5esXePsBxQrayLl5xsV4WzpejA2Sv2O2L57hMbQqXWDBr+zCHYN Pl9y24RIoKer+E+VhWj2j/WTaVjOURyxGOqOJ42UylqVzNjxswsGsgsseu+HtdTJoJCq H6VsJZQrAIxiegbxs/pm3Le7kHDob7PN2hZgyDI83yWZOEmiNfUTKrImL5YpRPWPDoYw VelyBevQb6L+WzfLRcSwbL7pZ66myQE1QPw6SYDXGYhPPDbpbKnXXMqgxtdebg8JbcKr Nflw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kunbus.com header.s=selector1 header.b=oDg+nq97; 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.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id l62-20020a638841000000b00585a5e9a963si247776pgd.24.2023.10.11.10.39.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 10:39:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kunbus.com header.s=selector1 header.b=oDg+nq97; 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.38 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 fry.vger.email (Postfix) with ESMTP id 8069482D7855; Wed, 11 Oct 2023 10:39:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232196AbjJKRjL (ORCPT + 18 others); Wed, 11 Oct 2023 13:39:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230234AbjJKRjJ (ORCPT ); Wed, 11 Oct 2023 13:39:09 -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 BBA028F; Wed, 11 Oct 2023 10:39:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bDevMVhDvbc6kRDXNzrXcRpTHkgmxe0U0G7UE8Ia2IVrJSEnAb4m8LGZUcTQ2fCFRVtjf+US+3J1Si2ovXzJKBVF4vHUm02+kcPjmhMfAq6TpmzQ5o92chlorUDeefCJ/n9F6RN4NUzRRF9di+0/EWZqdzroDuGxZSfPHtGs41sLRKP88nYYFQinvUkaT9vE1oo7YG47sXny2AqqR6ettUNWodZWx4yziYC5QWRBytus64KgmItm0dLwR8RtmR4pLuQLmIZuIWH6OH5eebQ/h0mIaBpkEv7BKtOCb2hbVrRvJVnMvsG9302R63gEadWvxLncXaOS00c0A4MJRaUXnQ== 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=q170O49BWb4vWVIGCynhtqlpm6sOEHUx3HPMx7DxdIo=; b=TVHIvyL7Gc2el+3aBock9CMshXY4fw/TwV80oEYFawNAlAWh3tLV5+BLMdecVWkQBE9DSFQl2HNHZlNWIlZ8cNOr0oMqz/3VQWzOpbXFb+v3B5xh95npzzPP9N2Bj7I6+AQgweohGVRYCbB5fQOK5Drzp0UIwLuNVxYHzzkLuVrdSHhuw5nbSveOln4Dk/eVF0HMMjNGRFljs1dUr3e/ds1IH/vbQobnMtAWh4Jx80mPqerrjsmrpxyVYdcXzouedXxqVvR1La5azlH9aAuQoRPHsVSuxw6ix1/Ofzpe8leI4COH5mIhTzLfd+tZo+PEI1/Dj7y6pEUitvIDy8TbQA== 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=q170O49BWb4vWVIGCynhtqlpm6sOEHUx3HPMx7DxdIo=; b=oDg+nq97Nkkck+PnQufrfUKg9axHwegqUeSa2ayw3lyzkT7282EjMeLhQeF+5Ktqi1qJcCy9hiu3miNy3m0k8lime7c6K59Q+uzfMFXknqlX4dh2DW3/Cahiglmxw62OtZMTnJzFElblvtrlJnLT+yuhb7vKaVohi1duKEgXfoQ= 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:04 +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:04 +0000 From: Lino Sanfilippo 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 Subject: [PATCH v2 0/7] Fixes and improvements for RS485 Date: Wed, 11 Oct 2023 19:38:22 +0200 Message-Id: <20231011173829.10508-1-l.sanfilippo@kunbus.com> X-Mailer: git-send-email 2.40.1 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: 064ba462-99fa-4ca0-2688-08dbca80f664 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: p6ZJ9vlgFiUtQej6AWxdefWRb4rlUL6nAWxjLIWlvYg92zFMXlE6ttfUmWPC7gPZpBwQzk2xV5qdlPS6zQL8Jbs4AxfKqgSRHpeKuDk2unR33X8LjYA2+rWGvgDnqn/gP+6qcPSW9WrNa/z83022VO6PnGnneFyWyGgv5N2tpPPAeKwoeWpNmlL1LgYLV3cVRYRTD5Xsy2Y4j7Lo6CsufXpWZCT+ZT2Md9KtaEDAaLqPJ7sSrnFCU4WlzazsZkQo6SpTTDhIAN/j4xViivS+tuSJAI6vrWmjCyl8Bb3IgU7/47lq6IUCrgLR4njzrjA2MVp44rG0M7nYcJOa0DnE/TRtxde3Vqe3IxDBZGUblt3lH+ngivzsTLXsGfyu+dmVG276FEG/ZHjL5ZI/uoe1pF9Sh0i43cVLnuEIhTYoAiGqfqWwDHdQX0poDeDQnEZTHp6qEtKIgJh9abihu1SCurAmgCPKxa8d4jFfCFD1GGP0FFsgvw9BUb7NOK8XbIRG6lTs5xdcniduKosRFy9VKFNNkbcT9ZNZCrmUH5JpaoNiNTO0P5lRga6M9JGdWaN1 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)(107886003)(52116002)(38100700002)(6506007)(6512007)(66476007)(66946007)(66556008)(4326008)(8676002)(8936002)(41300700001)(316002)(86362001)(7416002)(2906002)(36756003)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?pdmXgCN7Sa1Ax3ncpWBvmToOtHrx?= =?utf-8?q?A0IoN0qSI07LPR/dZwpw6dhDaBlgr+K/jkvF/COAA/Ns8NTmpOXpYPyoGcmF4GCpp?= =?utf-8?q?AaPVBkuQVxCFfm9K6wOBVjdn7ql0aTM4EegNlg5geKEAWvewh0zrEZA+ASePsXMKY?= =?utf-8?q?xA2UmWEtxeFFnPSqZZBxHRQYSEaVEpLb89qpCkjE/dY0lKvC1XqETraXF9lj5LONP?= =?utf-8?q?/BXQeYrHVE+IO9ETtZKap3CVdkJzSoeCsvdf5KSR4zW7c0Qjn6W04VdvZ6vXjqO2I?= =?utf-8?q?np3pVIFr2vGo/7rAOGt9J0eyqU6hLML2CJjrqCuqOOjG/gTH4zF0oLP/ODWRUxkCS?= =?utf-8?q?qts5HJz3G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trOPVy7OCtkz5bvoybCBaYKatmeHb+9LnFPF0RwVXvSMToHmTUP2+?= =?utf-8?q?GXZyUBOOyjksSJWnRvt0NiCPccvIAy+JtgCa86OadSN8u7sBCq3Ab0RsZVFB1P/RZ?= =?utf-8?q?ecHCRF3CG21HgYbwsVadE5Zpc7fwofy0vMEfdcqkqf+0mG387aVeMi/qRyuwkR0fh?= =?utf-8?q?8/W5PBldc3aLRHYtNnunmNgAHnjDUmY128M42TRZ4xWNKtsZmI+IMykvqQeyiKJFZ?= =?utf-8?q?3Y8p1TRGKQqwX6VhIZn0qNsBGGA8Mb0zahUQdYmdVkNo4S5wpEV4ifp4++D9EIv6b?= =?utf-8?q?tRBK6Ayt8XAmY/KPFTP4q/hus/XltblVhZC6ji64DjRN0VlsP4MnO2i0/LsmHgpf2?= =?utf-8?q?COKX7Xu27fC?= X-OriginatorOrg: kunbus.com X-MS-Exchange-CrossTenant-Network-Message-Id: 064ba462-99fa-4ca0-2688-08dbca80f664 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:04.3886 (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: kV8DmyrLEOxoyxJdHJik5aiunok/Cwe/CFAR8SmdYIBHguwbAVEIkiiN2L71UdTQsTZSWeylBxpZtuJ6a8rcBg== 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,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 (fry.vger.email [0.0.0.0]); Wed, 11 Oct 2023 10:39:42 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779481697501007810 X-GMAIL-MSGID: 1779481697501007810 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: Get rid of useless wrapper pl011_get_rs485_mode() Patch 3: set missing supported flag for RX during TX GPIO Patch 4: fix sanitizing check for RTS settings Patch 5: make sure RS485 is cannot be enabled when it is not supported Patch 6: imx: do not set RS485 enabled if it is not supported Patch 7: omap: do not override settings for rs485 support 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: amba-pl011: get rid of useless wrapper pl011_get_rs485_mode() 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 drivers/tty/serial/amba-pl011.c | 14 +--------- drivers/tty/serial/imx.c | 8 ------ drivers/tty/serial/omap-serial.c | 8 +++--- drivers/tty/serial/serial_core.c | 48 ++++++++++++++++++++++---------- drivers/tty/serial/stm32-usart.c | 5 +--- 5 files changed, 39 insertions(+), 44 deletions(-) base-commit: 94f6f0550c625fab1f373bb86a6669b45e9748b3