From patchwork Wed Oct 11 18:15:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 151514 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp728778vqb; Wed, 11 Oct 2023 11:17:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFGap0OHKRNekIDi08qFAopetypaFebKpZiayO8CR1m6pML9aV/sHxSTQA/KrtuS0nJxfUK X-Received: by 2002:a05:6359:b9a:b0:147:eb87:3665 with SMTP id gf26-20020a0563590b9a00b00147eb873665mr17628430rwb.3.1697048221183; Wed, 11 Oct 2023 11:17:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697048221; cv=pass; d=google.com; s=arc-20160816; b=kir2Cnt/9uoLtfzk53hrlhmW1dJwn2wt6dj2EPhPtL27WrITJe1ZCljEUiFowEexdU fOO7eZZTTcrNk/XVC0d4pv4PFb2scWr1G0F2sCIWd0TeT08uvjcKRKAehMUx9lfRL9tG i0ezTejp5ZiNlXPvWI8Otrg6Q7EhxB+l37dtYUuCfzG20B3Jiv+VI4U4slECy5ssSimy fQlIADig9dTKLt8EyOZ6J7kx1Jpun2/9VCpgkflN4XELsf4ud75L1bC4b3g391hv6yJs e3HLu2lMo6LXbnL6DgwdXQCenDqvw5bEGyzt+HwRuBlUzAth/ByZhsJ6w4sHxq6DuXbX 636w== 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=qfr9CVtu2RhfuGF5Ku22UhpbfvaQTz9uuOjeoqXvcnk=; fh=USa8qwlB/WGEeDqy6MOlMhU1i9vBvqThUFWUX/qv1Ho=; b=Wc5likYmQI70xE0wA1KPKKTCkViSXUNpbAuLtQN4U1YwTIpNILAOV6V9ifa7z89FlK DTq/qbMwhUnNyrB17G0+mkVXAc9j92tn78QH0bnkg4PGXgiFyl1IrOHyak7JkBlW+SVq qZxv6H8hAF5XHgCHhXVghNOZqUwGwbs1DQrBaZCycTvegFIJfhYhtdFTpGJy7B+F+7Gb 9PrSeV3FYg4SnFfXFg210bsQl8G/TKJUVauKiLEn3wOtIiA0v6gkCvIIVg7eai76dbs/ lok27TF5BmtKCH5OO3HbAR0fyCLMXHYwi6ytKun7DYBSyj2wMtpLEVk3RSjAhrD4z7RQ gjIQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kunbus.com header.s=selector1 header.b=BKOd4aCP; 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:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id ei22-20020a056a0080d600b00690258a9777si11861936pfb.20.2023.10.11.11.17.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 11:17:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kunbus.com header.s=selector1 header.b=BKOd4aCP; 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:5 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 groat.vger.email (Postfix) with ESMTP id 4050080B2887; Wed, 11 Oct 2023 11:16:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232636AbjJKSQ1 (ORCPT + 18 others); Wed, 11 Oct 2023 14:16:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235125AbjJKSQQ (ORCPT ); Wed, 11 Oct 2023 14:16:16 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2041.outbound.protection.outlook.com [40.107.6.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 328E0D3; Wed, 11 Oct 2023 11:16:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZpHCnwsjKlRWK254mIMVeJVliv7z+M06W5SWheBaBFBivtdXNS2/Nmgg9a7CZBZlBjAcO2EgqKKM/Gf4jtSgxuPUEgemG2XZ3neLmg23KEZo1eAjr56ndE2GQygwPA0abBBJkfKjeuVttKULVaRFDt2yzpOAjHFN2+IgYz3c1bDQGMzaWh2VxUI0tZTOw8o148PlRP4BNuGgzMdNMNoRLVrn7B+hhXf6/lgWQ45U7N7DYE0yt+ujLuhrhnXlKFqKYr83YtyR6hujqbSdA4H/wC4ZuWc+iWamREDddCOaloL/HgGJJUzmUytYl/BNzo67tH+up8S8cIX8RWFJcEkIxw== 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=qfr9CVtu2RhfuGF5Ku22UhpbfvaQTz9uuOjeoqXvcnk=; b=g9rvEPVF/+ojPwOlnOE8yxM9OdBgpbzSPxqUYzar34oUI+R83Ho+/WwTZcdI5YBb7tQQ0PrzUMzdOxL+2c/ZPTXClE4dNW9PfQBkdtZac2aS2BRLryxdb1YZO9qEKmI1oYKBbxkS51h92suMKMg5j7KRN3c/61wnA1orakb+MTEtUDmHhzykTZ82umeQ11bDYrsx4w0oumOsldPPlmpLVumuszXYSUZUdXAjCqDad4plfRx1Alf5sHu9nfFRTFlHoes7YsBzvLZfsxWgsjLwdr9D1MhLF3uFlylc7y56XM7OyKChLTRnhGhnQVQBgj4zxD8gyz1EvSLOwoPbboq6Dg== 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=qfr9CVtu2RhfuGF5Ku22UhpbfvaQTz9uuOjeoqXvcnk=; b=BKOd4aCP8zDfInALoAoQIwW8zEHpcc+gFIF9ulIMhvBKhWHCKel66v8oq8lsqzjRfteI9VTQqqKCXlDw1wFI4YCCLmoOU1o6l7g8LLOy9Jl7i9PQwFvC5u5ldDsHrwu/Vjw1CbZj6+mcgpWp+4AgUlkCQVSMjbNL1ECds8pqRxA= 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 DB9P193MB1497.EURP193.PROD.OUTLOOK.COM (2603:10a6:10:26f::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.41; Wed, 11 Oct 2023 18:16:11 +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.6863.032; Wed, 11 Oct 2023 18:16:11 +0000 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org, ilpo.jarvinen@linux.intel.com Cc: 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 , stable@vger.kernel.org Subject: [PATCH v3 2/6] serial: core: set missing supported flag for RX during TX GPIO Date: Wed, 11 Oct 2023 20:15:40 +0200 Message-Id: <20231011181544.7893-3-l.sanfilippo@kunbus.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231011181544.7893-1-l.sanfilippo@kunbus.com> References: <20231011181544.7893-1-l.sanfilippo@kunbus.com> X-ClientProxiedBy: FR3P281CA0163.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a2::9) To VI1P193MB0413.EURP193.PROD.OUTLOOK.COM (2603:10a6:803:4e::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1P193MB0413:EE_|DB9P193MB1497:EE_ X-MS-Office365-Filtering-Correlation-Id: 89d5d62e-89e5-42f4-e789-08dbca8625cb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s2OU3bmYejiuvsHxVCOjuc+42S4mVK3eg/fg1JnWJewZTJ8eqSlGDfDk3ilrKntjZUG1ICoFluCrFq74InMjd8l76KjBILRQdI3GHeLzjgzJSJVF46LKFEwne+qO/KaSjhgxNon6h/TQCvmGNHQab7JLmrWpCc3tMa8b6+OLPYu7WcNNIUpmM7v1OaMYW+abpcTSt+4Ly8swZEcXkuCTy31KLGSaV0Q8qADESD5mxoMLz0CZIj7efGQfHs/nwXGESeBspv6oTkH4SvOOdZaNPycU0ifTfmWEB74Ye3PV8OXFZHE4I7XqcCt4lpDG3YMFnr62X80uoSQ2PCf89hh6+uWVmQNN9tbvCckA/VG/oUEVMvEjJ0Ge1jkblsPRAGLb4qccc+vc5cIr6TQaK9AEGMNwZax61ij2euNQdHPn2q3iOMfC3X6/IxFtDPNT3R42vq4rDrWEUQpYmniVKgl1AU2QkKsFYVUCPY6bOoGh2MZIs/Gb4rdf1vWhwWbSa/KZIH+G9oNwGwUvUWUeftxfixz5edPlHzwoDRAhjBFi5mhGun8v9GS5m3dm6KK5+ZbF 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)(136003)(366004)(230922051799003)(1800799009)(451199024)(64100799003)(186009)(52116002)(6666004)(6506007)(478600001)(6486002)(6512007)(38100700002)(86362001)(36756003)(2906002)(5660300002)(7416002)(1076003)(2616005)(316002)(66946007)(8936002)(4326008)(8676002)(41300700001)(66556008)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XYgGaiObTtL4UPAdeN1i0aXzv3tVIafzXi2rCXwkVutlA6zFHx9/rIND+U3wHoxcxt0/f9glDWYgbSJX/GcMe9Hf2ex2JTpwwTx41vxhNyF9yXHh1oEG1mhdK9PPxtDS9uaMptZvlGSFz/bkp1kpW21edj9VpfLhBh8W+mqB6pbjK3pLYQc2REKrlR8qTA5Yop2CiEmicdzQEd3Q8nzaYRfLeEE74jYitKmoQcWwprwyc7A9DBH8eRDJkiV29W3oSpEWt2H0J7xV6o05MgoNvTpf1xthDIuXMzZbDif5CUHx7/n3ykLzeEdbs8sR3I6Tg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EsT42zVlhPx8Dzi4FbLhnkc5hIrQhmRFMIEyPzLWS+RZLBOqbhpzDomdkLRetCGOTJwrnM/rclgNjX0b/on39A/PnKMRllMTcFKpETR7vl0CnKXnBxlMz4UdLAxUzYM/3Rn0jptkodWxbzlM8k7ITZobbTxjz0mPmNtlmNWaLzsRUB2N+Qtz/AnhaQnruYjkLRHziWnExa/C2qWkjSHSD7Yn5JH5A7++0ArGbWZKLaSK0KNw62sSIvx62UnVgdfUNurhI+ixNz1KnxnjtomfFMPuzBhQIlBVyv X-OriginatorOrg: kunbus.com X-MS-Exchange-CrossTenant-Network-Message-Id: 89d5d62e-89e5-42f4-e789-08dbca8625cb X-MS-Exchange-CrossTenant-AuthSource: VI1P193MB0413.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2023 18:16:11.2648 (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: 6QHQnZ3xkQGqJ9KY2i66AydTU7IFvEqyVOFTM0L0EQ/cdE1taOy9IMx77tuEtG1o+LQ3XdOHPKFpPVisPMPSjA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9P193MB1497 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MIME_BASE64_TEXT,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 11 Oct 2023 11:16:53 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779484035546313432 X-GMAIL-MSGID: 1779484035546313432 If the RS485 feature RX-during-TX is supported by means of a GPIO set the according supported flag. Otherwise setting this feature from userspace may not be possible, since in uart_sanitize_serial_rs485() the passed RS485 configuration is matched against the supported features and unsupported settings are thereby removed and thus take no effect. Cc: stable@vger.kernel.org Fixes: 163f080eb717 ("serial: core: Add option to output RS485 RX_DURING_TX state via GPIO") Signed-off-by: Lino Sanfilippo --- drivers/tty/serial/serial_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index ef0500be3553..697c36dc7ec8 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -3622,6 +3622,8 @@ int uart_get_rs485_mode(struct uart_port *port) port->rs485_rx_during_tx_gpio = NULL; return dev_err_probe(dev, ret, "Cannot get rs485-rx-during-tx-gpios\n"); } + if (port->rs485_rx_during_tx_gpio) + port->rs485_supported.flags |= SER_RS485_RX_DURING_TX; return 0; }