aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorsamix.lebsir <samix.lebsir@intel.com>2012-08-13 08:44:22 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-16 15:03:30 -0400
commit10c6c383e43565c9c6ec07ff8eb2825f8091bdf0 (patch)
tree23b06a40b458bec745b0e9de6f005f69eee8c9e6 /drivers/tty
parentc01af4fec2c8f303d6b3354d44308d9e6bef8026 (diff)
char: n_gsm: remove message filtering for contipated DLCI
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: samix.lebsir <samix.lebsir@intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Cc: Dressage <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/n_gsm.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index db15b562a29e..5f68f2a70c5c 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -691,10 +691,6 @@ static void gsm_data_kick(struct gsm_mux *gsm)
691 msg = msg->next; 691 msg = msg->next;
692 continue; 692 continue;
693 } 693 }
694 if (gsm->dlci[msg->addr]->constipated) {
695 msg = msg->next;
696 continue;
697 }
698 if (gsm->encoding != 0) { 694 if (gsm->encoding != 0) {
699 gsm->txframe[0] = GSM1_SOF; 695 gsm->txframe[0] = GSM1_SOF;
700 len = gsm_stuff_frame(msg->data, 696 len = gsm_stuff_frame(msg->data,
@@ -748,8 +744,6 @@ static void __gsm_data_queue(struct gsm_dlci *dlci, struct gsm_msg *msg)
748 u8 *dp = msg->data; 744 u8 *dp = msg->data;
749 u8 *fcs = dp + msg->len; 745 u8 *fcs = dp + msg->len;
750 746
751 WARN_ONCE(dlci->constipated, "%s: queueing from a constipated DLCI",
752 __func__);
753 /* Fill in the header */ 747 /* Fill in the header */
754 if (gsm->encoding == 0) { 748 if (gsm->encoding == 0) {
755 if (msg->len < 128) 749 if (msg->len < 128)
@@ -956,9 +950,6 @@ static void gsm_dlci_data_sweep(struct gsm_mux *gsm)
956 break; 950 break;
957 dlci = gsm->dlci[i]; 951 dlci = gsm->dlci[i];
958 if (dlci == NULL || dlci->constipated) { 952 if (dlci == NULL || dlci->constipated) {
959 if (dlci && (debug & 0x20))
960 pr_info("%s: DLCI %d is constipated",
961 __func__, i);
962 i++; 953 i++;
963 continue; 954 continue;
964 } 955 }
@@ -988,12 +979,8 @@ static void gsm_dlci_data_kick(struct gsm_dlci *dlci)
988 unsigned long flags; 979 unsigned long flags;
989 int sweep; 980 int sweep;
990 981
991 if (dlci->constipated) { 982 if (dlci->constipated)
992 if (debug & 0x20)
993 pr_info("%s: DLCI %d is constipated",
994 __func__, dlci->addr);
995 return; 983 return;
996 }
997 984
998 spin_lock_irqsave(&dlci->gsm->tx_lock, flags); 985 spin_lock_irqsave(&dlci->gsm->tx_lock, flags);
999 /* If we have nothing running then we need to fire up */ 986 /* If we have nothing running then we need to fire up */
@@ -1069,15 +1056,9 @@ static void gsm_process_modem(struct tty_struct *tty, struct gsm_dlci *dlci,
1069 /* Flow control/ready to communicate */ 1056 /* Flow control/ready to communicate */
1070 fc = (modem & MDM_FC) || !(modem & MDM_RTR); 1057 fc = (modem & MDM_FC) || !(modem & MDM_RTR);
1071 if (fc && !dlci->constipated) { 1058 if (fc && !dlci->constipated) {
1072 if (debug & 0x20)
1073 pr_info("%s: DLCI %d START constipated (tx_bytes=%d)",
1074 __func__, dlci->addr, dlci->gsm->tx_bytes);
1075 /* Need to throttle our output on this device */ 1059 /* Need to throttle our output on this device */
1076 dlci->constipated = 1; 1060 dlci->constipated = 1;
1077 } else if (!fc && dlci->constipated) { 1061 } else if (!fc && dlci->constipated) {
1078 if (debug & 0x20)
1079 pr_info("%s: DLCI %d END constipated (tx_bytes=%d)",
1080 __func__, dlci->addr, dlci->gsm->tx_bytes);
1081 dlci->constipated = 0; 1062 dlci->constipated = 0;
1082 gsm_dlci_data_kick(dlci); 1063 gsm_dlci_data_kick(dlci);
1083 } 1064 }
@@ -1241,8 +1222,6 @@ static void gsm_control_message(struct gsm_mux *gsm, unsigned int command,
1241 break; 1222 break;
1242 case CMD_FCON: 1223 case CMD_FCON:
1243 /* Modem can accept data again */ 1224 /* Modem can accept data again */
1244 if (debug & 0x20)
1245 pr_info("%s: GSM END constipation", __func__);
1246 gsm->constipated = 0; 1225 gsm->constipated = 0;
1247 gsm_control_reply(gsm, CMD_FCON, NULL, 0); 1226 gsm_control_reply(gsm, CMD_FCON, NULL, 0);
1248 /* Kick the link in case it is idling */ 1227 /* Kick the link in case it is idling */
@@ -1250,8 +1229,6 @@ static void gsm_control_message(struct gsm_mux *gsm, unsigned int command,
1250 break; 1229 break;
1251 case CMD_FCOFF: 1230 case CMD_FCOFF:
1252 /* Modem wants us to STFU */ 1231 /* Modem wants us to STFU */
1253 if (debug & 0x20)
1254 pr_info("%s: GSM START constipation", __func__);
1255 gsm->constipated = 1; 1232 gsm->constipated = 1;
1256 gsm_control_reply(gsm, CMD_FCOFF, NULL, 0); 1233 gsm_control_reply(gsm, CMD_FCOFF, NULL, 0);
1257 break; 1234 break;