From patchwork Thu Feb 15 08:50:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Govind Singh X-Patchwork-Id: 10220703 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 C1DDA601E7 for ; Thu, 15 Feb 2018 08:52:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B24D8290B4 for ; Thu, 15 Feb 2018 08:52:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A7064290C0; Thu, 15 Feb 2018 08:52:07 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 1E755290B4 for ; Thu, 15 Feb 2018 08:52:07 +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: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:In-Reply-To: References:List-Owner; bh=7BffIDiXVkAReaLYqbSooWu3QprQG7pQ9Jy4/5kajN0=; b=Xb8 kYMMBOIapBQ/pmdizfNGi4yE0ib8pdH8n/0OQLwgOj/cuQVymOno9hnyvmuGMGEK7OPn1xlk2zyHv ltw5BGbjLzpe5m4TUE5y3Sgr8ia1PIme95CJJeGC2WzM9KrP0JP2atVBcF66kDzGbw8srD8vO0MIl dpihaeXVHkXtIe2FK3ZRCvYPz0vtMub5S7P+t4tqTL48tcyzlRU+/+lM0+C/jhhuf6tnQA9/b/Tl2 gNozoaj1sD4+pSNMDX3RqTyEHLBjauyvQO4Evya6o+yBO0WXYE2xhhB0DpocCCOOMrJV3RbwB0KmE cLUcFWyAokRDdHxOImIt/fRARSyDhhQ==; 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 1emFGo-0001ef-Uf; Thu, 15 Feb 2018 08:51:58 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1emFFQ-0008Ny-ED for ath10k@lists.infradead.org; Thu, 15 Feb 2018 08:50:46 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C220660B67; Thu, 15 Feb 2018 08:50:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1518684621; bh=rmougjp7QD5UNSRWyzI/DOBuTdHmHnfvTdDXTwl1Ir4=; h=From:To:Cc:Subject:Date:From; b=cU6QWurEt38dKVP2b94elEyQPT9AJTwkp6MtAaK8V73ZTh3QLPb/TwwaR6PuifWHy WE6UanoLayVCEe3xPz2GR/5/D81MsVHof/6ZyJgIRUjZpvYLmFvihsqJNxlV/dYUcU Lhvh2L2Y9qaGTH1g5uWZHvJsHQ71S8OQ0RML/GpY= Received: from govinds-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: govinds@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id C79E160585; Thu, 15 Feb 2018 08:50:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1518684621; bh=rmougjp7QD5UNSRWyzI/DOBuTdHmHnfvTdDXTwl1Ir4=; h=From:To:Cc:Subject:Date:From; b=cU6QWurEt38dKVP2b94elEyQPT9AJTwkp6MtAaK8V73ZTh3QLPb/TwwaR6PuifWHy WE6UanoLayVCEe3xPz2GR/5/D81MsVHof/6ZyJgIRUjZpvYLmFvihsqJNxlV/dYUcU Lhvh2L2Y9qaGTH1g5uWZHvJsHQ71S8OQ0RML/GpY= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org C79E160585 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=govinds@codeaurora.org From: Govind Singh To: ath10k@lists.infradead.org Subject: [PATCH 11/13] ath10k: Check all CE for data if irq summary is not retained Date: Thu, 15 Feb 2018 14:20:16 +0530 Message-Id: <1518684616-5871-1-git-send-email-govinds@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180215_005032_732794_B747EABF X-CRM114-Status: GOOD ( 12.22 ) 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: Rakesh Pillai , 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 From: Rakesh Pillai WCN3990 has interrupts per CE and the interrupt summary is not retained after the interrupt handler has finished execution. We need to check if we received any ce in rx and tx completion path. Generate a interrupt summary with all CE interrupts if the target does not retain interrupt summary after the execution of interrupt handler. Signed-off-by: Rakesh Pillai Signed-off-by: Govind Singh --- drivers/net/wireless/ath/ath10k/ce.h | 10 +++++++--- drivers/net/wireless/ath/ath10k/core.c | 13 +++++++++++++ drivers/net/wireless/ath/ath10k/hw.h | 3 +++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/ce.h b/drivers/net/wireless/ath/ath10k/ce.h index 06ac2eb..0e70a07 100644 --- a/drivers/net/wireless/ath/ath10k/ce.h +++ b/drivers/net/wireless/ath/ath10k/ce.h @@ -354,14 +354,18 @@ static inline u32 ath10k_ce_base_address(struct ath10k *ar, unsigned int ce_id) (((x) & CE_WRAPPER_INTERRUPT_SUMMARY_HOST_MSI_MASK) >> \ CE_WRAPPER_INTERRUPT_SUMMARY_HOST_MSI_LSB) #define CE_WRAPPER_INTERRUPT_SUMMARY_ADDRESS 0x0000 +#define CE_INTERRUPT_SUMMARY (GENMASK(CE_COUNT_MAX - 1, 0)) static inline u32 ath10k_ce_interrupt_summary(struct ath10k *ar) { struct ath10k_ce *ce = ath10k_ce_priv(ar); - return CE_WRAPPER_INTERRUPT_SUMMARY_HOST_MSI_GET( - ce->bus_ops->read32((ar), CE_WRAPPER_BASE_ADDRESS + - CE_WRAPPER_INTERRUPT_SUMMARY_ADDRESS)); + if (!ar->hw_params.per_ce_irq) + return CE_WRAPPER_INTERRUPT_SUMMARY_HOST_MSI_GET( + ce->bus_ops->read32((ar), CE_WRAPPER_BASE_ADDRESS + + CE_WRAPPER_INTERRUPT_SUMMARY_ADDRESS)); + else + return CE_INTERRUPT_SUMMARY; } #endif /* _CE_H_ */ diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index bcce875..8716ea4 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -89,6 +89,7 @@ .num_wds_entries = 0x20, .target_64bit = false, .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, + .per_ce_irq = false, }, { .id = QCA9887_HW_1_0_VERSION, @@ -118,6 +119,7 @@ .num_wds_entries = 0x20, .target_64bit = false, .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, + .per_ce_irq = false, }, { .id = QCA6174_HW_2_1_VERSION, @@ -146,6 +148,7 @@ .num_wds_entries = 0x20, .target_64bit = false, .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, + .per_ce_irq = false, }, { .id = QCA6174_HW_2_1_VERSION, @@ -174,6 +177,7 @@ .num_wds_entries = 0x20, .target_64bit = false, .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, + .per_ce_irq = false, }, { .id = QCA6174_HW_3_0_VERSION, @@ -202,6 +206,7 @@ .num_wds_entries = 0x20, .target_64bit = false, .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, + .per_ce_irq = false, }, { .id = QCA6174_HW_3_2_VERSION, @@ -233,6 +238,7 @@ .num_wds_entries = 0x20, .target_64bit = false, .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, + .per_ce_irq = false, }, { .id = QCA99X0_HW_2_0_DEV_VERSION, @@ -267,6 +273,7 @@ .num_wds_entries = 0x20, .target_64bit = false, .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, + .per_ce_irq = false, }, { .id = QCA9984_HW_1_0_DEV_VERSION, @@ -306,6 +313,7 @@ .num_wds_entries = 0x20, .target_64bit = false, .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, + .per_ce_irq = false, }, { .id = QCA9888_HW_2_0_DEV_VERSION, @@ -344,6 +352,7 @@ .num_wds_entries = 0x20, .target_64bit = false, .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, + .per_ce_irq = false, }, { .id = QCA9377_HW_1_0_DEV_VERSION, @@ -372,6 +381,7 @@ .num_wds_entries = 0x20, .target_64bit = false, .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, + .per_ce_irq = false, }, { .id = QCA9377_HW_1_1_DEV_VERSION, @@ -402,6 +412,7 @@ .num_wds_entries = 0x20, .target_64bit = false, .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, + .per_ce_irq = false, }, { .id = QCA4019_HW_1_0_DEV_VERSION, @@ -437,6 +448,7 @@ .num_wds_entries = 0x20, .target_64bit = false, .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL, + .per_ce_irq = false, }, { .id = WCN3990_HW_1_0_DEV_VERSION, @@ -457,6 +469,7 @@ .num_wds_entries = TARGET_HL_10_TLV_NUM_WDS_ENTRIES, .target_64bit = true, .rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL_DUAL_MAC, + .per_ce_irq = true, }, }; diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h index 6203bc6..e078621 100644 --- a/drivers/net/wireless/ath/ath10k/hw.h +++ b/drivers/net/wireless/ath/ath10k/hw.h @@ -567,6 +567,9 @@ struct ath10k_hw_params { /* Target rx ring fill level */ u32 rx_ring_fill_level; + + /* target supporting per ce IRQ */ + bool per_ce_irq; }; struct htt_rx_desc;