2024-04-18 13:58:34

by Konstantin Pugin

[permalink] [raw]
Subject: [PATCH v2 1/3] serial: sc16is7xx: announce support of SER_RS485_RTS_ON_SEND

From: Konstantin Pugin <[email protected]>

Hardware supports both modes, but after
commit 4afeced55baa ("serial: core: fix sanitizing check for RTS settings")
we always end up with SER_RS485_RTS_AFTER_SEND and always write in
register SC16IS7XX_EFCR_RTS_INVERT_BIT,
which breaks some hardware using these chips,

Fixes: 267913ecf737 ("serial: sc16is7xx: Fill in rs485_supported")
Signed-off-by: Konstantin Pugin <[email protected]>
---
drivers/tty/serial/sc16is7xx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index 929206a9a6e1..a300eebf1401 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -1458,7 +1458,7 @@ static int sc16is7xx_setup_mctrl_ports(struct sc16is7xx_port *s,
}

static const struct serial_rs485 sc16is7xx_rs485_supported = {
- .flags = SER_RS485_ENABLED | SER_RS485_RTS_AFTER_SEND,
+ .flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | SER_RS485_RTS_AFTER_SEND,
.delay_rts_before_send = 1,
.delay_rts_after_send = 1, /* Not supported but keep returning -EINVAL */
};
--
2.34.1



2024-04-18 14:13:00

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v2 1/3] serial: sc16is7xx: announce support of SER_RS485_RTS_ON_SEND

On Thu, Apr 18, 2024 at 04:57:32PM +0300, Konstantin Pugin wrote:
> From: Konstantin Pugin <[email protected]>
>
> Hardware supports both modes, but after

The hardware

"both"? Please elaborate, like

"The hardware supports both (A and B) modes, ..."

> commit 4afeced55baa ("serial: core: fix sanitizing check for RTS settings")

the commit

> we always end up with SER_RS485_RTS_AFTER_SEND and always write in

write to

> register SC16IS7XX_EFCR_RTS_INVERT_BIT,

the register

> which breaks some hardware using these chips,

Please, rewrap these lines to be approximately same width. Yes, you may split
commit over the lines in the body of the commit message, but tags (like Fixes).

Also it seems you forgot to add Vladimir's tags. It's your responsibility
to do that if you send a new version with only cosmetic changes done.

--
With Best Regards,
Andy Shevchenko