linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Carl Huang <cjhuang@codeaurora.org>
To: ath11k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 2/6] ath11k: add ce and ext irq flag to indicate irq_handler
Date: Tue, 22 Dec 2020 22:02:21 -0500	[thread overview]
Message-ID: <20201223030225.2345-3-cjhuang@codeaurora.org> (raw)
In-Reply-To: <20201223030225.2345-1-cjhuang@codeaurora.org>

This change adds two flags to indicate whether irq handler for CE
and dp can be called. This is because in one MSI vector case,
interrupt is not disabled in hif_stop and hif_irq_disable. Otherwise,
MHI interrupt is disabled too.

Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1

Signed-off-by: Carl Huang <cjhuang@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/core.h |  2 ++
 drivers/net/wireless/ath/ath11k/pci.c  | 13 +++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h
index 799bf3d..3dacca5 100644
--- a/drivers/net/wireless/ath/ath11k/core.h
+++ b/drivers/net/wireless/ath/ath11k/core.h
@@ -741,6 +741,8 @@ struct ath11k_base {
 
 	struct completion htc_suspend;
 
+	bool ce_irq_enabled_flag;
+	bool ext_irq_enabled_flag;
 	/* must be last */
 	u8 drv_priv[0] __aligned(sizeof(void *));
 };
diff --git a/drivers/net/wireless/ath/ath11k/pci.c b/drivers/net/wireless/ath/ath11k/pci.c
index c1ae1df..deb2d47 100644
--- a/drivers/net/wireless/ath/ath11k/pci.c
+++ b/drivers/net/wireless/ath/ath11k/pci.c
@@ -487,6 +487,8 @@ static void ath11k_pci_ce_irqs_disable(struct ath11k_base *ab)
 {
 	int i;
 
+	ab->ce_irq_enabled_flag = false;
+
 	for (i = 0; i < ab->hw_params.ce_count; i++) {
 		if (ath11k_ce_get_attr_flags(ab, i) & CE_ATTR_DIS_INTR)
 			continue;
@@ -521,6 +523,9 @@ static irqreturn_t ath11k_pci_ce_interrupt_handler(int irq, void *arg)
 {
 	struct ath11k_ce_pipe *ce_pipe = arg;
 
+	if (!ab->ce_irq_enabled_flag)
+		return IRQ_HANDLED;
+
 	ath11k_pci_ce_irq_disable(ce_pipe->ab, ce_pipe->pipe_num);
 	tasklet_schedule(&ce_pipe->intr_tq);
 
@@ -539,6 +544,8 @@ static void __ath11k_pci_ext_irq_disable(struct ath11k_base *sc)
 {
 	int i;
 
+	ab->ext_irq_enabled_flag = false;
+
 	for (i = 0; i < ATH11K_EXT_IRQ_GRP_NUM_MAX; i++) {
 		struct ath11k_ext_irq_grp *irq_grp = &sc->ext_irq_grp[i];
 
@@ -561,6 +568,8 @@ static void ath11k_pci_ext_irq_enable(struct ath11k_base *ab)
 {
 	int i;
 
+	ab->ext_irq_enabled_flag = true;
+
 	for (i = 0; i < ATH11K_EXT_IRQ_GRP_NUM_MAX; i++) {
 		struct ath11k_ext_irq_grp *irq_grp = &ab->ext_irq_grp[i];
 
@@ -613,6 +622,9 @@ static irqreturn_t ath11k_pci_ext_interrupt_handler(int irq, void *arg)
 {
 	struct ath11k_ext_irq_grp *irq_grp = arg;
 
+	if (!irq_grp->ab->ext_irq_enabled_flag)
+		return IRQ_HANDLED;
+
 	ath11k_dbg(irq_grp->ab, ATH11K_DBG_PCI, "ext irq:%d\n", irq);
 
 	ath11k_pci_ext_grp_disable(irq_grp);
@@ -1026,6 +1038,7 @@ static int ath11k_pci_start(struct ath11k_base *ab)
 	set_bit(ATH11K_PCI_FLAG_INIT_DONE, &ab_pci->flags);
 
 	ath11k_pci_aspm_restore(ab_pci);
+	ab->ce_irq_enabled_flag = true;
 
 	ath11k_pci_ce_irqs_enable(ab);
 	ath11k_ce_rx_post_buf(ab);
-- 
2.7.4


  parent reply	other threads:[~2020-12-23  3:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-23  3:02 [PATCH 0/6] ath11k: support one MSI vector Carl Huang
2020-12-23  3:02 ` [PATCH 1/6] ath11k: get msi_data again after request_irq is called Carl Huang
2020-12-23  3:02 ` Carl Huang [this message]
2020-12-23  3:02 ` [PATCH 3/6] ath11k: use ATH11K_PCI_IRQ_DP_OFFSET for dp irqx Carl Huang
2020-12-23  3:02 ` [PATCH 4/6] ath11k: refactor mulitple msi vector implementation Carl Huang
2020-12-23  3:02 ` [PATCH 5/6] ath11k: supports one MSI vector Carl Huang
2020-12-23  3:02 ` [PATCH 6/6] ath11k: do not restore ASPM in case of single " Carl Huang
2021-02-11  7:07 ` [PATCH 0/6] ath11k: support one " Kalle Valo
2021-10-22  8:04   ` Janusz Dziedzic
2021-11-15 10:43     ` Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201223030225.2345-3-cjhuang@codeaurora.org \
    --to=cjhuang@codeaurora.org \
    --cc=ath11k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).