]> git.baikalelectronics.ru Git - kernel.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>
Fri, 8 Jul 2022 13:14:53 +0000 (15:14 +0200)
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: 3944c1ad4c38 ("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>
drivers/tty/n_gsm.c

index 90060018928f31a10a4ca39ab7e10a963861599f..51447ccccbab25c3a88b2271f43615a6a40928bc 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: