Hello, On Fri, May 31, 2019 at 08:33:15AM +0300, Sergey Organov wrote: > This is still wrong, as it turns off RTS/CTS handshake in hardware on > TIOCM_RTS=0. Once again, set_mctrl() should not touch UCR2_CTSC, -- it's > as simple as that. > > I still think it's rather what I did in the patch above is the right > thing to do. It's simple and does the job, no surprises. I agree that your patch implements the behaviour you intend as the right one. I believe however that this behaviour isn't right. We agree that with handshaking disabled (i.e CRTSCTS unset) the RTS output should be set active iff TIOCM_RTS is requested. With hardware handshaking enabled the two options we disagree about are: a) RTS is not supposed to be changed, only the hardware controls the level of RTS. b) RTS should be set to inactive if !TIOCM_RTS. Otherwise the hardware controls the RTS level. An equivalent wording of b) is: RTS should be active iff both the receiver and the software request want it to be active. Sergey thinks a) is the right one, I believe in b). I think b) is sane, because with a) the kernel (or userspace) cannot stop the other side sending data (unless they disable handshaking). Documentation/serial/driver isn't clear here, we should improve that once we found an agreement (probably by other people chiming in on what they think is right). Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |