From patchwork Wed Oct 18 17:48:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 735438 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 85993CDB47E for ; Wed, 18 Oct 2023 17:49:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229695AbjJRRtn (ORCPT ); Wed, 18 Oct 2023 13:49:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjJRRtm (ORCPT ); Wed, 18 Oct 2023 13:49:42 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2047.outbound.protection.outlook.com [40.107.22.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C44BB8; Wed, 18 Oct 2023 10:49:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d6zwpFw8USFyVf2Icbgo4rhx5AjnQ1yXxaZ98s/A7vuwSKi8inNiIKa8MXg8Mf6FXeOobM87KkPx/HZW3qAN3zOsjcrDEE+Dd14cx4v6zAw1bfL7uCUzBvykh5qBzaVtMgN87UBYxF1u7XaCGXQk8+jnNvVf+w8ajqYJWrf5CVXqZe0ZPt07FLeFF9hQFsTUTnKKSFrXLgUYb7nUGaa7dsXXPN5XzjZPFP73e+Wt/32m1WNQ0I1xTiJ3pRV1GM6uLfLQY67B2sjUrTAC3XIkTPGxJTHWx/V4x3YLPLLcbS0sppfJ3u21sMRaX3HDGxwgxBTe3U0wnOCUaeUrIuYfwg== 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=fvIzARjqD75jzFUedT6hy86JYljIzAuniYal2n2L4JQ=; b=UoXSYvApaCFeS6fkXayFLughLPhDAOiCoVAK5C0pexMbGHIFejTzdlV6PTOG6/yNcQmxigNcLkYQ9LLkYpSxvfX3CaGSkGJn3rQxg9/4EmurocgMBzzj4z7SBxN+sEHnW8DVAFF6g1d7vDTV1aV9/76EGXhIlTquJX9mqXIagOHSqwC7pN1Np887tcJrryMjqIv03EjznUkqkzR9z1KzEeEv0MJU6wY+V/Etv1Z8VoyAcxNRC1w6ZfwqzqbIi+LosJ6qAinA/eowTjI/pb7AF6Tg6yYpL+0THlweNf91gJS0PNpFkHttb4/T91q9jn4cg9I7Nl2Nt9+9XXtHFSBp4A== 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=fvIzARjqD75jzFUedT6hy86JYljIzAuniYal2n2L4JQ=; b=QjkcaxZttqQo1eG/nRYbAVfxOaXPUrMJpD9KsAtRV/AAvBOORgq7oSCjPKPQoueUs6V1SRD1wFrwvOngFKToUzkhOzZ4VXkx+pXhmsquId2nZnjWHpskkfrqAFpQUO4FDR+LrItIhXgD0zqqAQWO2apwOyUdmt7OF7p4EkOr3rc= 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 AS8P193MB1478.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:350::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.23; Wed, 18 Oct 2023 17:49:37 +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.6886.034; Wed, 18 Oct 2023 17:49:36 +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, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, LinoSanfilippo@gmx.de, lukas@wunner.de, p.rosenberger@kunbus.com, Lino Sanfilippo Subject: [PATCH v4 0/7] Fixes and improvements for RS485 Date: Wed, 18 Oct 2023 19:48:33 +0200 Message-Id: <20231018174840.28977-1-l.sanfilippo@kunbus.com> X-Mailer: git-send-email 2.40.1 X-ClientProxiedBy: FR0P281CA0130.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:97::17) To VI1P193MB0413.EURP193.PROD.OUTLOOK.COM (2603:10a6:803:4e::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1P193MB0413:EE_|AS8P193MB1478:EE_ X-MS-Office365-Filtering-Correlation-Id: 47119b83-c4ab-40ae-c09b-08dbd0029832 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zmwYKs+UuF+9VmuXENlmffMDvRQNZr1BysnKAJWuR+2RkE9kYkiQ78q2dFCVmf7TIWI7hXnQyDhZP1AqL608Y9cm4mUkhyn6CpbiewxSyczNJVqyI4bVRSblnBC9eL2xbq5M/Ty1KgLCZyPB/J4DJ/FYyURKis5tf6dsm+EvyC+8n8Ab8MuJjw9OL+jgiDj2EzBNPR5N7svf5yT+6VNszvdiJAMB+lASRGTiPpBVSBnSPVbgeAJF134MTwOuz/eH83ZDCbul+7E1/FWbpqJo6amFNbDUXmEU/LNSQVYKKjmTSOoMwc/QEdkp040BcOnzaOHfA8mBoSHXOjqJ2k0Zy9MRrO3jkWxvZfGPv2d4Gm4JoL5RuSOZGxpkkxj0l+ch8Gvv3MSmr4OHBa358Svk1ELv0YKFWve7azyeaVsx2z1FKR6hkA6KJgrWS63kmd85/BBXhmrbhriVWmGJ3XVtgARdewTOlsy02rW63sykgL0lKtOUurejc+O7o1IxP8e0aYIrV3a+HpHhp6ynt1GiizsEJnunpNHGBRhUNiAsvOUow8Yqjc77OxjfTzunapcX 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)(396003)(39840400004)(376002)(346002)(366004)(136003)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(36756003)(66946007)(66556008)(66476007)(86362001)(38100700002)(1076003)(107886003)(2616005)(83380400001)(6666004)(6512007)(52116002)(6506007)(7416002)(6486002)(316002)(478600001)(5660300002)(4326008)(8676002)(41300700001)(2906002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?qIdRH9L57uVuCOCNWQY5Jws6Hbjw?= =?utf-8?q?1MMEL7w1vGVjbrtuXHg1puVaXm7ozDIwH/21Hl+LYbKY5RbEGf9Mpsn6nj1yBxF6I?= =?utf-8?q?TM/CxQ3AG+nnXQtCmAh3/dpN4K9+jjr3T24737O8qQ8ndh9rRWGVzzANU0jCNOx5r?= =?utf-8?q?pST2NSGxySgPv1mT2q/hRPn/U12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XKSJ7DTGtbHCrwDJ22a/LU3sgXNs/wRM5?= =?utf-8?q?wzJG2F7KVvewIvjLxdloX2FSOa8ZKUBON5YMDbYKk+JaOTpVKFtgIZOpt5NTxGPm2?= =?utf-8?q?rk/E+psAou53Nq7qDJvLT27g091DipHvfyTNIX63uZ0KEMyo1NEpOl5OX1DTWa92V?= =?utf-8?q?JEUpJTLby/nCFRI1InT1JTAgwLkMxwBuEX2o2/E5aiuHgm7Pzj1orOJNu81Q4GmwP?= =?utf-8?q?5Njz8rWRh58YHKgXeMBh7SY0l05YV5S/NRsC3iQTEGbanJA+tuJN6pulReusd58sw?= =?utf-8?q?a/2Ll2LZWvHSRAtAexAj1XdAwOWbPreVIBY23eN1l7lqRJvWF82g2ldqAFQhjZ7in?= =?utf-8?q?Q/TmLCdOvynJXPBJ9IWDpvKwtfjB4sxSDTI5O2Fim+KSTO0q+He+tDxiuAN91eXgh?= =?utf-8?q?8TCFCmOsYOMz+LYJWk9AzwCPK5/ZDzrtsBSCQjcGMU4hshFutD8fuhRWdl8v/ZLP7?= =?utf-8?q?DBkndX25H3VYtJTNgQQPjzGgAarYduw/EllowupWYDqYaomZqbzf8zdFhGNj5o7qC?= =?utf-8?q?G3KWdU2qciP?= X-OriginatorOrg: kunbus.com X-MS-Exchange-CrossTenant-Network-Message-Id: 47119b83-c4ab-40ae-c09b-08dbd0029832 X-MS-Exchange-CrossTenant-AuthSource: VI1P193MB0413.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2023 17:49:36.6706 (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: GkbGnjbDUYe8IJUFUmF5okip2SdKOCvJXYFGRRcfBuMMMhjJ/9mLyU86Bg8YqfLq6Vyk3J5n9tAjNNKYsmAsbQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8P193MB1478 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org 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 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 | 53 +++++++++++++++++++++-------- drivers/tty/serial/stm32-usart.c | 5 +-- 5 files changed, 46 insertions(+), 33 deletions(-) base-commit: 58720809f52779dc0f08e53e54b014209d13eebb