]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
tty: n_gsm: fix flow control handling in tx path
authorDaniel Starke <daniel.starke@siemens.com>
Thu, 7 Jul 2022 11:32:22 +0000 (13:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:42:04 +0000 (14:42 +0200)
[ Upstream commit 59ff0680ecbfec742b1e0381e7cc46b41eb06647 ]

The current implementation constipates all transmission paths during flow
control except for flow control frames. However, these may not be located
at the beginning of the transmission queue of the control channel.
Ensure that flow control frames in the transmission queue for the control
channel are always handled even if constipated by skipping through other
messages.

Fixes: 0af021678d5d ("tty: n_gsm: fix deadlock and link starvation in outgoing data path")
Signed-off-by: Daniel Starke <daniel.starke@siemens.com>
Link: https://lore.kernel.org/r/20220707113223.3685-3-daniel.starke@siemens.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/n_gsm.c

index 8b8c7312935f6df87e6bcc53a3ced4179c160268..7749de4f269a10e9269f947bdc46beaafe21e987 100644 (file)
@@ -891,7 +891,7 @@ static int gsm_data_kick(struct gsm_mux *gsm)
        /* Serialize control messages and control channel messages first */
        list_for_each_entry_safe(msg, nmsg, &gsm->tx_ctrl_list, list) {
                if (gsm->constipated && !gsm_is_flow_ctrl_msg(msg))
-                       return -EAGAIN;
+                       continue;
                ret = gsm_send_packet(gsm, msg);
                switch (ret) {
                case -ENOSPC: