Message ID | 20231018174840.28977-8-l.sanfilippo@kunbus.com |
---|---|
State | Superseded |
Headers | show
Return-Path: <linux-serial-owner@vger.kernel.org> 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 61237CDB488 for <linux-serial@archiver.kernel.org>; Wed, 18 Oct 2023 17:49:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231618AbjJRRt7 (ORCPT <rfc822;linux-serial@archiver.kernel.org>); Wed, 18 Oct 2023 13:49:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231189AbjJRRtx (ORCPT <rfc822;linux-serial@vger.kernel.org>); Wed, 18 Oct 2023 13:49:53 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2057.outbound.protection.outlook.com [40.107.6.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BD81116; Wed, 18 Oct 2023 10:49:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZI11Qp0ddyi3ArfPj6/gxZ0GYiY4qu8wh2njXgL3FnAb54hRe5JyS+Bvfgvq+RTvJ48Qn8YmYnQQa9EBTFq6Ftc0BokRhR5zVAzh1+/eR0F3xe+dlj9RMfje0SNGxWe/BOPUiJ56KDzvE2MC2Ux6FYFrcxC97CpLfsgwFCsmx3gVOyWUnarySyVyq7c+NO9ENCtdIVhF+M9ulXfogkATdWnOyPmmVSHpwc0QsLtKcV1rR6aBasdFX5S+K5FVCvDHubadJBwZfd7t/8FsKF5j1dYD/HMTzYpGANkWXUx6QDPMq/f6zHoXkMquvqzQp4iqpu7OYpv5jHo+J8SOz0vuMA== 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=KixZxt5y8At1EBQmQPkFhCe8T2ISnHTFVXiaP8tzWo0=; b=n/ybaCQ7K3jKLhxWsm+wVxTmnEf+53MJvI6nMtyUH6xIpvlw8KKdluv7+FS5Kn139bU4m556llJdYKaQQkUw07I6tEY3xCcvgi1g6M5un4bVKLIUCzyFsbHtomAu0Z9fYx4mXglIWpNtslrsu+lL9/6zEeK2pOsCJTgdKbHIMVwi4gBPKXzAlxqS9AT49o+Ce58loAJHgxRwZTAguy5bdBaEScSusSi26pwfHTI75Q0U8uqkSFX/OC6gJuiYsHsGIHxC82ku71kliUbNywj9TyQR2wGt7HgGX6y8FnqzupkpBtDGedbWDnlVSknSjV1uQCl0hSf6m4cQhue1synCgA== 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=KixZxt5y8At1EBQmQPkFhCe8T2ISnHTFVXiaP8tzWo0=; b=a+Q1ikQM8PAbOPC7VKtnALztbYQp1OaETVlctgOY5tVMV0N1CwwUMFgojGCdyoWO1f837C4eLX0izQHnwmgWJkw+QrAEqKJG9ofN7+b45eb5QkzAZx12tlmKXBXR5E9dlYN+r/2i/sWGqbtfWcEr+ofuAw6kfO6GTI3mmp7ck4o= 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:41 +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:41 +0000 From: Lino Sanfilippo <l.sanfilippo@kunbus.com> 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 <l.sanfilippo@kunbus.com>, stable@vger.kernel.org Subject: [PATCH v4 7/7] serial: 8250_exar: Set missing rs485_supported flag Date: Wed, 18 Oct 2023 19:48:40 +0200 Message-Id: <20231018174840.28977-8-l.sanfilippo@kunbus.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231018174840.28977-1-l.sanfilippo@kunbus.com> References: <20231018174840.28977-1-l.sanfilippo@kunbus.com> Content-Transfer-Encoding: base64 Content-Type: text/plain 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: 9b44f502-6f15-4798-29cc-08dbd0029ae6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rZkcZ87g+MV0N8+Z6DVmA2u3soE55ZeWshYC58BRH/JYaeI63ilaIVPWaUOCc0A5oGRZjx+gA5Fnq6QiFd/iP4M3NvUS54sRcrIGMbdEsmLaa5PdZk0OcFz+8LIuqSfBnqHUS05PRYHd2aosHK9cXa218AT98aSsmeaaspdF03Qi9sMfl2yfD2cEhOBRre3NDDAZ6bMSsemaKY8pQKuf6ZNI3hFTd/iikHr/S/eu4a3+bx3+A6jpEVNCIPc0Ydm4FDO/OaliBBMjmRNj2WGIFC2NgqKwobDYglpJJuPa6mbfQ2RnAcYV3NdP4P5G8SsU1BkYdY0nMGZ/PYuh7989WxvY5bSKNWA4MoOShYCc5ZhjK+29edwtYxHsDQ1hmHvhTEdwd6COJX8MGG1hVh5EvTcWs9aC1NctBd5IOD/SfjJipv9n0jQPgqY5Em1KlMjhEuuyNUAR/hjLLwbHdLYq+z9xdqJVU7VjygAswBI9vI3oHrt9p10YjBfZ+GcR3d5nJ97EBAd3j6BQjRJqpjv0ryxlN+LgYMA2mjg7FmmQbqFdCH5N2HxY0VZ0BMsp4O/P 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)(2616005)(83380400001)(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: +Vg6WFXscyqjfbqBBEjQg0Onb0PsOjkTqLQJ7dcX3x9QXM8aIxV2c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Jlo7NCORZirJeo3ThpgC1HTxpljtm3Y4I05RoXzmYaKbLotTO4Rebx4wIOTsD78sVWWEqTAryX+MX4K4Yhhk7bEVpPRGx1vdREX8wu2MEa5E+lDLaVzl5qSvra4A2Stk3NJSwFcyvI/VhdTiiTZi+WlfCnnvNdLiWe8dNOZKwegre8avSEGQ0QplTPHJW4xv4hnAfuJhHP8NYn1WUqCi4sfK/mMAX0ECuBYA87RRKT0WyyUKbSCBHB/1dRTWJVld5KtPYkMX7cEshDudz5ojz7P5WuDm13o9YFhz8jbBcx0eq7UkukGOl4d/LsJEz4PCJjFAer8EE4TBaaFHauClVBrNNfhVMrzvz37HCIoUguNuJB8hpIal/ZGlJo6bU4P4gFERj77pe9QtkWOuMiDFJ0gd3amqjAQFvuzzMWgb13O5MlUlK5O785fJDx/j9dGtdsHrym8kiCfMsx+w8CjhRY1egbS/VKpg/pQLAjL2VBt3I0dr/W7mE+ODlzjOtkfC6xYkKYz8ZGZXRh X-OriginatorOrg: kunbus.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9b44f502-6f15-4798-29cc-08dbd0029ae6 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:41.1409 (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: GZuGhQcJ/UAZhnIJhtsXmXjPPFLaAHyc+BG0wmsA7KS3mCRpFcLTiVfjVr9+trzU9GWHDgJfHCRXfMJfew+u/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8P193MB1478 Precedence: bulk List-ID: <linux-serial.vger.kernel.org> X-Mailing-List: linux-serial@vger.kernel.org |
Series |
Fixes and improvements for RS485
|
expand
|
diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c index 077c3ba3539e..8385be846840 100644 --- a/drivers/tty/serial/8250/8250_exar.c +++ b/drivers/tty/serial/8250/8250_exar.c @@ -446,7 +446,7 @@ static int generic_rs485_config(struct uart_port *port, struct ktermios *termios } 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 = { @@ -490,7 +490,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[] = {
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 Signed-off-by: Lino Sanfilippo <l.sanfilippo@kunbus.com> --- drivers/tty/serial/8250/8250_exar.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) This patch is only required if "serial: core: fix sanitizing check for RTS settings" is applied, which is also part of this series. Therefore it lacks a "Fixes:" tag.