Commit 10e03a43 authored by samix.lebsir's avatar samix.lebsir Committed by Greg Kroah-Hartman

char: n_gsm: remove message filtering for contipated DLCI

commit 10c6c383 upstream.

The design of uplink flow control in the mux driver is
that for constipated channels data will backup into the
per-channel fifos, and any messages that make it to the
outbound message queue will still go out.
Code was added to also stop messages that were in the outbound
queue but this requires filtering through all the messages on the
queue for stopped dlcis and changes some of the mux logic unneccessarily.

The message fiiltering was removed to be in line w/ the original design
as the message filtering does not provide any solution.
Extra debug messages used during investigation were also removed.
Signed-off-by: default avatarsamix.lebsir <samix.lebsir@intel.com>
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
Cc: Rui Xiang <rui.xiang@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 28bae9a8
...@@ -691,10 +691,6 @@ static void gsm_data_kick(struct gsm_mux *gsm) ...@@ -691,10 +691,6 @@ static void gsm_data_kick(struct gsm_mux *gsm)
msg = msg->next; msg = msg->next;
continue; continue;
} }
if (gsm->dlci[msg->addr]->constipated) {
msg = msg->next;
continue;
}
if (gsm->encoding != 0) { if (gsm->encoding != 0) {
gsm->txframe[0] = GSM1_SOF; gsm->txframe[0] = GSM1_SOF;
len = gsm_stuff_frame(msg->data, len = gsm_stuff_frame(msg->data,
...@@ -748,8 +744,6 @@ static void __gsm_data_queue(struct gsm_dlci *dlci, struct gsm_msg *msg) ...@@ -748,8 +744,6 @@ static void __gsm_data_queue(struct gsm_dlci *dlci, struct gsm_msg *msg)
u8 *dp = msg->data; u8 *dp = msg->data;
u8 *fcs = dp + msg->len; u8 *fcs = dp + msg->len;
WARN_ONCE(dlci->constipated, "%s: queueing from a constipated DLCI",
__func__);
/* Fill in the header */ /* Fill in the header */
if (gsm->encoding == 0) { if (gsm->encoding == 0) {
if (msg->len < 128) if (msg->len < 128)
...@@ -959,9 +953,6 @@ static void gsm_dlci_data_sweep(struct gsm_mux *gsm) ...@@ -959,9 +953,6 @@ static void gsm_dlci_data_sweep(struct gsm_mux *gsm)
break; break;
dlci = gsm->dlci[i]; dlci = gsm->dlci[i];
if (dlci == NULL || dlci->constipated) { if (dlci == NULL || dlci->constipated) {
if (dlci && (debug & 0x20))
pr_info("%s: DLCI %d is constipated",
__func__, i);
i++; i++;
continue; continue;
} }
...@@ -991,12 +982,8 @@ static void gsm_dlci_data_kick(struct gsm_dlci *dlci) ...@@ -991,12 +982,8 @@ static void gsm_dlci_data_kick(struct gsm_dlci *dlci)
unsigned long flags; unsigned long flags;
int sweep; int sweep;
if (dlci->constipated) { if (dlci->constipated)
if (debug & 0x20)
pr_info("%s: DLCI %d is constipated",
__func__, dlci->addr);
return; return;
}
spin_lock_irqsave(&dlci->gsm->tx_lock, flags); spin_lock_irqsave(&dlci->gsm->tx_lock, flags);
/* If we have nothing running then we need to fire up */ /* If we have nothing running then we need to fire up */
...@@ -1072,15 +1059,9 @@ static void gsm_process_modem(struct tty_struct *tty, struct gsm_dlci *dlci, ...@@ -1072,15 +1059,9 @@ static void gsm_process_modem(struct tty_struct *tty, struct gsm_dlci *dlci,
/* Flow control/ready to communicate */ /* Flow control/ready to communicate */
fc = (modem & MDM_FC) || !(modem & MDM_RTR); fc = (modem & MDM_FC) || !(modem & MDM_RTR);
if (fc && !dlci->constipated) { if (fc && !dlci->constipated) {
if (debug & 0x20)
pr_info("%s: DLCI %d START constipated (tx_bytes=%d)",
__func__, dlci->addr, dlci->gsm->tx_bytes);
/* Need to throttle our output on this device */ /* Need to throttle our output on this device */
dlci->constipated = 1; dlci->constipated = 1;
} else if (!fc && dlci->constipated) { } else if (!fc && dlci->constipated) {
if (debug & 0x20)
pr_info("%s: DLCI %d END constipated (tx_bytes=%d)",
__func__, dlci->addr, dlci->gsm->tx_bytes);
dlci->constipated = 0; dlci->constipated = 0;
gsm_dlci_data_kick(dlci); gsm_dlci_data_kick(dlci);
} }
...@@ -1257,8 +1238,6 @@ static void gsm_control_message(struct gsm_mux *gsm, unsigned int command, ...@@ -1257,8 +1238,6 @@ static void gsm_control_message(struct gsm_mux *gsm, unsigned int command,
break; break;
case CMD_FCON: case CMD_FCON:
/* Modem can accept data again */ /* Modem can accept data again */
if (debug & 0x20)
pr_info("%s: GSM END constipation", __func__);
gsm->constipated = 0; gsm->constipated = 0;
gsm_control_reply(gsm, CMD_FCON, NULL, 0); gsm_control_reply(gsm, CMD_FCON, NULL, 0);
/* Kick the link in case it is idling */ /* Kick the link in case it is idling */
...@@ -1268,8 +1247,6 @@ static void gsm_control_message(struct gsm_mux *gsm, unsigned int command, ...@@ -1268,8 +1247,6 @@ static void gsm_control_message(struct gsm_mux *gsm, unsigned int command,
break; break;
case CMD_FCOFF: case CMD_FCOFF:
/* Modem wants us to STFU */ /* Modem wants us to STFU */
if (debug & 0x20)
pr_info("%s: GSM START constipation", __func__);
gsm->constipated = 1; gsm->constipated = 1;
gsm_control_reply(gsm, CMD_FCOFF, NULL, 0); gsm_control_reply(gsm, CMD_FCOFF, NULL, 0);
break; break;
......
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