From patchwork Thu Sep 24 14:24:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: c_mkenna@qti.qualcomm.com X-Patchwork-Id: 7257021 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3CBAA9F30C for ; Thu, 24 Sep 2015 14:25:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 67156208D6 for ; Thu, 24 Sep 2015 14:25:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 85C9C208C9 for ; Thu, 24 Sep 2015 14:25:05 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zf7S9-00065A-Px; Thu, 24 Sep 2015 14:24:53 +0000 Received: from sabertooth02.qualcomm.com ([65.197.215.38]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zf7S7-0005ts-Gi for ath10k@lists.infradead.org; Thu, 24 Sep 2015 14:24:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1443104691; x=1474640691; h=from:to:cc:subject:date:message-id:mime-version; bh=tXEKtuadg4DQH0ysaGWBnimkCsyNGZG96s2Pm+CqsV8=; b=u/YIBZagW52bmd8OIeTPsdFxkOT6rqoHcVPi6SzLc0SrShWiCCGKt/Wh hVln9+EnLeAsX3T9FY5KwqR59kX2cqK67YLnrzjdk+JxV48oMJf1q9pTA XO5iddyokFcQlV1+WpYiedeW70Wy+Bz/CbuDCbSwD8vxkRMWFyHYpjG8S 0=; X-IronPort-AV: E=McAfee;i="5700,7163,7933"; a="98483474" Received: from ironmsg03-r.qualcomm.com ([172.30.46.17]) by sabertooth02.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 24 Sep 2015 07:24:28 -0700 X-IronPort-AV: E=Sophos; i="5.17,581,1437462000"; d="scan'208"; a="1007022157" Received: from nasanexm02a.na.qualcomm.com ([10.85.0.41]) by Ironmsg03-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 24 Sep 2015 07:24:28 -0700 Received: from aphydexm01b.ap.qualcomm.com (10.252.127.11) by nasanexm02a.na.qualcomm.com (10.85.0.41) with Microsoft SMTP Server (TLS) id 15.0.1076.9; Thu, 24 Sep 2015 07:24:25 -0700 Received: from localhost (10.80.80.8) by aphydexm01b.ap.qualcomm.com (10.252.127.11) with Microsoft SMTP Server (TLS) id 15.0.1076.9; Thu, 24 Sep 2015 19:54:18 +0530 From: To: Subject: [PATCH] ath10k: Increase pci wakeup timeout to 30 ms Date: Thu, 24 Sep 2015 19:54:00 +0530 Message-ID: <1443104640-13965-1-git-send-email-c_mkenna@qti.qualcomm.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01C.na.qualcomm.com (10.85.0.83) To aphydexm01b.ap.qualcomm.com (10.252.127.11) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150924_072451_656674_788DDCC1 X-CRM114-Status: GOOD ( 11.24 ) X-Spam-Score: -7.0 (-------) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, Maharaja Kennadyrajan Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable 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: Maharaja Kennadyrajan It is noticed that pci wakeup time is exceeding current timeout (10ms) randomly which is tested on QCA988x. So, the wake up time is increased to 30 ms and added debug prints to log total timeout. Signed-off-by: Maharaja Kennadyrajan --- drivers/net/wireless/ath/ath10k/pci.c | 6 +++++- drivers/net/wireless/ath/ath10k/pci.h | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 1046ab6..2df1692 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -452,8 +452,12 @@ static int ath10k_pci_wake_wait(struct ath10k *ar) int curr_delay = 5; while (tot_delay < PCIE_WAKE_TIMEOUT) { - if (ath10k_pci_is_awake(ar)) + if (ath10k_pci_is_awake(ar)) { + if (tot_delay > PCIE_WAKE_LATE_US) + ath10k_warn(ar, "device wakeup took %d ms which is unusally long, otherwise it works normally.\n", + tot_delay / 1000); return 0; + } udelay(curr_delay); tot_delay += curr_delay; diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h index 8d364fb..54af2d7 100644 --- a/drivers/net/wireless/ath/ath10k/pci.h +++ b/drivers/net/wireless/ath/ath10k/pci.h @@ -230,7 +230,8 @@ static inline struct ath10k_pci *ath10k_pci_priv(struct ath10k *ar) #define ATH10K_PCI_RX_POST_RETRY_MS 50 #define ATH_PCI_RESET_WAIT_MAX 10 /* ms */ -#define PCIE_WAKE_TIMEOUT 10000 /* 10ms */ +#define PCIE_WAKE_TIMEOUT 30000 /* 30ms */ +#define PCIE_WAKE_LATE_US 10000 /* 10ms */ #define BAR_NUM 0