Home
last modified time | relevance | path

Searched hist:"44 b27aec9d9680875a1a250bc8bcefc234a37c9f" (Results 1 – 2 of 2) sorted by relevance

/linux/drivers/tty/serial/8250/
H A D8250_port.cdiff 44b27aec9d9680875a1a250bc8bcefc234a37c9f Sun Jul 10 18:44:37 CEST 2022 Lino Sanfilippo <l.sanfilippo@kunbus.com> serial: core, 8250: set RS485 termination GPIO in serial core

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 it 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@kunbus.com>
Link: https://lore.kernel.org/r/20220710164442.2958979-4-LinoSanfilippo@gmx.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
/linux/drivers/tty/serial/
H A Dserial_core.cdiff 44b27aec9d9680875a1a250bc8bcefc234a37c9f Sun Jul 10 18:44:37 CEST 2022 Lino Sanfilippo <l.sanfilippo@kunbus.com> serial: core, 8250: set RS485 termination GPIO in serial core

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 it 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@kunbus.com>
Link: https://lore.kernel.org/r/20220710164442.2958979-4-LinoSanfilippo@gmx.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>