[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9271d88a-52bf-4f3a-9861-fdc5120cfc31@gmx.de>
Date: Wed, 13 Dec 2023 23:31:12 +0100
From: Lino Sanfilippo <LinoSanfilippo@....de>
To: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
Lino Sanfilippo <l.sanfilippo@...bus.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
u.kleine-koenig@...gutronix.de, shawnguo@...nel.org,
s.hauer@...gutronix.de, mcoquelin.stm32@...il.com,
alexandre.torgue@...s.st.com, cniedermaier@...electronics.com,
hugo@...ovil.com, LKML <linux-kernel@...r.kernel.org>,
linux-serial <linux-serial@...r.kernel.org>,
Lukas Wunner <lukas@...ner.de>, p.rosenberger@...bus.com,
stable@...r.kernel.org
Subject: Re: [PATCH v5 5/7] serial: core, imx: do not set RS485 enabled if it
is not supported
On 11.12.23 12:00, Ilpo Järvinen wrote:
> On Sat, 9 Dec 2023, Lino Sanfilippo wrote:
>
>> If the imx driver cannot support RS485 it sets the ports rs485_supported
>> 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" is 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 alloc.
>
Yes. BTW: Another "no_rs485" configuration setting can be found in the ar933x driver.
If we do not want to keep those assignments I can remove the one for the imx
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 supported
>> 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 <shawnguo@...nel.org>
>> Cc: Sascha Hauer <s.hauer@...gutronix.de>
>> Cc: stable@...r.kernel.org
>> Suggested-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
>> Signed-off-by: Lino Sanfilippo <l.sanfilippo@...bus.com>
>
Powered by blists - more mailing lists