From patchwork Mon Jul 31 16:32:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maya Erez X-Patchwork-Id: 9872465 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BA09760365 for ; Mon, 31 Jul 2017 16:33:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3B3628516 for ; Mon, 31 Jul 2017 16:33:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9898C28545; Mon, 31 Jul 2017 16:33:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 279BA28516 for ; Mon, 31 Jul 2017 16:33:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752586AbdGaQc7 (ORCPT ); Mon, 31 Jul 2017 12:32:59 -0400 Received: from sabertooth02.qualcomm.com ([65.197.215.38]:37826 "EHLO sabertooth02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752582AbdGaQcz (ORCPT ); Mon, 31 Jul 2017 12:32:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1501518775; x=1533054775; h=cc:from:to:subject:date:message-id:in-reply-to: references; bh=2WU30DgmUnY4K8EsamkU17JD5j2jrWXvJb46PLKtVpA=; b=i4WlfUl3UWDENoRAkPEEsOWOsEIXml8SCJWRsUjgbi9R8m3l2+vMdyBW so3LYIOi6mEX22+mgS0/Ja/lkC81B9txq20Vf5DQwuZbJ9zEhhGfdH5LO gmCDxuf1Ks1WMdgryTK8v7JPeiclsu0PdpSNRcXHL05ZPbSqcRTKUfPTe c=; X-IronPort-AV: E=Sophos;i="5.41,304,1498546800"; d="scan'208";a="112898168" Received: from unknown (HELO ironmsg02-L.qualcomm.com) ([10.53.140.109]) by sabertooth02.qualcomm.com with ESMTP; 31 Jul 2017 09:32:55 -0700 Cc: Gidon Studinski , linux-wireless@vger.kernel.org, wil6210@qca.qualcomm.com, Maya Erez X-IronPort-AV: E=McAfee;i="5900,7806,8608"; a="974365193" X-MGA-submission: =?us-ascii?q?MDEkLNwT1jS9YXfgsE6B7qkn2aRk9NstxYzGkr?= =?us-ascii?q?S1b2AdXhIyWBFXY5IWFVGlA0r/Xarn1VJlmN5GuBeN0O3p2IA3oJDQm2?= =?us-ascii?q?QteeFwUnrVCNmQprGPKjxfbBWb8rPIEX3mpJA7MF1fdIAdqGYPkYp7yL?= =?us-ascii?q?9C?= Received: from lx-merez1.mea.qualcomm.com ([10.18.173.103]) by ironmsg02-L.qualcomm.com with ESMTP; 31 Jul 2017 09:32:53 -0700 From: Maya Erez To: Kalle Valo Subject: [PATCH 10/10] wil6210: make debugfs compilation optional Date: Mon, 31 Jul 2017 19:32:33 +0300 Message-Id: <1501518753-6339-11-git-send-email-qca_merez@qca.qualcomm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501518753-6339-1-git-send-email-qca_merez@qca.qualcomm.com> References: <1501518753-6339-1-git-send-email-qca_merez@qca.qualcomm.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Gidon Studinski Since debugfs is a kernel configuration option, enable the driver to compile without debugfs. Signed-off-by: Gidon Studinski Signed-off-by: Maya Erez --- drivers/net/wireless/ath/wil6210/debugfs.c | 14 ++++++++++---- drivers/net/wireless/ath/wil6210/main.c | 1 + drivers/net/wireless/ath/wil6210/txrx.c | 6 +++--- drivers/net/wireless/ath/wil6210/wil6210.h | 2 +- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c index 97d79a9..0ef8e0c 100644 --- a/drivers/net/wireless/ath/wil6210/debugfs.c +++ b/drivers/net/wireless/ath/wil6210/debugfs.c @@ -14,6 +14,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "wil6210.h" + +#ifdef CONFIG_DEBUG_FS + #include #include #include @@ -21,7 +25,6 @@ #include #include -#include "wil6210.h" #include "wmi.h" #include "txrx.h" #include "pmc.h" @@ -30,7 +33,6 @@ static u32 mem_addr; static u32 dbg_txdesc_index; static u32 dbg_vring_index; /* 24+ for Rx, 0..23 for Tx */ -u32 vring_idle_trsh = 16; /* HW fetches up to 16 descriptors at once */ enum dbg_off_type { doff_u32 = 0, @@ -1815,6 +1817,7 @@ static void wil6210_debugfs_init_isr(struct wil6210_priv *wil, WIL_FIELD(chip_revision, 0444, doff_u8), WIL_FIELD(abft_len, 0644, doff_u8), WIL_FIELD(wakeup_trigger, 0644, doff_u8), + WIL_FIELD(vring_idle_trsh, 0644, doff_u32), {}, }; @@ -1830,8 +1833,6 @@ static void wil6210_debugfs_init_isr(struct wil6210_priv *wil, {"desc_index", 0644, (ulong)&dbg_txdesc_index, doff_u32}, {"vring_index", 0644, (ulong)&dbg_vring_index, doff_u32}, {"mem_addr", 0644, (ulong)&mem_addr, doff_u32}, - {"vring_idle_trsh", 0644, (ulong)&vring_idle_trsh, - doff_u32}, {"led_polarity", 0644, (ulong)&led_polarity, doff_u8}, {}, }; @@ -1892,3 +1893,8 @@ void wil6210_debugfs_remove(struct wil6210_priv *wil) */ wil_pmc_free(wil, false); } + +#else /* !CONFIG_DEBUG_FS */ +int wil6210_debugfs_init(struct wil6210_priv *wil) { return 0; } +void wil6210_debugfs_remove(struct wil6210_priv *wil) {} +#endif diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c index b89d017..e2ea490 100644 --- a/drivers/net/wireless/ath/wil6210/main.c +++ b/drivers/net/wireless/ath/wil6210/main.c @@ -581,6 +581,7 @@ int wil_priv_init(struct wil6210_priv *wil) WMI_WAKEUP_TRIGGER_BCAST; memset(&wil->suspend_stats, 0, sizeof(wil->suspend_stats)); wil->suspend_stats.min_suspend_time = ULONG_MAX; + wil->vring_idle_trsh = 16; return 0; diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c index ec57bcc..389c718 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.c +++ b/drivers/net/wireless/ath/wil6210/txrx.c @@ -1666,7 +1666,7 @@ static int __wil_tx_vring_tso(struct wil6210_priv *wil, struct vring *vring, /* performance monitoring */ used = wil_vring_used_tx(vring); - if (wil_val_in_range(vring_idle_trsh, + if (wil_val_in_range(wil->vring_idle_trsh, used, used + descs_used)) { txdata->idle += get_cycles() - txdata->last_idle; wil_dbg_txrx(wil, "Ring[%2d] not idle %d -> %d\n", @@ -1813,7 +1813,7 @@ static int __wil_tx_vring(struct wil6210_priv *wil, struct vring *vring, /* performance monitoring */ used = wil_vring_used_tx(vring); - if (wil_val_in_range(vring_idle_trsh, + if (wil_val_in_range(wil->vring_idle_trsh, used, used + nr_frags + 1)) { txdata->idle += get_cycles() - txdata->last_idle; wil_dbg_txrx(wil, "Ring[%2d] not idle %d -> %d\n", @@ -2175,7 +2175,7 @@ int wil_tx_complete(struct wil6210_priv *wil, int ringid) /* performance monitoring */ used_new = wil_vring_used_tx(vring); - if (wil_val_in_range(vring_idle_trsh, + if (wil_val_in_range(wil->vring_idle_trsh, used_new, used_before_complete)) { wil_dbg_txrx(wil, "Ring[%2d] idle %d -> %d\n", ringid, used_before_complete, used_new); diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h index 9ad7b11..bdfcd72 100644 --- a/drivers/net/wireless/ath/wil6210/wil6210.h +++ b/drivers/net/wireless/ath/wil6210/wil6210.h @@ -30,7 +30,6 @@ extern unsigned int mtu_max; extern unsigned short rx_ring_overflow_thrsh; extern int agg_wsize; -extern u32 vring_idle_trsh; extern bool rx_align_2; extern bool rx_large_buf; extern bool debug_fw; @@ -703,6 +702,7 @@ struct wil6210_priv { u8 vring2cid_tid[WIL6210_MAX_TX_RINGS][2]; /* [0] - CID, [1] - TID */ struct wil_sta_info sta[WIL6210_MAX_CID]; int bcast_vring; + u32 vring_idle_trsh; /* HW fetches up to 16 descriptors at once */ bool use_extended_dma_addr; /* indicates whether we are using 48 bits */ /* scan */ struct cfg80211_scan_request *scan_request;