Skip to content

Commit 604308a

Browse files
Kang Yangkvalo
authored andcommitted
wifi: ath12k: add CE and ext IRQ flag to indicate irq_handler
Add 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. So if interrupt is disabled, MHI interrupt is disabled too. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Kang Yang <[email protected]> Acked-by: Jeff Johnson <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 1b66601 commit 604308a

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

drivers/net/wireless/ath/ath12k/core.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ enum ath12k_dev_flags {
199199
ATH12K_FLAG_REGISTERED,
200200
ATH12K_FLAG_QMI_FAIL,
201201
ATH12K_FLAG_HTC_SUSPEND_COMPLETE,
202+
ATH12K_FLAG_CE_IRQ_ENABLED,
203+
ATH12K_FLAG_EXT_IRQ_ENABLED,
202204
};
203205

204206
enum ath12k_monitor_flags {

drivers/net/wireless/ath/ath12k/pci.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,8 @@ static void ath12k_pci_ce_irqs_disable(struct ath12k_base *ab)
373373
{
374374
int i;
375375

376+
clear_bit(ATH12K_FLAG_CE_IRQ_ENABLED, &ab->dev_flags);
377+
376378
for (i = 0; i < ab->hw_params->ce_count; i++) {
377379
if (ath12k_ce_get_attr_flags(ab, i) & CE_ATTR_DIS_INTR)
378380
continue;
@@ -406,6 +408,10 @@ static void ath12k_pci_ce_tasklet(struct tasklet_struct *t)
406408
static irqreturn_t ath12k_pci_ce_interrupt_handler(int irq, void *arg)
407409
{
408410
struct ath12k_ce_pipe *ce_pipe = arg;
411+
struct ath12k_base *ab = ce_pipe->ab;
412+
413+
if (!test_bit(ATH12K_FLAG_CE_IRQ_ENABLED, &ab->dev_flags))
414+
return IRQ_HANDLED;
409415

410416
/* last interrupt received for this CE */
411417
ce_pipe->timestamp = jiffies;
@@ -428,6 +434,8 @@ static void __ath12k_pci_ext_irq_disable(struct ath12k_base *ab)
428434
{
429435
int i;
430436

437+
clear_bit(ATH12K_FLAG_EXT_IRQ_ENABLED, &ab->dev_flags);
438+
431439
for (i = 0; i < ATH12K_EXT_IRQ_GRP_NUM_MAX; i++) {
432440
struct ath12k_ext_irq_grp *irq_grp = &ab->ext_irq_grp[i];
433441

@@ -483,6 +491,10 @@ static int ath12k_pci_ext_grp_napi_poll(struct napi_struct *napi, int budget)
483491
static irqreturn_t ath12k_pci_ext_interrupt_handler(int irq, void *arg)
484492
{
485493
struct ath12k_ext_irq_grp *irq_grp = arg;
494+
struct ath12k_base *ab = irq_grp->ab;
495+
496+
if (!test_bit(ATH12K_FLAG_EXT_IRQ_ENABLED, &ab->dev_flags))
497+
return IRQ_HANDLED;
486498

487499
ath12k_dbg(irq_grp->ab, ATH12K_DBG_PCI, "ext irq:%d\n", irq);
488500

@@ -626,6 +638,8 @@ static void ath12k_pci_ce_irqs_enable(struct ath12k_base *ab)
626638
{
627639
int i;
628640

641+
set_bit(ATH12K_FLAG_CE_IRQ_ENABLED, &ab->dev_flags);
642+
629643
for (i = 0; i < ab->hw_params->ce_count; i++) {
630644
if (ath12k_ce_get_attr_flags(ab, i) & CE_ATTR_DIS_INTR)
631645
continue;
@@ -975,6 +989,8 @@ void ath12k_pci_ext_irq_enable(struct ath12k_base *ab)
975989
{
976990
int i;
977991

992+
set_bit(ATH12K_FLAG_EXT_IRQ_ENABLED, &ab->dev_flags);
993+
978994
for (i = 0; i < ATH12K_EXT_IRQ_GRP_NUM_MAX; i++) {
979995
struct ath12k_ext_irq_grp *irq_grp = &ab->ext_irq_grp[i];
980996

0 commit comments

Comments
 (0)