From patchwork Mon Dec 25 11:35:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 758578 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2070.outbound.protection.outlook.com [40.107.22.70]) (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 A03DB51018; Mon, 25 Dec 2023 11:35:58 +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="GlbbuC2R" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vu5VxcvhoEY6ZxdPtfc6pAZ4zs71q+Eh7kAkaTrw1fUOyqOZd42FnUNGyaOW/LcOAFpJ3aTyXKDGMeBaTGWJpEc0MCJaN24cvhdSw7U4CiMzezLTEPaYgKsjTbUPu9gYTbrNIgp2lcNNDClY2WUatGWOpWQmWj+1dY12Jl5jGc0Ihqhnej9H4zSSIh4ZEQ//DZ7z8mIIL/5NB7NsyL5ExFsWmkJQ60vSRNhRbKIrhJtLS1RWvF5BI649YpELZkmwthTD+7b3VPX8d5EbeNDmQ+mD+AO9lNkzN6F4/BDBuJbAtbGSAuDIDnmiVAXjLBVzoYPukVSVJFzyvLnqni+fPA== 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=OncriHkcvWJWNFlfsrQo1DKSpaTIWLwBKZU4AvicFoI=; b=l3j2QJvBf5xV+7Zd9ePH8FR9Pb6CMisZRrnYiZBGMHKKzru1UuzApVBgv2i5nDpfkmVlPh+l7p3Mr1RCrYjGjA6z8Q+YU/U8behh11oYxLJPkijjRALQ/0GjEdp8h03+NXJPcrujfAlZurf/PMIxQ7GnEDnWOTO75cRyvGdcSixaTWitbTHjVf+esvfrq5QE8eV57PGakikO8skE53ykxXjO8k5bGJBpjXxkBoRuZYnw2M2y/5/96/U29DPy88/sgV9rRRdohUxz60LHDphfunRZO4epfqNuNFNjLM849Auh8plD1Y+F4Ow67MANPLQF1h25meqE8MzymCWD1mcwQQ== 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=OncriHkcvWJWNFlfsrQo1DKSpaTIWLwBKZU4AvicFoI=; b=GlbbuC2RWwAfvzJJUMSKb8FR/3AQ+i/P2s8Fxg+FgK2hVX0YTBhy1Q+53IO1OlDOhSJNkA/NuX2nO4UIfyb0P/7t/IO50RWcU/e1jdOyQikaiE8VEDvTYLZWKzCDDAO+56oKw/sfx4ivBvTTXt8brU6hQzGqrgORBJ4EvcXTqso= 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 GV1P193MB2070.EURP193.PROD.OUTLOOK.COM (2603:10a6:150:21::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.26; Mon, 25 Dec 2023 11:35:54 +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.7113.026; Mon, 25 Dec 2023 11:35:54 +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, 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 v6 2/7] serial: core: set missing supported flag for RX during TX GPIO Date: Mon, 25 Dec 2023 12:35:18 +0100 Message-ID: <20231225113524.8800-3-l.sanfilippo@kunbus.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231225113524.8800-1-l.sanfilippo@kunbus.com> References: <20231225113524.8800-1-l.sanfilippo@kunbus.com> X-ClientProxiedBy: FR5P281CA0055.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:f0::17) 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_|GV1P193MB2070:EE_ X-MS-Office365-Filtering-Correlation-Id: 614d6e6d-0513-43d4-4efe-08dc053da6a7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2mn52qyVxPD4EH/agxW3kt0BqkZR0pCag8np5JcIBalCic51J1bXkQUUlKZ10tz8csAo6qUzhqVPs6DGeOJLz6+3jJmVkbvsnjSfdYUmp4Pi8YargQBzDe2KFMcD3eKI7VRYX/0YqgTqWmrrfBtI8RHsBFZ2ocaQcmUp4NmkVpXcxmOUN3n8fwvtSSkQ1Xgji8E8wkd7YKb1wuKTDACAnXhq+cHMKzuQ9Fnqn55xXv+S6qRllAXWegzR5nfd7ymPGpc8zZNoz1QGIBzQrUy8k8IQrEOCZKKm/zlFR4iJ9vdXJRik1hhSfoh1VL1mRPn7I9nzyco/6HYKym/pRv7K3D/gaac7ZQVNs6R7aLnhEeMCbcB0pQ3Y1Ba4wyfnjkWhwN6advODx065miXGmjdNtdBLy741u9RMO7jxbZeo9aUgXXDkXfFOhQrRkf7HKHd38UH6HaRMCfzW6aaISphbEusd+ag+dVP09thILQjACG0eLaxMArMbCfzhUYlhDY7qNCy0mgAUJzuzWtCEpVoTcSJ+Hmm0uTM2Ux4Yic4LPKR0jS+lPTKnxO3aYsNjgyQj 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)(376002)(136003)(346002)(366004)(39830400003)(396003)(230922051799003)(1800799012)(64100799003)(186009)(451199024)(86362001)(1076003)(2616005)(38100700002)(41300700001)(36756003)(7416002)(5660300002)(478600001)(6486002)(2906002)(6666004)(8676002)(8936002)(66946007)(66476007)(66556008)(316002)(4326008)(6506007)(6512007)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?UADp/RCCx64wLrK9RwNSUkIOnYyQ?= =?utf-8?q?RPmVZzdHyX8SBXA1lTCfVjvHYKpokEPayrMnvahMdyE41IZgEFmml7KtrMpErNW05?= =?utf-8?q?M6afx4dN0Uk2OTAEY3cZpt/UZwB4ntW57z5LyJb9n10u7/HhvTX087I51EYBOE/mE?= =?utf-8?q?r2G6XAM4HWeuUeIq+uth/xG4xZLifH9/wz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JpN28ZYXBXro8o6eGewyXA4Qn97VnNUjXdMj?= =?utf-8?q?UkpYpGz9wrPgAXGFTJ2oJzTAAnfF1BgBvK7XbhaEVIlvHMHTN3wd33MPeo1YeVTtc?= =?utf-8?q?Sp4ELpNsNJXhAOFVI/vlsCm7LBOEV7B52prB172oFH+KSEVtfdl9kSlxSm4Al/WJ1?= =?utf-8?q?+sTApqC1bruM4KnLts3dBjJfiNIZbturGSuqei1GLZuXmmZU3orkuGGoZnfeFax7t?= =?utf-8?q?Na7OWPFV7Vwd9F4dKlqnoxeg0tHR0wsHq5Lmq9hj7RrzfUz+Z4Mx0rhL4vNesZwdm?= =?utf-8?q?I0DYb76msZWMxF5Fm77OhfyTrB+wppq7No4IAdd0o8PSMmSmWqqZezJEBSnGEMu+4?= =?utf-8?q?IxAH4PPghbKs7fMGoGY7eaJdakudvge9pSLNgq7bxj2vGRO2HQvqkAza/LCGFSA1i?= =?utf-8?q?X9zgleYfAPb4ggu9n1dtfUcKSDgQs1fSTcnXaaGoyq/LszpF4vTSTk/IfQyYB0w+a?= =?utf-8?q?BMOjs8F5DB/iLaTeIGXk3eqlnhVm9FKNznpgq/xaFmJoxF2ASHRmesHCIjaDGbiIx?= =?utf-8?q?sR5519oIII7?= X-OriginatorOrg: kunbus.com X-MS-Exchange-CrossTenant-Network-Message-Id: 614d6e6d-0513-43d4-4efe-08dc053da6a7 X-MS-Exchange-CrossTenant-AuthSource: VI1P193MB0413.EURP193.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Dec 2023 11:35:52.8185 (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: gitdj3McloKMuX9Y3machw/f5FmTRZxVhle8mk6UnCosx3MhN4ziB6YJp54uaePWHtIjrqIK5G0rLG9OLniYNw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1P193MB2070 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") Reviewed-by: Ilpo Järvinen 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 d155131f221d..1204102d7162 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -3642,6 +3642,8 @@ int uart_get_rs485_mode(struct uart_port *port) if (IS_ERR(desc)) return dev_err_probe(dev, PTR_ERR(desc), "Cannot get rs485-rx-during-tx-gpios\n"); port->rs485_rx_during_tx_gpio = desc; + if (port->rs485_rx_during_tx_gpio) + port->rs485_supported.flags |= SER_RS485_RX_DURING_TX; return 0; }