From patchwork Wed Jan 3 06:18:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 760418 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2081.outbound.protection.outlook.com [40.107.13.81]) (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 B0469179B1; Wed, 3 Jan 2024 06:19:17 +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="1K6Ll2e7" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GevC1aVkzDJxzyhNh4LsDxZwtAEgHv8GWIcYBOOSI1+LsF0vyGciJkxV4hV2UL6EIKkO0VeFk3LtPoB8ynz/pBJCfsl0wOX68/4CiELKGVJNlIHqUKH6ZBawHGHknIuar4ZXceqYVCM6HMSoAh70p2TksTaEvK8QulbLIrGcH0qJ2yNUYomRDV6Mjq+GvKJObQS1nrjXKRxwuC8cmeHZwy6Ie0RKARo9uXELdtBq7ZHT9wgziLroNuklR12P3RUnoOSpgvtQ6Ji5L6o1s2ZGDh2GVV0fDKrnvqQ+v0MhH9Tn/h4VbIP58XIb2aAhq4ejlfvBz/6s0ozqxHc4EdX1Bg== 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=WJ96peUnX/AfmbbyHNhv4J8A1BryIIvMGB2j/GpC8Ow=; b=cqOftn6O10FeWWEb6r3sQ6apP73B+P0xrNtRW7ilTrxTH05Xs7nah8kBvgWO1W6jHmHjbtcAdcwXHtkoVh5TxwGkYBWeMVxXSBWX7fjsQDopIIrStAEufak19NPatzQbFwDHMZ4g1kBEmwnXTyZYCjQf6X1A6hiEPlwd6UMMQOoHph/npykaMzGunSpURCGiggwBOrGREFqcSTLLHDNYnFnQz/sNpzlZWZIIIqYl1FsRmxpsL4V2cyZrocbV3mas//NNBoUS8s0SB41sqPbxHYOvz2T9rsf5xunA1uR/T5PKemMCZ6g8g6pdhNwHt2mCdp+yADtzfJnZip3pokaPzA== 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=WJ96peUnX/AfmbbyHNhv4J8A1BryIIvMGB2j/GpC8Ow=; b=1K6Ll2e7YoLBKXc0QGoqpnrt+QXH+rI8hEj5KD6aMoY+6uVVs1lbcLZ1rHX7jGxYBPj+0+0+qEXXEz9KITAnyIbJrDum7qE/wNw9abPZXFUDfIJYMZfyee9GXURLhwyTT8Ii32TPGAwvysSedJjHdXGOe8HmdEKSt4oFsSXPb0Y= 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 GV1P193MB2245.EURP193.PROD.OUTLOOK.COM (2603:10a6:150:2c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.25; Wed, 3 Jan 2024 06:19:09 +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.013; Wed, 3 Jan 2024 06:19:09 +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 v7 0/7] Fixes and improvements for RS485 Date: Wed, 3 Jan 2024 07:18:11 +0100 Message-ID: <20240103061818.564-1-l.sanfilippo@kunbus.com> X-Mailer: git-send-email 2.43.0 X-ClientProxiedBy: FR0P281CA0267.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:b5::13) 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_|GV1P193MB2245:EE_ X-MS-Office365-Filtering-Correlation-Id: 0bad0d11-fd5c-41dd-358f-08dc0c23e53c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ub71Cm0x9qp1mPmiZ04lKhTmW9cc87OzyrGpLN/NMUTU8UBS/whM7xIJ2fyTQ2do9U1tMGiAHTMCrk3jI3z4TPgVSVxV0Vxt0ci7sKHBbpcffk1ji/vIP3gx2hZMhY2hbILJAyoBAgwiUwGZCs6Y3H4v91VdrV5rMrrO4cVn6wRlBCnJJx4T/1+LAF6u6hjo4i+GsN7r5dwUGxmDc2fCEf85R+b4Qi3sAQzXveDT42Ecmd9lreUyH71/HvgMWOiCNLoR32WUI5OA99+eOiY95WZRqYHfaJaqpFUWM5JfUeF56Jto1PBuCyL+s/XqRpjoISvBz1C1H+3ArEQXmqBJkbSG5HZc1xBfXMMDmHLvwERAMeQgzG/t3qGZmm1GdiN5H4b5Kk1qZLd6PYxy9ZfcMwJLP9OHBFrcJVfpP1Gmt3LAkPUJOzC4c+7yXHPeZ9DRMaDTvIXiXFhRT/Nnf+txGaBPXkEG9O1QDC2WEZebcQODWbIN2VJKbBTiIlKTqZZup3c8rCTWkt+/xWgwWoamkH1RMyztgA6FYM7zyy8/nruaVKCGqIeu6hPaK3WBSvCC 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)(346002)(396003)(376002)(136003)(39830400003)(366004)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(66556008)(66946007)(66476007)(4326008)(478600001)(316002)(8936002)(8676002)(6486002)(83380400001)(6512007)(6506007)(6666004)(52116002)(1076003)(107886003)(2616005)(7416002)(5660300002)(41300700001)(2906002)(36756003)(38100700002)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?PMX4U/1WebllNBoXgcFvsV2DQOas?= =?utf-8?q?EJtArhsiyfFnXQX+jQn0NRB3Pgh22OgtNbJMWswHr+xyi9DowAvCOC5MCSZvEnqxM?= =?utf-8?q?5GmPl/RT03WCDX4Pp+bUa81Cx40I2U5DPvr6iFI60HNfQyIVlXxMF27aFaEHeTtsX?= =?utf-8?q?KAu1fOGcWzrSJvwdkGbpJciNYPTqrNgZB0jGputDw6wS/6Hqix8aVS/aLKnW8LVwG?= =?utf-8?q?Iz1Good6k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Vquu8Rp8Lc6tc2v6mKf6zsl7dDGrCABYSCFqCSF1DpyiuIjhM?= =?utf-8?q?dF5Xgrd4VhAVBNSccwimLl/SRDjXt9wsWCF1RPt1PtXBz+FVTd3SrX8dfg9XM4INU?= =?utf-8?q?imiJBpnNlvT89jRke/BowXto9hacJUFitZZBtqXZu6PKCOrBjpXAamxSA7CiCyhFj?= =?utf-8?q?Cx2Lqcil73kiaxHpax3Qlv3Vw3rb4093SxyswDzRPZ3dSNfLGWW3z7rQfyUMORE00?= =?utf-8?q?Y2n4MOw+8RjG5HWyXPgyX72Ero1A30yl2Yl7N0nHqhkVaZNzH6l7sFHFKpED3skPC?= =?utf-8?q?5qW9BfvunSgm/DXvciJuuaUWOGJceD2LuLOgGOG9hJCAbQhRGjNb/3VIKQBcBfwLU?= =?utf-8?q?q4gqGR8cnK8nm8uW/yxYb5fXSMLRwCCJFlr98WjDMQZPCOLV/DTxJI3flZLc167b6?= =?utf-8?q?asMspOtgQKiYzOvu1SacwQvgEDDLiwC9cBZ8UrRgZ6bdNxQiFqYAAqiCBgsGGkUtB?= =?utf-8?q?FykjLOVNqVB4yOjE3T33UnOFHZp4ZgAjw=3D=3D?= X-OriginatorOrg: kunbus.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0bad0d11-fd5c-41dd-358f-08dc0c23e53c X-MS-Exchange-CrossTenant-AuthSource: VI1P193MB0413.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2024 06:19:09.1898 (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: lqLa1tpFgPIUM3K1tCH7YaGky4sBEWN+86qFQTctdvI6MZZq888gWspeBZHB5xIxqmxw7PImSF5JJxZ+JlhSYQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1P193MB2245 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 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 | 8 +--- 5 files changed, 67 insertions(+), 45 deletions(-) base-commit: 610a9b8f49fbcf1100716370d3b5f6f884a2835a