Commit 10522881 authored by Gregory CLEMENT's avatar Gregory CLEMENT Committed by Kelsey Skunberg

tty: n_gsm: Fix SOF skipping

BugLink: https://bugs.launchpad.net/bugs/1885932

[ Upstream commit 84d6f81c ]

For at least some modems like the TELIT LE910, skipping SOF makes
transfers blocking indefinitely after a short amount of data
transferred.

Given the small improvement provided by skipping the SOF (just one
byte on about 100 bytes), it seems better to completely remove this
"feature" than make it optional.

Fixes: e1eaea46 ("tty: n_gsm line discipline")
Signed-off-by: default avatarGregory CLEMENT <gregory.clement@bootlin.com>
Link: https://lore.kernel.org/r/20200512115323.1447922-3-gregory.clement@bootlin.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
Signed-off-by: default avatarKelsey Skunberg <kelsey.skunberg@canonical.com>
parent 3f5499a7
...@@ -685,7 +685,6 @@ static void gsm_data_kick(struct gsm_mux *gsm) ...@@ -685,7 +685,6 @@ static void gsm_data_kick(struct gsm_mux *gsm)
{ {
struct gsm_msg *msg, *nmsg; struct gsm_msg *msg, *nmsg;
int len; int len;
int skip_sof = 0;
list_for_each_entry_safe(msg, nmsg, &gsm->tx_list, list) { list_for_each_entry_safe(msg, nmsg, &gsm->tx_list, list) {
if (gsm->constipated && msg->addr) if (gsm->constipated && msg->addr)
...@@ -707,15 +706,10 @@ static void gsm_data_kick(struct gsm_mux *gsm) ...@@ -707,15 +706,10 @@ static void gsm_data_kick(struct gsm_mux *gsm)
print_hex_dump_bytes("gsm_data_kick: ", print_hex_dump_bytes("gsm_data_kick: ",
DUMP_PREFIX_OFFSET, DUMP_PREFIX_OFFSET,
gsm->txframe, len); gsm->txframe, len);
if (gsm->output(gsm, gsm->txframe, len) < 0)
if (gsm->output(gsm, gsm->txframe + skip_sof,
len - skip_sof) < 0)
break; break;
/* FIXME: Can eliminate one SOF in many more cases */ /* FIXME: Can eliminate one SOF in many more cases */
gsm->tx_bytes -= msg->len; gsm->tx_bytes -= msg->len;
/* For a burst of frames skip the extra SOF within the
burst */
skip_sof = 1;
list_del(&msg->list); list_del(&msg->list);
kfree(msg); kfree(msg);
......
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