Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5624946rdb; Wed, 13 Dec 2023 14:31:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IGzKcK/Cx3wiCZ1q9OKK9WPho0/Su7ob1dICdhPMnofRDgBZmCBcymM4Jm9VB0bmTyD1V2M X-Received: by 2002:a9d:7750:0:b0:6d9:ce56:bfb3 with SMTP id t16-20020a9d7750000000b006d9ce56bfb3mr8972927otl.49.1702506715867; Wed, 13 Dec 2023 14:31:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702506715; cv=none; d=google.com; s=arc-20160816; b=ZgRasuWn+hHDTreec9MCce4r8XXn7kZznDQQ7ajruiznv3v5+InTYQZkB+nA+CRgsu V6JQP7FxkjJib0M8j7WBj6T9qgs//SRQ7SB1iGKgFh6481EFIWrF5+VDu3FitSCNVV8B erg/IeSQ4G6QRtRNwojJSrZfupsVOPBz70KxL6Ar6MWcthYcr59GXMgPK7Q7e++bka/3 SAy2/WVtvOcacejGnuEJsFkjsx1lLB42UUri5OBmQGr2PIIXG4oJ1IBWqOPPM1MKHNZZ j7E2gXH2lCPiXwDg+tzQLw8ZlYsuzNMnjtglxrm0GWBjCkpFpuHGa83WrAc0XCU+02dM vgxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=ow0eNzFaApvdODhCrkxtlTs1mvPnhPOnKfYtDQtRAOA=; fh=SkD674BMIGfh2qToS4d/FKmfYwG/SWT/z5iPh3MCh2M=; b=f8CTXWbQZXkP0NLdoTu0H8724HFVBSpiMEZc/o788OEvYU2WudGYG8FVXUM0hYwVoA dg2QlIk+0F6GeIx+2pujTgdiSFW/7Viyfups3FSoA6bmjy6RAgX30AayhX9hEjAZ8l0I xQEY0IS6pEMwClAMH6ZsghOeeQiuPlkpGoEu7jIIsSnoMbf5Wodp/t6vY7rtUadBQ+HQ lgNFu9oAMThn7Edsgx6DTKiyx2oRejrEO7nsgKDm4/9WDzCHYNfF7a2fNn2NnqWqlpk9 JsPIWR31h7LlhhEaLChSbR6rtebUCMrOEhfxu4vJOv76C+Yu75lnqyntFezDe0EldnFk P2oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=d1lIymFg; 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=gmx.de Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id o12-20020a63e34c000000b005c67da710ddsi10021418pgj.782.2023.12.13.14.31.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 14:31:55 -0800 (PST) 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=@gmx.de header.s=s31663417 header.b=d1lIymFg; 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=gmx.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2DB6880C8D51; Wed, 13 Dec 2023 14:31:54 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442797AbjLMWbo (ORCPT + 99 others); Wed, 13 Dec 2023 17:31:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229687AbjLMWbn (ORCPT ); Wed, 13 Dec 2023 17:31:43 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73A55E0; Wed, 13 Dec 2023 14:31:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1702506675; x=1703111475; i=linosanfilippo@gmx.de; bh=ow0eNzFaApvdODhCrkxtlTs1mvPnhPOnKfYtDQtRAOA=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From: In-Reply-To; b=d1lIymFgQfvd+w/akJljGu/fADS93WUpG59uB+U7JTuTp2OfaGDDkf7pspYNQb7I 2e/XkALu/n1UhgfByTVV3b3vndKQWwYWgoqNrgcNzI0yd1sLkllq1QGvZhQaVl9cs fTdwL0ciVvLS0Yvc2ksOPtDaxnM/CzkU2XnLY877cUiCxNHF/OYc+UWT/zRH8e+jA 0L2C2c6Td1lZT58V7XKE/uWcpbjOnvidbjH7Y2BfGdzpf/yM6Ltjk0GfcD02vQxBv Cu9+Pdsd5vIol2vht9vUQWHwRgdGMDIeQ9oacgh8k/xuofdH9ZddjlLsct8SJiccl 5tDGPHLL8VLYhsnvHw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.2.42] ([84.180.3.177]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MFsYx-1qyvxV42kp-00HNfS; Wed, 13 Dec 2023 23:31:15 +0100 Message-ID: <9271d88a-52bf-4f3a-9861-fdc5120cfc31@gmx.de> Date: Wed, 13 Dec 2023 23:31:12 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 5/7] serial: core, imx: do not set RS485 enabled if it is not supported Content-Language: en-US To: =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , Lino Sanfilippo Cc: Greg Kroah-Hartman , Jiri Slaby , 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, LKML , linux-serial , Lukas Wunner , p.rosenberger@kunbus.com, stable@vger.kernel.org References: <20231209125836.16294-1-l.sanfilippo@kunbus.com> <20231209125836.16294-6-l.sanfilippo@kunbus.com> From: Lino Sanfilippo In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:5rOHkfsE4s9ePvnGDmyusjLIj3yIVd2eQPWYbqRlq5CGud6gVIn X+I9FPjinXMngbO+6bp8A9/EsEzNaJgNXMwbsS9yvNxF1tRc7PF4xuthVI8ibtPw5QJn+77 8EdcfCgDO33pq970SCvijgy82MPA4afZMI33IogmjzNdEIiTeRu92iCYNINYQWb9ficQTRh OCpIUYGrGXqh/fEJgtY8A== UI-OutboundReport: notjunk:1;M01:P0:Bj+lj047/H8=;lrv2zARKxJtcHPybrCx9es6QyxT hVCkvcK3YZbhRR46EF4MBDeYo9szoAvZXOEygZSsw+lXizouvA88I2L+xJUlQH+xMZWyYzLxE ZmKx5qFadWtc7A15irJATZV50FyyQw68xcLC3AY32whbSBy58mTfiVQA41UX6lyV6boTd2Ux7 86YIh1LzlvEWzCHUnnPH5T2TT6bQjrgYAPtoF2vTdXHBqwImoy4Xbw/Xt7prCjPoWGFDZmyJ+ WQVW6w9ga6LGWRhs8Tj7cif3uknR19sc8FzJjOA34jS0jaR0U1CvXy45AI8iCouzGhAcZuSPS YxrQNa18mL8ZAt04dnZd1MJDb58JRbho32JJcQ8hMGkBixYXfZ/xP6iO7zIjjt/rDZgfOhOGz kgwr3jkyRwS3MpmDDZBBC4aeS4c3XX5pljozWaG6q1r/UFPHqb9JXPNQPJO3EZOm/23ouSYgZ R4htMtvVqUPA4K55z2KOm1n4x2+jj3xianSdeMMPV+BgAsXdifo4nn1+7VbHyRHoW1PhgozyB MFDFryJ7eWR1uFtmtBydegDy8RL/l1G4+4nNWzyydxZBAJ8eVeyXtvuzDJRyUEpX6h1JwvCrN RRDnv0nhoImVL4MgUurQ4ZeqDDCob6+pBJeSjxz1XVi+20H36p+Qpaz4VjW2S5IUV4bBp/gMe WVjcmJRagp0ZfGJ4QCHpjXy3Zm8OVOeyzvoShT4XTmWWTljADocWW608UK1quEoS37IO/Ja3+ 7Mx3YcTS0AfCZM5jFtuKUfkW5ouSrJ+0q1yBCQGx/4yILSfK8YTMY7ihLlooTqWasKg/tzn46 REuH+FVQDTJE8yHpDIeqq+KpKUKhIYBNloHVzEkl9daB7cN0Dot9vcoWTfN0xu4iAIYnRn6kl PTE+syDMKPjqOlLwZjnlKIrNO/aIi50incblaOAOW6Bf5oi2JtFL6QG1gUYONev3T+JSuFJ1w yzWURA== X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: 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, 13 Dec 2023 14:31:54 -0800 (PST) On 11.12.23 12:00, Ilpo J=C3=A4rvinen wrote: > On Sat, 9 Dec 2023, Lino Sanfilippo wrote: > >> If the imx driver cannot support RS485 it sets the ports rs485_supporte= d >> structure to NULL. > > No, an embedded struct inside struct uart_port cannot be set to NULL, > it's always there. > Hmm, ok. What I meant was that the structure is nullified. "set to NULL" i= s maybe a bit misleading. I will correct this. > Looking into the code, that setting of rs485_supported from imx_no_rs485 > is actually superfluous as it should be already cleared to zeros on allo= c. > Yes. BTW: Another "no_rs485" configuration setting can be found in the ar9= 33x driver. If we do not want to keep those assignments I can remove the one for the i= mx driver with the next version of this patch... >> But it still calls uart_get_rs485_mode() which may set >> the RS485_ENABLED flag nevertheless. >> >> This may lead to an attempt to configure RS485 even if it is not suppor= ted >> when the flag is evaluated in uart_configure_port() at port startup. >> >> Avoid this by bailing out of uart_get_rs485_mode() if the RS485_ENABLED >> flag is not supported by the caller. >> >> With this fix a check for RTS availability is now obsolete in the imx >> driver, since it can not evaluate to true any more. Remove this check, = too. >> >> Fixes: 00d7a00e2a6f ("serial: imx: Fill in rs485_supported") >> Cc: Shawn Guo >> Cc: Sascha Hauer >> Cc: stable@vger.kernel.org >> Suggested-by: Uwe Kleine-K=C3=B6nig >> Signed-off-by: Lino Sanfilippo >