From: Dan Williams <dcbw@redhat.com>
To: Holger Schurig <hs4233@mail.mn-solutions.de>
Cc: libertas-dev@lists.infradead.org, linux-wireless@vger.kernel.org,
"John W. Linville" <linville@tuxdriver.com>
Subject: Re: [PATCH, take 2] libertas: reduce command retry time
Date: Wed, 14 May 2008 10:43:00 -0400 [thread overview]
Message-ID: <1210776180.22992.9.camel@localhost.localdomain> (raw)
In-Reply-To: <200805141630.28357.hs4233@mail.mn-solutions.de>
On Wed, 2008-05-14 at 16:30 +0200, Holger Schurig wrote:
> [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>
as long as woodhouse is fine with it, lets get it in
> ---
> With this patch, I don't have a command retry kernel log anymore in my
> devices, even after running for hours and calling "iwconfig" every
> 1.5 seconds while constantly sending out VNC updates. I bumped up the
> times from my last mail.
>
> It reduces loooooong delays if a command get's retried and you issue
> "pccardctl eject" at the same time. This command unfortunately doesn't
> set priv->surpriseremoved, which would speed up things tremendously.
>
> Index: wireless-testing/drivers/net/wireless/libertas/cmd.c
> ===================================================================
> --- wireless-testing.orig/drivers/net/wireless/libertas/cmd.c 2008-05-06 14:06:40.000000000 +0200
> +++ wireless-testing/drivers/net/wireless/libertas/cmd.c 2008-05-13 14:17:52.000000000 +0200
> @@ -1144,7 +1144,7 @@ static void lbs_submit_command(struct lb
> struct cmd_header *cmd;
> uint16_t cmdsize;
> uint16_t command;
> - int timeo = 5 * HZ;
> + int timeo = 3 * HZ;
> int ret;
>
> lbs_deb_enter(LBS_DEB_HOST);
> @@ -1162,7 +1162,7 @@ static void lbs_submit_command(struct lb
> /* These commands take longer */
> if (command == CMD_802_11_SCAN || command == CMD_802_11_ASSOCIATE ||
> command == CMD_802_11_AUTHENTICATE)
> - timeo = 10 * HZ;
> + timeo = 5 * HZ;
>
> lbs_deb_cmd("DNLD_CMD: command 0x%04x, seq %d, size %d\n",
> command, le16_to_cpu(cmd->seqnum), cmdsize);
> @@ -1174,7 +1174,7 @@ static void lbs_submit_command(struct lb
> lbs_pr_info("DNLD_CMD: hw_host_to_card failed: %d\n", ret);
> /* Let the timer kick in and retry, and potentially reset
> the whole thing if the condition persists */
> - timeo = HZ;
> + timeo = HZ/4;
> }
>
> /* Setup the timer after transmit command */
> Index: wireless-testing/drivers/net/wireless/libertas/main.c
> ===================================================================
> --- wireless-testing.orig/drivers/net/wireless/libertas/main.c 2008-05-13 14:17:44.000000000 +0200
> +++ wireless-testing/drivers/net/wireless/libertas/main.c 2008-05-13 14:19:07.000000000 +0200
> @@ -749,16 +749,19 @@ static int lbs_thread(void *data)
> if (priv->cmd_timed_out && priv->cur_cmd) {
> struct cmd_ctrl_node *cmdnode = priv->cur_cmd;
>
> - if (++priv->nr_retries > 10) {
> - lbs_pr_info("Excessive timeouts submitting command %x\n",
> - le16_to_cpu(cmdnode->cmdbuf->command));
> + if (++priv->nr_retries > 3) {
> + lbs_pr_info("excessive timeouts submitting "
> + "command 0x%04x\n",
> + le16_to_cpu(cmdnode->cmdbuf->command));
> lbs_complete_command(priv, cmdnode, -ETIMEDOUT);
> priv->nr_retries = 0;
> } else {
> priv->cur_cmd = NULL;
> priv->dnld_sent = DNLD_RES_RECEIVED;
> - lbs_pr_info("requeueing command %x due to timeout (#%d)\n",
> - le16_to_cpu(cmdnode->cmdbuf->command), priv->nr_retries);
> + lbs_pr_info("requeueing command 0x%04x due "
> + "to timeout (#%d)\n",
> + le16_to_cpu(cmdnode->cmdbuf->command),
> + priv->nr_retries);
>
> /* Stick it back at the _top_ of the pending queue
> for immediate resubmission */
> @@ -959,12 +962,11 @@ static void command_timer_fn(unsigned lo
> lbs_deb_enter(LBS_DEB_CMD);
> spin_lock_irqsave(&priv->driver_lock, flags);
>
> - if (!priv->cur_cmd) {
> - lbs_pr_info("Command timer expired; no pending command\n");
> + if (!priv->cur_cmd)
> goto out;
> - }
>
> - lbs_pr_info("Command %x timed out\n", le16_to_cpu(priv->cur_cmd->cmdbuf->command));
> + lbs_pr_info("command 0x%04x timed out\n",
> + le16_to_cpu(priv->cur_cmd->cmdbuf->command));
>
> priv->cmd_timed_out = 1;
> wake_up_interruptible(&priv->waitq);
prev parent reply other threads:[~2008-05-14 14:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-14 14:30 [PATCH, take 2] libertas: reduce command retry time Holger Schurig
2008-05-14 14:43 ` Dan Williams [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1210776180.22992.9.camel@localhost.localdomain \
--to=dcbw@redhat.com \
--cc=hs4233@mail.mn-solutions.de \
--cc=libertas-dev@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox