From patchwork Fri Jan 5 14:11:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 761739 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2080.outbound.protection.outlook.com [40.107.15.80]) (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 6D83A2E414; Fri, 5 Jan 2024 14:12:22 +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="DPttAp0/" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iOnRHYuXkiy0LthVVIyclyZHm6wmLWxYfNc5Y05T8HrngxzTTFqY8KMnarjLGEFduEqsWkOHL3MPm0lLUERPpmnoQPmjiVfw3LQoJqjZs0tYkIOi07ToG0Su9DhQdkCsy9baRcCmcZWHMmACVJb9eRpXnbjlBd6xwSTnuIAiSqXpJlzqbZhz1Om+s0qzlmOjAdWiTGDVV3vHUpMPPJ9Wx2nJJGhxM+BPYXW5WhfCTVsHKPVz5klqpNJMncB40N3K+LNiRnFDOfzLVTdxJ8qAAcUFIKkbdX7PpSBD8IvzOHJJNd0WL3nWVVFPemd3sKI/LV7vamTKNP4x289M/+xvqA== 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=6BcGoe+ESDzoCivkDyl+SvQ6vxiyAUtVpHN4Fyf7TKI=; b=JzfaphI09etIdPQmmCzjbcl3olLF3wrHrzA2QYltA+TulO1cC/9yAZA5q8rke3dbSMjcieyYz54XrLvd6PSfK7sYP7QFKNtxbQyNrwXKX72npGeUUHUCn35AuSftRUS/2TmPnfH2T8Ry7kNqz5OlF2mxfgX64lrWzuYpAye73dt0gJYZo+mX9a4ECVBMsKAkRlCJSDOA316RwH9XKzc2RgQ4v4QweHq6GXpUCIAEakC9mGNfi+34BrmdcZ8i84Cu7BIvJeIXDBSD5XrusjfVgW3UlxABjGVPxKajkGeFgaA6NTFRcWfhclwWQHSIU1FNL9ujinUFVJOnxFzSpfp78w== 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=6BcGoe+ESDzoCivkDyl+SvQ6vxiyAUtVpHN4Fyf7TKI=; b=DPttAp0/XMkIb1FvF/YYqLaAUfs+aAu/RaiQngACPmy/amnhIInGdBsPYZfSOfF2JyNGjb2UVPQGQwO/quXOC5p/jGcbWMRtTPq7TciJAVXcOSutoIYTY+RngNHdx+8GxW5aFNVLCWjBWFE6MolfDUEYcqf2dPwmYbwtmiWc4nI= 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 DB9P193MB1403.EURP193.PROD.OUTLOOK.COM (2603:10a6:10:2ae::14) 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:19 +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:19 +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 , stable@vger.kernel.org Subject: [PATCH v8 7/7] serial: 8250_exar: Set missing rs485_supported flag Date: Fri, 5 Jan 2024 15:11:53 +0100 Message-ID: <20240105141153.19249-8-l.sanfilippo@kunbus.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240105141153.19249-1-l.sanfilippo@kunbus.com> References: <20240105141153.19249-1-l.sanfilippo@kunbus.com> 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_|DB9P193MB1403:EE_ X-MS-Office365-Filtering-Correlation-Id: eae7664a-64e5-4ed2-c0cd-08dc0df85413 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pclExZA+wfAIN9iDmg6KFEMi71SNqIxCeM23GcC7SOzz6kdmZNeaFfO93dXZuYFJV5NVAej1cB0C4FNPFW/OhBV+K0OGb0ipgZtRcWGG2o3kqalyJaH29OiQQp7y46VBMIbH4B/cddE1lV9tAHMVKwVn+JsmIZfQEodIZBj6Fu8jnebdjm2xKMU1iKvJ7IaYibb80Vq0/XdAp74B7HHxpePQRp6RXgPl5+5aRu/igaZnP7CMefGbUxfJ1Yq7OR5zpKAie4wmub/MHbw+4dNHgocugGQs0EEpn16D2fwtCzE1XdWnHP28HlAeGTb2ahg+0CIkOrVJsZygX30Kwyc6u+I/+AV3FDJQUjHUf9OQdX3pCrkQg0ycrcyvCgPRXx7gP1+lQ2zv2fOh5SjkRznL+IG3e8+bLx9qYzH2BM+BBMJ6UriABnwzGfbfNINl+Kn6dAnU96ciVrQ/lqTKZjgcdPfctGCFQVR2ZAT/pXlj7GdTAEit0Fr+LFqT2hIe5CtmLDUaD6HLdY3n+CPVSvtj4CGEjR2CmPskvXSWgSM/hiVJ/rY75iH0yd7EVimt+TQMMcRuKC0yVCB6uxJhIJSqOU7ayjeftVwOGrLZ7Ti3pdlBTuekYBEU5wP33ZU0abjH 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)(396003)(39840400004)(346002)(366004)(376002)(230273577357003)(230173577357003)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(6666004)(478600001)(2616005)(83380400001)(5660300002)(1076003)(66574015)(6512007)(6486002)(66556008)(66946007)(66476007)(6506007)(52116002)(316002)(4326008)(41300700001)(86362001)(2906002)(8676002)(8936002)(7416002)(36756003)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?sNIsRgqo53yE68HztynLSagKH9wh?= =?utf-8?q?Ni+r31nUrf9CAQ78gp17I56qulexrqNgvSOGQggBrJUuTefDKD+vSeGWwH71Jr15o?= =?utf-8?q?Te2io7JW/t7obKY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cMiUB4eZTD+CLKcFDkFkAkTb+LcJrT45EjEjBLMKdufgWjG68?= =?utf-8?q?EgFUSyDG/2tFekU3x7qsti6wzTMAF07lZdGWDd3h3hcfO76x8iDKrF/pp+COIOaE1?= =?utf-8?q?MJ4/t6O895cX6fEpZLe7vxiDaSLDXx66oQxpTClzH6JUMxt5CGAD0b8+Gu6yzWzID?= =?utf-8?q?Qb7fCApbese0kbZq1UxJUmNGzO4tzZQ4cOrSynGngYHt0esiF5eBdqM/uPBUtcpYh?= =?utf-8?q?wLs1N+2LeKw1PsGs/pU4QGL3G35FPuyOLsubeva0hwwRj8Xb7/Sl30LHGUhQguQBN?= =?utf-8?q?OZ5bYWrBVgGPVX/tvdw0QVigNLT9R7iwKdl2wAKV22o1y9EGjJcmDHXcRX4XSCFro?= =?utf-8?q?Q5t4m6fTmgATA04UySj4qtRRw6JYadM6pB+LjhZJZHu0zMTjYcSTl2FUfCWvQtqbM?= =?utf-8?q?9/nsybpE0O9xrkXPBQhZ7mHF9jkiDTtT0NZCH47jwAdqsVmeG5mVTCqNy26JzgTXL?= =?utf-8?q?a0dRk2dNFsXofFWmu5ZWFrnEZSdiae2y47j4WjyIxsB1jg8BNOz/p100ObLc2tKfW?= =?utf-8?q?oAk14LXugk6yTeVSMAmoJ5bLVRqQhNXI22tl7TtDRmmiciJHiCswN4K6QJEwsr2BZ?= =?utf-8?q?91uwLaaupw0sn1Oe7YR+JvW0nHB8kUlIA=3D=3D?= X-OriginatorOrg: kunbus.com X-MS-Exchange-CrossTenant-Network-Message-Id: eae7664a-64e5-4ed2-c0cd-08dc0df85413 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:19.4579 (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: 9pPPALFKj05UIt33mO20FNIQoLp77EGDTHwZ/9MbJZGXLsjtZAOA8hMqdmEGolkOm8ElmiCpgICjhvoaM3wqag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9P193MB1403 The UART supports an auto-RTS mode in which the RTS pin is automatically activated during transmission. So mark this mode as being supported even if RTS is not controlled by the driver but the UART. Also the serial core expects now at least one of both modes rts-on-send or rts-after-send to be supported. This is since during sanitization unsupported flags are deleted from a RS485 configuration set by userspace. However if the configuration ends up with both flags unset, the core prints a warning since it considers such a configuration invalid (see uart_sanitize_serial_rs485()). Cc: stable@vger.kernel.org Reviewed-by: Ilpo Järvinen Signed-off-by: Lino Sanfilippo --- drivers/tty/serial/8250/8250_exar.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index 6085d356ad86..23366f868ae3 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -480,7 +480,7 @@ static int sealevel_rs485_config(struct uart_port *port, struct ktermios *termio } static const struct serial_rs485 generic_rs485_supported = { - .flags = SER_RS485_ENABLED, + .flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND, }; static const struct exar8250_platform exar8250_default_platform = { @@ -524,7 +524,8 @@ static int iot2040_rs485_config(struct uart_port *port, struct ktermios *termios } static const struct serial_rs485 iot2040_rs485_supported = { - .flags = SER_RS485_ENABLED | SER_RS485_RX_DURING_TX | SER_RS485_TERMINATE_BUS, + .flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | + SER_RS485_RX_DURING_TX | SER_RS485_TERMINATE_BUS, }; static const struct property_entry iot2040_gpio_properties[] = {