[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <576feae5-87f3-fbac-4349-126cf5244821@gmx.de>
Date: Mon, 4 Jul 2022 17:13:38 +0200
From: Lino Sanfilippo <LinoSanfilippo@....de>
To: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
vz@...ia.com, linux-arm-kernel@...ts.infradead.org,
devicetree@...r.kernel.org,
linux-serial <linux-serial@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Lukas Wunner <lukas@...ner.de>, p.rosenberger@...bus.com,
Lino Sanfilippo <l.sanfilippo@...bus.com>
Subject: Re: [PATCH v2 2/9] serial: core, 8250: set RS485 termination gpio in
serial core
On 04.07.22 11:51, Ilpo Järvinen wrote:
> On Sun, 3 Jul 2022, Lino Sanfilippo wrote:
>
>> From: Lino Sanfilippo <l.sanfilippo@...bus.com>
>>
>> In serial8250_em485_config() the termination GPIO is set with the uart_port
>> spinlock held. This is an issue if setting the GPIO line can sleep (e.g.
>> since the concerning GPIO expander is connected via SPI or I2C).
>>
>> Fix this by setting the termination line outside of the uart_port spinlock
>> in the serial core and using gpiod_set_value_cansleep() which instead of
>> gpiod_set_value() allows to sleep.
>>
>> Beside fixing the termination GPIO line setting for the 8250 driver this
>> change also makes setting the termination GPIO generic for all UART
>> drivers.
>>
>> Signed-off-by: Lino Sanfilippo <l.sanfilippo@...bus.com>
>> ---
>> drivers/tty/serial/8250/8250_port.c | 3 ---
>> drivers/tty/serial/serial_core.c | 12 ++++++++++++
>> 2 files changed, 12 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
>> index ed2a606f2da7..72252d956f17 100644
>> --- a/drivers/tty/serial/8250/8250_port.c
>> +++ b/drivers/tty/serial/8250/8250_port.c
>> @@ -676,9 +676,6 @@ int serial8250_em485_config(struct uart_port *port, struct ktermios *termios,
>> rs485->flags &= ~SER_RS485_RTS_AFTER_SEND;
>> }
>>
>> - gpiod_set_value(port->rs485_term_gpio,
>> - rs485->flags & SER_RS485_TERMINATE_BUS);
>> -
>
> I sent a series to make .rs485_supported per uart_port and properly set
> SER_RS485_TERMINATE_BUS according to DT config. With that series added
> first, SER_RS485_TERMINATE_BUS should also be removed from
> serial8250_em485_supported so that serial core can properly manage
> it all.
>
Ok, I will rebase the next version of my patches on your series then.
Regards,
Lino
Powered by blists - more mailing lists