Message ID | 20231209125836.16294-8-l.sanfilippo@kunbus.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp6033076vqy; Sat, 9 Dec 2023 05:00:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IFF6VNVnSnskZ7BEYdUzKY0h97+uKrCN6ODmWLRUKOBox1Zxh7VY2E3/QHhgfrta8zckYy5 X-Received: by 2002:a17:90b:5108:b0:286:7c14:6d0a with SMTP id sc8-20020a17090b510800b002867c146d0amr2772820pjb.10.1702126799821; Sat, 09 Dec 2023 04:59:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702126799; cv=pass; d=google.com; s=arc-20160816; b=fZ7KKCgKQg1vPCVKUiuolqvdUxYmgIVZi9C2FD/i4UUpV7ojtQIvwaGJ/6TEth/bBT jPU/+jBtFGTayuN5EcZaFIdmQGGVNVqogumeGkNUc4/+RDzAm1NavLVLlXv+JDPc3Zv6 hnpHjbGI9lB7hNDktEe+qmrB/r/9tnLd6TXxRb2M1nbKrqkTMgI4Ibdf2c/QpBbfizsq hFAvnwScHd6ilQxJe7p7Db2UDhK3fMhKgKjbyejFCOYv65NTNlyM1MLELvHni2vzMB4m 3VciXy58n0rTZwao34mvlBVvPlUCnxEIwld/YYUlzw4LnoRymHlhPxe7rn8MyaqVQ66d 8yoQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CCBLbQLe3EP2f7hu3Tl5EQiwyecLdsnuvnoNW4MOtrQ=; fh=B2vyzCgBWMD+NZwvvpzOCCEHx/Ak8bOEWPEoN6LGloM=; b=QbKSYYfvRYqKj5xAfFuP5G71AoHxoJxSg6X/5zCmJ/OVsSifFCZGh/ZU24+G/A2XK5 rDbPruIAbIfMyxWEztFy8mw1A3sBhyY1VRyj0x14S7jgNFU8oTOt/CEVQV5KjRO1yORy MEwOwTovbgWCbawP7PXG3TqYepGg2q63Rds8lqCX6DdZFJ0jnDV4L2L1FLegV0OcJz2h DlzryxLr58ts9wtcMFfGjTHEs1yaw6AHfbHNG59TaJ5Z4mbC5Drj+kt1n18WZ4Sm1dcm 0n1LNi9DSbJq7O76bdT+7LwOTPlfzI5+Cmpc3K2k5a8ePT8UnCEUBNvm878/nhqyyOI3 Ozrg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kunbus.com header.s=selector1 header.b=kimpEe5Z; arc=pass (i=1 spf=pass spfdomain=kunbus.com dkim=pass dkdomain=kunbus.com dmarc=pass fromdomain=kunbus.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kunbus.com Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id y2-20020a17090a86c200b0028675cb4aeasi4354292pjv.47.2023.12.09.04.59.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Dec 2023 04:59:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kunbus.com header.s=selector1 header.b=kimpEe5Z; arc=pass (i=1 spf=pass spfdomain=kunbus.com dkim=pass dkdomain=kunbus.com dmarc=pass fromdomain=kunbus.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kunbus.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 5172F803EBBB; Sat, 9 Dec 2023 04:59:57 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230378AbjLIM7k (ORCPT <rfc822;makky5685@gmail.com> + 99 others); Sat, 9 Dec 2023 07:59:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230252AbjLIM7Z (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 9 Dec 2023 07:59:25 -0500 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2043.outbound.protection.outlook.com [40.107.7.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DCB71724; Sat, 9 Dec 2023 04:59:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PGVldkkRPUKN9fDU3woKlupuoUDpVmI60cp6menB2RCXvO2hDF+NhgdGLfY/p2R13OqHjQGygQm+xQiRG2REbYWnVq/aaUYY+iQMq6Gji+cWJZ7Qvw3Cn9s1gYmjhA/BFi9y40ZfneXO5jqy3A8qpPCUnUTBX4xLbVlOPpzvVLj8rKrhkmVARHl5VMk3X8TJVA/m7EeU2F04PDV48tCDd0D72y/naEJZSRwzJznm3C8kHsbmAqiWKxqrhM3FcalGfckcvqJQa+1wWMAgxFLeDtaOAncG6jIANFSr13TzBX7DT+3Dpr7he7CROxQ26QyREAaonr0e9Kd96E9OIfGlBA== 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=CCBLbQLe3EP2f7hu3Tl5EQiwyecLdsnuvnoNW4MOtrQ=; b=Fwi/S4hdEVpgiDtN806+kDfa6X+4p6EBkB9WXKXueyHTh5ud70iRhp+xou6FNVCTQ+fjJrkg+NvPPzhUDD4vjY1oWVQ6072gSmpd6qSgv+e37z7s1n7J7+lDnsrlMcZIhq8k9isNDZqCgUCSu0HA9eJhRIFmfdZ2II1tjOTq8jKravLHZiqcB8UbjoHUXjzYdnst0bsMnFYC5CBmTdTEopSpxFiSqaBvmo0A68RuPk95zh2OcRNHwdN0oKLBIyYKHZbJpi8NKuyOr4iPDoTvJ4quombglmKjTr/LFrE3WgWHqCTW4s6CFg0ej+HkeDJ5jL64Ahg/HPoDCeab7S63IA== 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=CCBLbQLe3EP2f7hu3Tl5EQiwyecLdsnuvnoNW4MOtrQ=; b=kimpEe5ZaxqTZLyzmHr8rBvqCP+1KPZWLa9ycVO0djZOW42oDoVha/oUxD3mODCeQKJdYa3QuYQBdN41kZj7jp/isMYL014imhFTXF3M3BqMk3qk5IifVDkWy11QncQNY+9TdQhepXMRbIec/lcwMxA6CsDuDt7CBWpyEzMpe5I= 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 PR3P193MB0555.EURP193.PROD.OUTLOOK.COM (2603:10a6:102:31::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.29; Sat, 9 Dec 2023 12:59:20 +0000 Received: from VI1P193MB0413.EURP193.PROD.OUTLOOK.COM ([fe80::653f:d0f3:e7f6:8c06]) by VI1P193MB0413.EURP193.PROD.OUTLOOK.COM ([fe80::653f:d0f3:e7f6:8c06%5]) with mapi id 15.20.7068.029; Sat, 9 Dec 2023 12:59:20 +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, hugo@hugovil.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 v5 7/7] serial: 8250_exar: Set missing rs485_supported flag Date: Sat, 9 Dec 2023 13:58:36 +0100 Message-ID: <20231209125836.16294-8-l.sanfilippo@kunbus.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231209125836.16294-1-l.sanfilippo@kunbus.com> References: <20231209125836.16294-1-l.sanfilippo@kunbus.com> Content-Transfer-Encoding: base64 Content-Type: text/plain X-ClientProxiedBy: FR3P281CA0070.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:4b::22) To VI1P193MB0413.EURP193.PROD.OUTLOOK.COM (2603:10a6:803:4e::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1P193MB0413:EE_|PR3P193MB0555:EE_ X-MS-Office365-Filtering-Correlation-Id: d1e739ce-24e5-4821-f388-08dbf8b6a907 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AOdQDXFfhLn82yElBF2NN57d/Ps8IlmMgi90v/OgrHeBwyXPgg4Wsae5jzyvwzgJvpJlKXVh5DsR9XGMOEm5Y4UW1m4doefPTZ9JssvkEDbAXzjYsmA7p2KKLmtvclxLOTI58QUKnk9UqIbqpvHmA0d36BCCBCVAud57RHnFXo8qK++9eU2wMqNe0LQdS9HD4breF53VDW3z78fN3NQZUIRBdA6s+7aHqQQ8J5wIYZDAT8cG4aFPCwDJ2W7bAZlfM7Wh//3sCSWBw0IWjduv48CyVpCM+HMKpOy6lNhhq3mWruIPNmG5HUpRxmHqwzSYNvWDAvjDcUkvaVDVGXaAeuHuPdJX6BblvDlmINNYCApW38mK5BMKmHP6cnkN6tbedl1S6VNznOLsekWX6UYfWOggU9QxvMy9rpYgIX0a+JcWU+UjXwrX8MgYz/GngovHhNZlhi7nzUc5k6Zr58K2zXPv9J5IltLGfQsG95O2hD+LozT1mtVFaok/xmplLywzrHEXY01SjeJxwYCa+K2cOGGhOZJjOm2WLVQDn//EoiRuNiJ2g4i38RPKNxiXVd9oRiPVkm/PIi1kgNQw+i1fVzDRjGl3JH95k/xEni/A9tRvGVkSksclKLHPTgj/YQ7a 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)(366004)(376002)(396003)(346002)(136003)(230922051799003)(230273577357003)(230173577357003)(186009)(1800799012)(64100799003)(451199024)(2616005)(1076003)(478600001)(6506007)(6666004)(52116002)(6512007)(41300700001)(83380400001)(5660300002)(2906002)(4326008)(8676002)(8936002)(7416002)(6486002)(66946007)(316002)(66476007)(66556008)(38100700002)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Pdah+BdrJS/RxmI5EAukwsyKzXR/d122mSictOTuJ2IE0uMzKcGgYA2U86HvBQ7K+NXwX9EYpa+vuGtK1qEudr5QGGF1BxWUnGLlITsXC+AT+yW76tPpjEFptg+/Vbo7Dxqg2i43hzSCF4zpKr8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pHjBb3DyKzczciZJeg9KEFZALzsroU1FZI+xCCumRtYWmzGSv1E+Foxn5yjGIEZq18+0OYLKFFxgI8cQ/dIWlOry5dzBoKElNAbEbPBFrAiQNsREjNk1K9sd5CovgWEvYIupsna5vCEbx5Nhm48btCGBWdnlVYnq7SB/NRh3mNx5BpwyO3Uwe1XVqnpz+wMFgrBhWuAPxkbqIAyaYeAcLG0YFbe4Kn+mZzhzKzAtPGKhiu9CQvfg1dy/hfeteu1+oCENsZkkXPs8waOCcqi8y7hg26+OURwRslkjtX/s2oOi5CZYCzry/CyGBmF4uOEg7vp5RyQri4YZsRWDYNyQTGEY5zgEEtzR7uy8ym8tWkMN6r/VMQqbfeTw5Jpynz3NphEy88+kPQ+e6JSPZfMdghklX9NoZk11Hm6tAYR5vLawqPX4/+4KlnCqcxcYyqkMjm87Vq X-OriginatorOrg: kunbus.com X-MS-Exchange-CrossTenant-Network-Message-Id: d1e739ce-24e5-4821-f388-08dbf8b6a907 X-MS-Exchange-CrossTenant-AuthSource: VI1P193MB0413.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2023 12:59:20.8152 (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: +AQG1+7gcjayBSpolyk4t+yUcyYNDMEHxnW/LEaU6W2hCxBx8E/2dJGtP0MHUhF4bkewy3Xvb65XAZa19nu/5Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3P193MB0555 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MIME_BASE64_TEXT,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Sat, 09 Dec 2023 04:59:57 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784809310961072932 X-GMAIL-MSGID: 1784809310961072932 |
Series |
Fixes and improvements for RS485
|
|
Commit Message
Lino Sanfilippo
Dec. 9, 2023, 12:58 p.m. UTC
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(-)
Comments
On Sat, 9 Dec 2023, Lino Sanfilippo wrote: > 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(-) > > 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[] = { Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> (I assume you picked the correct flag among the two alternatives).
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[] = {