Message ID | 20231018174840.28977-8-l.sanfilippo@kunbus.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4963966vqb; Wed, 18 Oct 2023 10:50:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFS3qAdw3kUGCqu1ufpypits0ZmiZ6WIgH++sGl63kNeQ8Rjh5dri8qLjQ+dBpJSBqM1epE X-Received: by 2002:a17:902:9b8f:b0:1c4:44a0:5c03 with SMTP id y15-20020a1709029b8f00b001c444a05c03mr98738plp.9.1697651416812; Wed, 18 Oct 2023 10:50:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697651416; cv=pass; d=google.com; s=arc-20160816; b=mHEV+o/dYd+0zpFiFba1a9Z2VT43V7dzJsdrHhl2xt0fmD4VLxQld54jMrZ++2UdLc iSo/Glq0D+GV6pnUJAQWS9wyCmSlO7PspIzmPGPkAoZmKwEgrAv44yUj0zSoFEbDSRIK OOOPWcAoEq28S1KvenrwXfLw9BhXK7LYjgdb9rAxABdeYB8pfKNxcta31mK6fz/JtYWu qG+FH2DSo7vFQOa9Nw52scxRQAwEq5p/aEesECuvN1KdWWBVxoTcac2iBTrAKw1CfmIz RDl9dX2Ti65vlRu5VM+C3e2VzwmmSuMRyVq/OCRcCIph8+yBa3oSaw+N0UYCnaXF+UGO BaQg== 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=KixZxt5y8At1EBQmQPkFhCe8T2ISnHTFVXiaP8tzWo0=; fh=TkiyChPg6bbF3HR9T06bpNLcepPHbldn/GrIZCqgMvI=; b=yyru9E3GXuOqhI3ASJRxaSCErdAlyaGCQKpEgul+8VaUzTs/z6XLEZDF80hNdG3zQL tMtGioht+7qsUJUzhXie5Mpm4kz6jTzCCzGS2InJeR0HN+3RrNdNQ8CHCl+WO3ogPYWk UDL7IdtcP/Z83SQWDx8cEy4rzsPAVqGIiHLSg1mSfhzvLX0dIFv6+PzbESL00R/JtV68 hsZJERD78mwtTYBhFGT9F6pAFehpguidv5o9jJ0GWICdrr4o6DiheDJzdCHyrqpTa0tf WZlDZbMKaAcOyOSQxWro4sp5wBnWfhra6wps6pMK8bjU/55s72pX+WQvldSD5JgjEbjm 1tTw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kunbus.com header.s=selector1 header.b=a+Q1ikQM; 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 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id q3-20020a17090311c300b001c7218c4db8si403528plh.119.2023.10.18.10.50.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 10:50:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kunbus.com header.s=selector1 header.b=a+Q1ikQM; 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 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id EC7D381B94C3; Wed, 18 Oct 2023 10:50:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231918AbjJRRuM (ORCPT <rfc822;zwp10758@gmail.com> + 24 others); Wed, 18 Oct 2023 13:50:12 -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-kernel@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: +Vg6WFXscyqjfbqBBEjQg0Onb0PsOjkTqLQJ7dcX3x9QXM8aIxV2cy7zEhwy6lvc5CK/bhcr57HWyl3/oehwns+aQuyHiwFpSsS6kfekM93LgomeRCDq90aMpm5wSrxtLGwCniFP8dPG/lPkUk82fN01qyfd7HSEEQUw8gESlITnr98WGAu/S10o/+0Douqo8WEkYPohcv4pZ5h4Lp4wUwohotGvUeVtBdyD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ZKwegre8avSEGQ0QplTPHJW4xv4hnAfuJhHP8NYn1WUqCi4sfK/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 X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MIME_BASE64_TEXT, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 18 Oct 2023 10:50:16 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780116532274087697 X-GMAIL-MSGID: 1780116532274087697 |
Series |
Fixes and improvements for RS485
|
|
Commit Message
Lino Sanfilippo
Oct. 18, 2023, 5:48 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(-)
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.
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[] = {