From patchwork Wed Feb 12 19:04:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugene Krasnikov X-Patchwork-Id: 3640051 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7ACF6BF13A for ; Wed, 12 Feb 2014 19:05:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A89A720203 for ; Wed, 12 Feb 2014 19:05:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C776E20165 for ; Wed, 12 Feb 2014 19:05:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753270AbaBLTFF (ORCPT ); Wed, 12 Feb 2014 14:05:05 -0500 Received: from mail-we0-f174.google.com ([74.125.82.174]:40214 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752706AbaBLTFC (ORCPT ); Wed, 12 Feb 2014 14:05:02 -0500 Received: by mail-we0-f174.google.com with SMTP id w61so727628wes.19 for ; Wed, 12 Feb 2014 11:05:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YYQk2cHpzxeDcEK0V9JxoQFfXz+h/d7K3SfOTDXrX7s=; b=WTxV8dBYS02f6GT4nkxEhvLPSbDPlVmshAJ2ixTf7Vi9IHPpUz+dJXw6tUdhvm1oV9 t2vKOySMrq15OnuAfkYkNAkDH/Qu0J3lNlgOJ58TR1HQzAg0RjHQbvMNEylUmiELYDd6 4egCEjaXIyn0dIOHllRwaOb4LnQmNBjzZCW9wMNkyPyjUYVhijeVLdu+txx+h29yLS6V ZZY/7UYAepHC1kMfWyhJ7Rbqi0KEWg76mICM0AhSjKf1J2aG52KDRLxwuaXx5AliX0/j KbGFRa5sHCixbMU8vCePfiJEtPnXGS/7GnRxYeEbfTFKc1Qef+mE6LHk9GOtdt2WtfIt IzUA== X-Received: by 10.180.165.238 with SMTP id zb14mr3321127wib.51.1392231901420; Wed, 12 Feb 2014 11:05:01 -0800 (PST) Received: from localhost.localdomain (cpc64773-cmbg15-2-0-cust171.5-4.cable.virginmedia.com. [86.9.84.172]) by mx.google.com with ESMTPSA id fm3sm7876900wib.8.2014.02.12.11.05.00 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Feb 2014 11:05:00 -0800 (PST) From: Eugene Krasnikov To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, Pontus Fuchs Subject: [PATCH 3/9] wcn36xx: Wait longer for SMD commands to complete Date: Wed, 12 Feb 2014 19:04:42 +0000 Message-Id: <1392231888-2191-3-git-send-email-k.eugene.e@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1392231888-2191-1-git-send-email-k.eugene.e@gmail.com> References: <1392231888-2191-1-git-send-email-k.eugene.e@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Pontus Fuchs 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 --- 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 */