From patchwork Thu Dec 21 09:00:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Govind Singh X-Patchwork-Id: 10127201 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 8C949603B5 for ; Thu, 21 Dec 2017 09:03:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F3AC298EB for ; Thu, 21 Dec 2017 09:03:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7469A29B3F; Thu, 21 Dec 2017 09:03:19 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D9D78298EB for ; Thu, 21 Dec 2017 09:03:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=QOdSC0cKtJeLqZyvyvIr2fSw1+Ahk+tKaBys77Jy4oQ=; b=snbDZ6BKWtYLi3TzMrV+2H0O1P DRO1pn0MOoZ9+J9FuNP3TycNQLwOk6lieqraVKO0gwevPTOWW8AVdugjIj822jWbVwJSTDuzAuNLA +roFRUh+LQNWaxhcWYyVzgB1dp462NHRhH2TfgfQsjfzKVwNgD/XPUpgV/JBPBzsiASttGRZbbB7Y yfhlxYlAy97arVce7R7I/lWT8lukfE9CvNXnEIlF5kGRdYY8aDBmPrqvphL5GBLnUfCrygpPleVAL X9sdAigQtzVPJsQbnyTSAtSDnW5bZtSYOGTyA1qBdMwEqUUaVlfxa6dNZoGgftx1ur3HfKCEUZtt6 g1N5gFsw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eRwkv-0000AL-AP; Thu, 21 Dec 2017 09:03:09 +0000 Received: from alexa-out.qualcomm.com ([129.46.98.28]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eRwjn-0007Yd-LP for ath10k@lists.infradead.org; Thu, 21 Dec 2017 09:02:25 +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=1513846920; x=1545382920; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=QZscHIFZy7aL78WHmJokCf77VpDLQAXEgdfRpwP725A=; b=Ldd/nmLvJvSWOq2Z01118p9ppdej1Fg8d/kgo/ZyIjMANFTq2ybI9/gl IYnCldiAe45MZaWgua+QKgkwfQX0EB4HFjip8PSYudcMNfC2LhflH+53q hGER8vckh3QcIeghdbRtRXZU34QKlabe8VLoIlDlJPQ13h+AsGpERMlGp k=; Received: from ironmsg03-sd.qualcomm.com ([10.53.140.143]) by alexa-out.qualcomm.com with ESMTP/TLS/AES256-SHA; 21 Dec 2017 01:01:52 -0800 X-IronPort-AV: E=McAfee;i="5900,7806,8751"; a="10920781" X-MGA-submission: =?us-ascii?q?MDGr189Jt7NcUgTQ0kfoWqYSMQEjV2yGPL11PT?= =?us-ascii?q?AeGm26VVnb9SjVBeFaTntugt9HfAHSabzjwYvnHrKdoIQlwsvPhUjQ7K?= =?us-ascii?q?yZEqXNkMKlSadBbvc7T1BvKQjQSVZMFqjlE9Y8KnDRhuM8kKsm/uruxz?= =?us-ascii?q?V/?= Received: from govinds-linux.qualcomm.com ([10.204.116.70]) by ironmsg03-sd.qualcomm.com with ESMTP; 21 Dec 2017 01:01:49 -0800 Received: by govinds-linux.qualcomm.com (Postfix, from userid 399420) id 977F535DE; Thu, 21 Dec 2017 14:31:48 +0530 (IST) From: Govind Singh To: ath10k@lists.infradead.org Subject: [PATCH 07/10] ath10k: Add hw param for rx ring size support Date: Thu, 21 Dec 2017 14:30:56 +0530 Message-Id: <1513846859-23639-8-git-send-email-govinds@qti.qualcomm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1513846859-23639-1-git-send-email-govinds@qti.qualcomm.com> References: <1513846859-23639-1-git-send-email-govinds@qti.qualcomm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171221_010200_574851_F5CCD763 X-CRM114-Status: UNSURE ( 9.05 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Govind Singh , linux-wireless@vger.kernel.org MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP WCN3990 uses larger ring size in comparison to existing ring size value. Add rx ring size hw param for supporting different rx ring size across multiple target. Signed-off-by: Govind Singh --- drivers/net/wireless/ath/ath10k/core.c | 13 +++++++++++++ drivers/net/wireless/ath/ath10k/htt.h | 3 +++ drivers/net/wireless/ath/ath10k/htt_rx.c | 5 +---- drivers/net/wireless/ath/ath10k/hw.h | 3 +++ 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 031fe00..8374b05 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -79,6 +79,7 @@ .ast_skid_limit = 0x10, .num_wds_entries = 0x20, .target_64bit = false, + .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, }, { .id = QCA9887_HW_1_0_VERSION, @@ -107,6 +108,7 @@ .ast_skid_limit = 0x10, .num_wds_entries = 0x20, .target_64bit = false, + .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, }, { .id = QCA6174_HW_2_1_VERSION, @@ -134,6 +136,7 @@ .ast_skid_limit = 0x10, .num_wds_entries = 0x20, .target_64bit = false, + .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, }, { .id = QCA6174_HW_2_1_VERSION, @@ -161,6 +164,7 @@ .ast_skid_limit = 0x10, .num_wds_entries = 0x20, .target_64bit = false, + .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, }, { .id = QCA6174_HW_3_0_VERSION, @@ -188,6 +192,7 @@ .ast_skid_limit = 0x10, .num_wds_entries = 0x20, .target_64bit = false, + .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, }, { .id = QCA6174_HW_3_2_VERSION, @@ -218,6 +223,7 @@ .ast_skid_limit = 0x10, .num_wds_entries = 0x20, .target_64bit = false, + .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, }, { .id = QCA99X0_HW_2_0_DEV_VERSION, @@ -251,6 +257,7 @@ .ast_skid_limit = 0x10, .num_wds_entries = 0x20, .target_64bit = false, + .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, }, { .id = QCA9984_HW_1_0_DEV_VERSION, @@ -289,6 +296,7 @@ .ast_skid_limit = 0x10, .num_wds_entries = 0x20, .target_64bit = false, + .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, }, { .id = QCA9888_HW_2_0_DEV_VERSION, @@ -326,6 +334,7 @@ .ast_skid_limit = 0x10, .num_wds_entries = 0x20, .target_64bit = false, + .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, }, { .id = QCA9377_HW_1_0_DEV_VERSION, @@ -353,6 +362,7 @@ .ast_skid_limit = 0x10, .num_wds_entries = 0x20, .target_64bit = false, + .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, }, { .id = QCA9377_HW_1_1_DEV_VERSION, @@ -382,6 +392,7 @@ .ast_skid_limit = 0x10, .num_wds_entries = 0x20, .target_64bit = false, + .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, }, { .id = QCA4019_HW_1_0_DEV_VERSION, @@ -416,6 +427,7 @@ .ast_skid_limit = 0x10, .num_wds_entries = 0x20, .target_64bit = false, + .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, }, { .id = WCN3990_HW_1_0_DEV_VERSION, @@ -435,6 +447,7 @@ .ast_skid_limit = TARGET_HL_10_TLV_AST_SKID_LIMIT, .num_wds_entries = TARGET_HL_10_TLV_NUM_WDS_ENTRIES, .target_64bit = true, + .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL_DUAL_MAC, }, }; diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h index ac5d720..3a43a48 100644 --- a/drivers/net/wireless/ath/ath10k/htt.h +++ b/drivers/net/wireless/ath/ath10k/htt.h @@ -224,6 +224,9 @@ enum htt_rx_ring_flags { #define HTT_RX_RING_SIZE_MIN 128 #define HTT_RX_RING_SIZE_MAX 2048 +#define HTT_RX_RING_SIZE HTT_RX_RING_SIZE_MAX +#define HTT_RX_RING_FILL_LEVEL (((HTT_RX_RING_SIZE) / 2) - 1) +#define HTT_RX_RING_FILL_LEVEL_DUAL_MAC (HTT_RX_RING_SIZE - 1) struct htt_rx_ring_setup_ring32 { __le32 fw_idx_shadow_reg_paddr; diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 6402189..6fb6751 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -25,9 +25,6 @@ #include -#define HTT_RX_RING_SIZE HTT_RX_RING_SIZE_MAX -#define HTT_RX_RING_FILL_LEVEL (((HTT_RX_RING_SIZE) / 2) - 1) - /* when under memory pressure rx ring refill may fail and needs a retry */ #define HTT_RX_RING_REFILL_RETRY_MS 50 @@ -522,7 +519,7 @@ int ath10k_htt_rx_alloc(struct ath10k_htt *htt) */ htt->rx_ring.size = HTT_RX_RING_SIZE; htt->rx_ring.size_mask = htt->rx_ring.size - 1; - htt->rx_ring.fill_level = HTT_RX_RING_FILL_LEVEL; + htt->rx_ring.fill_level = ar->hw_params.rx_ring_fill_level; if (!is_power_of_2(htt->rx_ring.size)) { ath10k_warn(ar, "htt rx ring size is not power of 2\n"); diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h index 5d243f3..84aedaa 100644 --- a/drivers/net/wireless/ath/ath10k/hw.h +++ b/drivers/net/wireless/ath/ath10k/hw.h @@ -564,6 +564,9 @@ struct ath10k_hw_params { /* Targets supporting physical addressing capability above 32-bits */ bool target_64bit; + + /* Target rx ring fill level */ + u32 rx_ring_fill_level; }; struct htt_rx_desc;