linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eugene Krasnikov <k.eugene.e@gmail.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org, Pontus Fuchs <pontus.fuchs@gmail.com>
Subject: [PATCH 3/9] wcn36xx: Wait longer for SMD commands to complete
Date: Wed, 12 Feb 2014 19:04:42 +0000	[thread overview]
Message-ID: <1392231888-2191-3-git-send-email-k.eugene.e@gmail.com> (raw)
In-Reply-To: <1392231888-2191-1-git-send-email-k.eugene.e@gmail.com>

From: Pontus Fuchs <pontus.fuchs@gmail.com>

On some wcnss firmwares the start command can take up to 300ms to
complete. Currently there is a 200ms timeout for SMD command to
complete which causes the start to fail.

Increase the timeout to 500ms. Also improve debug information
regarding SMD command completion time.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 7 ++++++-
 drivers/net/wireless/ath/wcn36xx/smd.h | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 425365c..ad93cc7 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -195,9 +195,11 @@ static void wcn36xx_smd_set_sta_params(struct wcn36xx *wcn,
 static int wcn36xx_smd_send_and_wait(struct wcn36xx *wcn, size_t len)
 {
 	int ret = 0;
+	unsigned long start;
 	wcn36xx_dbg_dump(WCN36XX_DBG_SMD_DUMP, "HAL >>> ", wcn->hal_buf, len);
 
 	init_completion(&wcn->hal_rsp_compl);
+	start = jiffies;
 	ret = wcn->ctrl_ops->tx(wcn->hal_buf, len);
 	if (ret) {
 		wcn36xx_err("HAL TX failed\n");
@@ -205,10 +207,13 @@ static int wcn36xx_smd_send_and_wait(struct wcn36xx *wcn, size_t len)
 	}
 	if (wait_for_completion_timeout(&wcn->hal_rsp_compl,
 		msecs_to_jiffies(HAL_MSG_TIMEOUT)) <= 0) {
-		wcn36xx_err("Timeout while waiting SMD response\n");
+		wcn36xx_err("Timeout! No SMD response in %dms\n",
+			    HAL_MSG_TIMEOUT);
 		ret = -ETIME;
 		goto out;
 	}
+	wcn36xx_dbg(WCN36XX_DBG_SMD, "SMD command completed in %dms",
+		    jiffies_to_msecs(jiffies - start));
 out:
 	return ret;
 }
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h b/drivers/net/wireless/ath/wcn36xx/smd.h
index e7c3901..c46246f 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.h
+++ b/drivers/net/wireless/ath/wcn36xx/smd.h
@@ -24,7 +24,7 @@
 
 #define WCN36XX_HAL_BUF_SIZE				4096
 
-#define HAL_MSG_TIMEOUT 200
+#define HAL_MSG_TIMEOUT 500
 #define WCN36XX_SMSM_WLAN_TX_ENABLE			0x00000400
 #define WCN36XX_SMSM_WLAN_TX_RINGS_EMPTY		0x00000200
 /* The PNO version info be contained in the rsp msg */
-- 
1.8.3.2


  parent reply	other threads:[~2014-02-12 19:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-12 19:04 [PATCH 1/9] wcn36xx: Fix copy paste error hal_exit_bmps -> hal_keep_alive Eugene Krasnikov
2014-02-12 19:04 ` [PATCH 2/9] wcn36xx: Improve feature caps exchange Eugene Krasnikov
2014-02-12 19:04 ` Eugene Krasnikov [this message]
2014-02-12 19:04 ` [PATCH 4/9] Cache nv to avoid request_firmware on resume path Eugene Krasnikov
2014-02-12 22:51   ` Kalle Valo
2014-02-13 21:10     ` Pontus Fuchs
2014-02-12 19:04 ` [PATCH 5/9] wcn36xx: Print FW capabilities Eugene Krasnikov
2014-02-12 19:04 ` [PATCH 6/9] wcn36xx: Add support for 3680 Eugene Krasnikov
2014-02-12 19:04 ` [PATCH 7/9] wcn36xx: Rename wcn36xx_vif.ucast_dpu_signature to self_ucast_dpu_sign Eugene Krasnikov
2014-02-12 19:04 ` [PATCH 8/9] wcn36xx: Track dpu signature per sta Eugene Krasnikov
2014-02-12 19:04 ` [PATCH 9/9] wcn36xx: Update dtim period before starting BSS Eugene Krasnikov

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=1392231888-2191-3-git-send-email-k.eugene.e@gmail.com \
    --to=k.eugene.e@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=pontus.fuchs@gmail.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;
as well as URLs for NNTP newsgroup(s).