Commit 59ff0680 authored by Daniel Starke's avatar Daniel Starke Committed by Greg Kroah-Hartman

tty: n_gsm: fix flow control handling in tx path

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: 0af02167 ("tty: n_gsm: fix deadlock and link starvation in outgoing data path")
Signed-off-by: default avatarDaniel Starke <daniel.starke@siemens.com>
Link: https://lore.kernel.org/r/20220707113223.3685-3-daniel.starke@siemens.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 18a948c7
...@@ -891,7 +891,7 @@ static int gsm_data_kick(struct gsm_mux *gsm) ...@@ -891,7 +891,7 @@ static int gsm_data_kick(struct gsm_mux *gsm)
/* Serialize control messages and control channel messages first */ /* Serialize control messages and control channel messages first */
list_for_each_entry_safe(msg, nmsg, &gsm->tx_ctrl_list, list) { list_for_each_entry_safe(msg, nmsg, &gsm->tx_ctrl_list, list) {
if (gsm->constipated && !gsm_is_flow_ctrl_msg(msg)) if (gsm->constipated && !gsm_is_flow_ctrl_msg(msg))
return -EAGAIN; continue;
ret = gsm_send_packet(gsm, msg); ret = gsm_send_packet(gsm, msg);
switch (ret) { switch (ret) {
case -ENOSPC: case -ENOSPC:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment