[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ffdaf03b-65af-731f-992-3e90ca6fca@linux.intel.com>
Date: Mon, 11 Dec 2023 13:00:22 +0200 (EET)
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: 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>,
LinoSanfilippo@....de, 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 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.
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.
> 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>
--
i.
Powered by blists - more mailing lists