From patchwork Fri Jan 5 14:11:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 761741 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2060.outbound.protection.outlook.com [40.107.22.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4EA342D78C; Fri, 5 Jan 2024 14:12:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=kunbus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kunbus.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=kunbus.com header.i=@kunbus.com header.b="XO1dwhz/" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=guoN0MLtnqbcJw6hklUEPBiyIMHfpL4C28AQynC3JsdC+V3kOXhVUvObRJ6RTPuqeu+Ouik+9JeizJTnbTiWGG5/KEkfloHxHcRKqtKH/kUjWnSZQw78cRz37hqlTGaGZ0mGQ7xKxCHjXSQBpK+7ISypgIbAvDXhndF4gj2kDMUrWCuMeDrilS5ko/vad5ZSVQn6wsXcsXvth9A0ne24OxzuEp5FTeDvorq0u4QAqRSE1nHxlbpZOLwPPTi8v2ktJ/Zd38eMc3UHE++MiBAJNOD1CEZrnskXyhnX7FM2dQ+msXnwRq1lSd5orpWxxbtBaqfwAGO+zLScWaSK9+Cq6g== 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=3cpMPjBdfdRl/+MN0UH/cwlNrNoO8hWs78fWOsxhrNU=; b=OYrr+w1+kI0zbA7fIkkUykkDq5qJr+Yye0JtqGjCrPT5IDg014PmFGZ9kQ1jHyBJ+Zr9bal1toUC08x4DoNNzO8dGjCaBFkGxgi3EFIF+OoiFm2BnOunHJOt5LIaoJAJs8PXY/ELzp/vEtbM/YVBcjA53Nl6cBrJJJp+BrWkPt4xx7Lc9M829iB9iUAo8JwrN+AwVVABVmqVDRRG3uLvBa6Frj5k0nNxYj+WLQxDnw/jSHchUXro2jtSSXpYxMpcUgSyfN4pTFIGK5DmpkBQqrrndcs4P/IK2xGaHT8RNZ7SwkXRw97JqLEQUleHT9YkmaXIyG9JElmNaEwtzxHdcQ== 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=3cpMPjBdfdRl/+MN0UH/cwlNrNoO8hWs78fWOsxhrNU=; b=XO1dwhz/bbhlRvgp3ZjscOUcW3dZQ/RUGF4DCnimuXY7WtnLfsvuuZUNl2PrYNVoZaUZj1HRbyMc4PitqXAYSMS4tFjGrndXb94g+m0L2MJ7OFie1mvYgyilxFqy9cmvkJqKWXEqVr0XhYxhtO6ERBVXm2nHaFzwiIEb8ge1Dwg= 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 AM9P193MB1538.EURP193.PROD.OUTLOOK.COM (2603:10a6:20b:30a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.16; Fri, 5 Jan 2024 14:12:12 +0000 Received: from VI1P193MB0413.EURP193.PROD.OUTLOOK.COM ([fe80::67b0:68bf:2582:19cb]) by VI1P193MB0413.EURP193.PROD.OUTLOOK.COM ([fe80::67b0:68bf:2582:19cb%6]) with mapi id 15.20.7159.015; Fri, 5 Jan 2024 14:12:12 +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, m.brock@vanmierlo.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 v8 0/7] Fixes and improvements for RS485 Date: Fri, 5 Jan 2024 15:11:46 +0100 Message-ID: <20240105141153.19249-1-l.sanfilippo@kunbus.com> X-Mailer: git-send-email 2.43.0 X-ClientProxiedBy: FR4P281CA0327.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:eb::11) To VI1P193MB0413.EURP193.PROD.OUTLOOK.COM (2603:10a6:803:4e::14) Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1P193MB0413:EE_|AM9P193MB1538:EE_ X-MS-Office365-Filtering-Correlation-Id: c3c3838f-0f9a-4180-0c98-08dc0df84f81 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eEO2FvSTDDCDnKeLzpHNOuyXRmtFtQNZmff8UaR2a+Yez4fCkPt744wm9BJZtvlpVJxU4rLDjo2SJvwVQ6WdlOXAR9qbv1wTrg+HW7DXUM6NCWjdMYgj51O8Zgk1FcCSqR1otx1hZUWql0Y2w0xkb+wb2LveqIFF9gfxltE32JZJUhaXR51/TaVd3ZZDAorI1vdgxNLrB9u6hnuPNj4eDVc9gC4YJIzCdyAmZwBPpjnpmJRMlLm2G4xXRSAB12wCK6O25WzZZiMH1Nw7ioqvT6HLhwhzuW0Tpr56HUCfZP62w65PBYtl12biCd8/zbKjoO8Muwwgbg0+5yhah0kCi40lHRB2i1N/TmiJdMXV+3kMWPkb9ke2AJL8HCOmHeUlZM/+cguGCxRfjutlmrPj7Fvdzed0CCSE7c3NKcirksHOWsCnaeLXftKazUP3nfB9jFwIVrhK4qPJgsHdT61fRLGynz3U9HkQuRBtH8rnZ/6NF1q8kXQ9Ih+xXwOTuoZFCTLHOHeCHxFTpTszNaY+aunNXTURIIFZoMjzTFyeGf6F/Kwl4pqTg+7JCy8LG2Rt 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)(376002)(136003)(346002)(396003)(366004)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(36756003)(52116002)(6512007)(478600001)(6506007)(66946007)(66556008)(86362001)(66476007)(6486002)(83380400001)(38100700002)(2906002)(6666004)(2616005)(1076003)(107886003)(7416002)(4326008)(5660300002)(41300700001)(316002)(8936002)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?aHbXWzhBsVudy3FKTwZeBx9RWwVX?= =?utf-8?q?svDoGI5quyxoArLNcNtOojKRcFMddInLuQtFxw47l+HfrYCJMgyiKlrjOwi2gZ2pA?= =?utf-8?q?I2cR3oM08nNSPvG6MnPVUk6l6RDE3LWxZL1+cnc1hAWTx3jH5MYa18SyWrtvaUSqB?= =?utf-8?q?wtCHu+gokBzODL9tcVK2ZYG6KBsp3JFAbNz+XQL7QnBHFM8aKZ/PS0vb2HCJ00Gai?= =?utf-8?q?M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8?q?w1E8zZxbrgLx83WTf+Y81/f0gUd2WHbELtrtULKyhekhRILVEMFeSvcf4YfO/0NaZ?= =?utf-8?q?cmVmUQ7+hE9r2dLdUoTVSJorP79JFDoIXsgvwjhoJjs6eJsk7go2yjcHKVaOgmSxF?= =?utf-8?q?I4+hA/UO70Khi/OjEExDmbjiVSXZ7oufVGHj4QvR4rxo/BvTph30LprVoA6qFMN4/?= =?utf-8?q?qOf78cNoMIqvRFQEeoWVlwkC28GU/S/YboHFbq7vH2QK9YPHInyvbO2EvA7G/1N9d?= =?utf-8?q?wqzS/E6toAyK6i0z2FXaddPeILg7VbLJS8vWhU9xqI2OYyavMHX32LxqCted63fJd?= =?utf-8?q?yrJxE1DTPFEvzbSxiIWH/vVgc88m3Ydi8ct9vqUv0VCQ1q7w0zHR5rSd5L8g5R/or?= =?utf-8?q?oa/QftSmtojmvAm7dWi1JwR+dU5xgTwwvlu4V+kdkK98SwUssluV0Zgb8+gjzhbDY?= =?utf-8?q?/XT35DyLtTgCILIP8GIzU4vubsZnGLcvpcJVnhahrcnwBaPkqCnoXz9WkAXkdaVRw?= =?utf-8?q?/AJR4mwsHRkA1VdFSQsHkBSFoaKl/nKJQ=3D=3D?= X-OriginatorOrg: kunbus.com X-MS-Exchange-CrossTenant-Network-Message-Id: c3c3838f-0f9a-4180-0c98-08dc0df84f81 X-MS-Exchange-CrossTenant-AuthSource: VI1P193MB0413.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2024 14:12:11.9303 (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: r2Av5WwwALKPa8xoZpiHANjotXs3aUaSNX5OCw6Cx+tBnh7TZ8rnzonAtAnzlRJcsfHw3BkFO5VvCOxBPkOtjg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9P193MB1538 The following series includes some fixes and improvements around RS485 in the serial core and UART drivers: Patch 1: serial: Do not hold the port lock when setting rx-during-tx GPIO Patch 2: serial: core: set missing supported flag for RX during TX GPIO Patch 3: serial: core: fix sanitizing check for RTS settings Patch 4: serial: core: make sure RS485 cannot be enabled when it is not supported Patch 5: serial: core, imx: do not set RS485 enabled if it is not supported Patch 6: serial: omap: do not override settings for RS485 support Patch 7: serial: 8250_exar: Set missing rs485_supported flag Changes in v8: - remove wrong setting of SER_RS485_RX_DURING_TX introduced with patch version 7 (pointed out by Ilpo) - fix commit message as pointed out by Ilpo Changes in v7: - fix errorneous condition in stm32 driver for setting the SER_RS485_RX_DURING_TX flag (pointed out by Maarten) - fix compilation issue spotted by kernel test robot Changes in v6: - restore RS485 GPIO settings if setting rs485 configuration fails (pointed out by Ilpo) - drop change for uart_get_rs485_config() - rephrase and correct commit messages (pointed out by Ilpo) - remove unnecessary structure nullification (suggested by Ilpo) - move all RS485 tasks into one function (suggested by Ilpo) Changes in v5: - do not combine the functions that set 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 | 11 ------ drivers/tty/serial/omap-serial.c | 27 +++++++------ drivers/tty/serial/serial_core.c | 61 +++++++++++++++++++++++------ drivers/tty/serial/stm32-usart.c | 5 +-- 5 files changed, 66 insertions(+), 43 deletions(-) base-commit: 610a9b8f49fbcf1100716370d3b5f6f884a2835a