From: daniel.starke@xxxxxxxxxxx <daniel.starke@xxxxxxxxxxx> commit c19d93542a6081577e6da9bf5e887979c72e80c1 upstream. tty flow control is handled via gsmtty_throttle() and gsmtty_unthrottle(). Both functions propagate the outgoing hardware flow control state to the remote side via MSC (modem status command) frames. The local state is taken from the RTS (ready to send) flag of the tty. However, RTS gets mapped to DTR (data terminal ready), which is wrong. This patch corrects this by mapping RTS to RTS. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Daniel Starke <daniel.starke@xxxxxxxxxxx> Link: https://lore.kernel.org/r/20220218073123.2121-5-daniel.starke@xxxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/tty/n_gsm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -3178,9 +3178,9 @@ static void gsmtty_throttle(struct tty_s if (dlci->state == DLCI_CLOSED) return; if (C_CRTSCTS(tty)) - dlci->modem_tx &= ~TIOCM_DTR; + dlci->modem_tx &= ~TIOCM_RTS; dlci->throttled = true; - /* Send an MSC with DTR cleared */ + /* Send an MSC with RTS cleared */ gsmtty_modem_update(dlci, 0); } @@ -3190,9 +3190,9 @@ static void gsmtty_unthrottle(struct tty if (dlci->state == DLCI_CLOSED) return; if (C_CRTSCTS(tty)) - dlci->modem_tx |= TIOCM_DTR; + dlci->modem_tx |= TIOCM_RTS; dlci->throttled = false; - /* Send an MSC with DTR set */ + /* Send an MSC with RTS set */ gsmtty_modem_update(dlci, 0); } Patches currently in stable-queue which might be from daniel.starke@xxxxxxxxxxx are queue-5.10/tty-n_gsm-fix-encoding-of-control-signal-octet-bit-dv.patch queue-5.10/tty-n_gsm-fix-null-pointer-access-due-to-dlci-release.patch queue-5.10/tty-n_gsm-fix-proper-link-termination-after-failed-open.patch queue-5.10/tty-n_gsm-fix-wrong-tty-control-line-for-flow-control.patch queue-5.10/tty-n_gsm-fix-deadlock-in-gsmtty_open.patch