aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2008-05-14 10:30:28 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-21 21:47:46 -0400
commit57962f0b9d76487a660619f97c0aa811924274a0 (patch)
treed4696a45bcbdd52a139b3f6760a7d3995574aef6
parentbd9b448f4c0a514559bdae4ca18ca3e8cd999c6d (diff)
libertas: reduce command retry time
[PATCH, take 2] libertas: reduce command retry time In the normal case, an unsuccessful command would be retried for 10*5 seconds, or 10*10 seconds in the worst case. This patch reduces this to 3*3 seconds, or 3*10 seconds in the worst case. I also reduced the time it takes to start a new command downloaded. Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/libertas/cmd.c6
-rw-r--r--drivers/net/wireless/libertas/main.c20
2 files changed, 14 insertions, 12 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 7ccec987faaa..2d9bbcc0dd4e 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -1136,7 +1136,7 @@ static void lbs_submit_command(struct lbs_private *priv,
1136 struct cmd_header *cmd; 1136 struct cmd_header *cmd;
1137 uint16_t cmdsize; 1137 uint16_t cmdsize;
1138 uint16_t command; 1138 uint16_t command;
1139 int timeo = 5 * HZ; 1139 int timeo = 3 * HZ;
1140 int ret; 1140 int ret;
1141 1141
1142 lbs_deb_enter(LBS_DEB_HOST); 1142 lbs_deb_enter(LBS_DEB_HOST);
@@ -1154,7 +1154,7 @@ static void lbs_submit_command(struct lbs_private *priv,
1154 /* These commands take longer */ 1154 /* These commands take longer */
1155 if (command == CMD_802_11_SCAN || command == CMD_802_11_ASSOCIATE || 1155 if (command == CMD_802_11_SCAN || command == CMD_802_11_ASSOCIATE ||
1156 command == CMD_802_11_AUTHENTICATE) 1156 command == CMD_802_11_AUTHENTICATE)
1157 timeo = 10 * HZ; 1157 timeo = 5 * HZ;
1158 1158
1159 lbs_deb_cmd("DNLD_CMD: command 0x%04x, seq %d, size %d\n", 1159 lbs_deb_cmd("DNLD_CMD: command 0x%04x, seq %d, size %d\n",
1160 command, le16_to_cpu(cmd->seqnum), cmdsize); 1160 command, le16_to_cpu(cmd->seqnum), cmdsize);
@@ -1166,7 +1166,7 @@ static void lbs_submit_command(struct lbs_private *priv,
1166 lbs_pr_info("DNLD_CMD: hw_host_to_card failed: %d\n", ret); 1166 lbs_pr_info("DNLD_CMD: hw_host_to_card failed: %d\n", ret);
1167 /* Let the timer kick in and retry, and potentially reset 1167 /* Let the timer kick in and retry, and potentially reset
1168 the whole thing if the condition persists */ 1168 the whole thing if the condition persists */
1169 timeo = HZ; 1169 timeo = HZ/4;
1170 } 1170 }
1171 1171
1172 /* Setup the timer after transmit command */ 1172 /* Setup the timer after transmit command */
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 804da368416f..baafa44cfb30 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -782,9 +782,10 @@ static int lbs_thread(void *data)
782 if (priv->cmd_timed_out && priv->cur_cmd) { 782 if (priv->cmd_timed_out && priv->cur_cmd) {
783 struct cmd_ctrl_node *cmdnode = priv->cur_cmd; 783 struct cmd_ctrl_node *cmdnode = priv->cur_cmd;
784 784
785 if (++priv->nr_retries > 10) { 785 if (++priv->nr_retries > 3) {
786 lbs_pr_info("Excessive timeouts submitting command %x\n", 786 lbs_pr_info("Excessive timeouts submitting "
787 le16_to_cpu(cmdnode->cmdbuf->command)); 787 "command 0x%04x\n",
788 le16_to_cpu(cmdnode->cmdbuf->command));
788 lbs_complete_command(priv, cmdnode, -ETIMEDOUT); 789 lbs_complete_command(priv, cmdnode, -ETIMEDOUT);
789 priv->nr_retries = 0; 790 priv->nr_retries = 0;
790 if (priv->reset_card) { 791 if (priv->reset_card) {
@@ -794,8 +795,10 @@ static int lbs_thread(void *data)
794 } 795 }
795 } else { 796 } else {
796 priv->cur_cmd = NULL; 797 priv->cur_cmd = NULL;
797 lbs_pr_info("requeueing command %x due to timeout (#%d)\n", 798 lbs_pr_info("requeueing command 0x%04x due "
798 le16_to_cpu(cmdnode->cmdbuf->command), priv->nr_retries); 799 "to timeout (#%d)\n",
800 le16_to_cpu(cmdnode->cmdbuf->command),
801 priv->nr_retries);
799 802
800 /* Stick it back at the _top_ of the pending queue 803 /* Stick it back at the _top_ of the pending queue
801 for immediate resubmission */ 804 for immediate resubmission */
@@ -986,12 +989,11 @@ static void command_timer_fn(unsigned long data)
986 lbs_deb_enter(LBS_DEB_CMD); 989 lbs_deb_enter(LBS_DEB_CMD);
987 spin_lock_irqsave(&priv->driver_lock, flags); 990 spin_lock_irqsave(&priv->driver_lock, flags);
988 991
989 if (!priv->cur_cmd) { 992 if (!priv->cur_cmd)
990 lbs_pr_info("Command timer expired; no pending command\n");
991 goto out; 993 goto out;
992 }
993 994
994 lbs_pr_info("Command %x timed out\n", le16_to_cpu(priv->cur_cmd->cmdbuf->command)); 995 lbs_pr_info("command 0x%04x timed out\n",
996 le16_to_cpu(priv->cur_cmd->cmdbuf->command));
995 997
996 priv->cmd_timed_out = 1; 998 priv->cmd_timed_out = 1;
997 wake_up_interruptible(&priv->waitq); 999 wake_up_interruptible(&priv->waitq);