* [PATCH v3] wifi: ath12k: convert tasklet to BH workqueue for CE interrupts
@ 2024-10-22 7:24 Raj Kumar Bhagat
2024-10-23 17:14 ` Jeff Johnson
2024-10-25 19:25 ` Jeff Johnson
0 siblings, 2 replies; 4+ messages in thread
From: Raj Kumar Bhagat @ 2024-10-22 7:24 UTC (permalink / raw)
To: ath12k; +Cc: linux-wireless, Raj Kumar Bhagat
Currently in Ath12k, tasklet is used to handle the BH context of CE
interrupts. However the tasklet is marked deprecated and has some
design flaws. To replace tasklets, BH workqueue support has been
added. BH workqueue behaves similarly to regular workqueues except
that the queued work items are executed in the BH context.
Hence, convert the tasklet to BH workqueue for handling CE interrupts
in the BH context.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00214-QCAHKSWPL_SILICONZ-1
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
---
v3:
- Removing this patch and sending it seperately from the series:
"wifi: ath12k: add Ath12k AHB driver support for IPQ5332"
v2: https://patchwork.kernel.org/project/linux-wireless/patch/20241015182637.955753-17-quic_rajkbhag@quicinc.com/
- No change
---
drivers/net/wireless/ath/ath12k/ce.h | 2 +-
drivers/net/wireless/ath/ath12k/pci.c | 14 +++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/ce.h b/drivers/net/wireless/ath/ath12k/ce.h
index 857bc5f9e946..1a14b9fb86b8 100644
--- a/drivers/net/wireless/ath/ath12k/ce.h
+++ b/drivers/net/wireless/ath/ath12k/ce.h
@@ -148,7 +148,7 @@ struct ath12k_ce_pipe {
void (*send_cb)(struct ath12k_ce_pipe *pipe);
void (*recv_cb)(struct ath12k_base *ab, struct sk_buff *skb);
- struct tasklet_struct intr_tq;
+ struct work_struct intr_wq;
struct ath12k_ce_ring *src_ring;
struct ath12k_ce_ring *dest_ring;
struct ath12k_ce_ring *status_ring;
diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c
index fd47394553b8..cf907550e6a4 100644
--- a/drivers/net/wireless/ath/ath12k/pci.c
+++ b/drivers/net/wireless/ath/ath12k/pci.c
@@ -427,9 +427,9 @@ static void ath12k_pci_sync_ce_irqs(struct ath12k_base *ab)
}
}
-static void ath12k_pci_ce_tasklet(struct tasklet_struct *t)
+static void ath12k_pci_ce_workqueue(struct work_struct *work)
{
- struct ath12k_ce_pipe *ce_pipe = from_tasklet(ce_pipe, t, intr_tq);
+ struct ath12k_ce_pipe *ce_pipe = from_work(ce_pipe, work, intr_wq);
int irq_idx = ATH12K_PCI_IRQ_CE0_OFFSET + ce_pipe->pipe_num;
ath12k_ce_per_engine_service(ce_pipe->ab, ce_pipe->pipe_num);
@@ -451,7 +451,7 @@ static irqreturn_t ath12k_pci_ce_interrupt_handler(int irq, void *arg)
disable_irq_nosync(ab->irq_num[irq_idx]);
- tasklet_schedule(&ce_pipe->intr_tq);
+ queue_work(system_bh_wq, &ce_pipe->intr_wq);
return IRQ_HANDLED;
}
@@ -677,7 +677,7 @@ static int ath12k_pci_config_irq(struct ath12k_base *ab)
irq_idx = ATH12K_PCI_IRQ_CE0_OFFSET + i;
- tasklet_setup(&ce_pipe->intr_tq, ath12k_pci_ce_tasklet);
+ INIT_WORK(&ce_pipe->intr_wq, ath12k_pci_ce_workqueue);
ret = request_irq(irq, ath12k_pci_ce_interrupt_handler,
ab_pci->irq_flags, irq_name[irq_idx],
@@ -964,7 +964,7 @@ static void ath12k_pci_aspm_restore(struct ath12k_pci *ab_pci)
PCI_EXP_LNKCTL_ASPMC);
}
-static void ath12k_pci_kill_tasklets(struct ath12k_base *ab)
+static void ath12k_pci_cancel_workqueue(struct ath12k_base *ab)
{
int i;
@@ -974,7 +974,7 @@ static void ath12k_pci_kill_tasklets(struct ath12k_base *ab)
if (ath12k_ce_get_attr_flags(ab, i) & CE_ATTR_DIS_INTR)
continue;
- tasklet_kill(&ce_pipe->intr_tq);
+ cancel_work_sync(&ce_pipe->intr_wq);
}
}
@@ -982,7 +982,7 @@ static void ath12k_pci_ce_irq_disable_sync(struct ath12k_base *ab)
{
ath12k_pci_ce_irqs_disable(ab);
ath12k_pci_sync_ce_irqs(ab);
- ath12k_pci_kill_tasklets(ab);
+ ath12k_pci_cancel_workqueue(ab);
}
int ath12k_pci_map_service_to_pipe(struct ath12k_base *ab, u16 service_id,
base-commit: fa934bf3e0a825ee09f035c6580af513187d59a2
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v3] wifi: ath12k: convert tasklet to BH workqueue for CE interrupts
2024-10-22 7:24 [PATCH v3] wifi: ath12k: convert tasklet to BH workqueue for CE interrupts Raj Kumar Bhagat
@ 2024-10-23 17:14 ` Jeff Johnson
2024-10-24 9:48 ` Kalle Valo
2024-10-25 19:25 ` Jeff Johnson
1 sibling, 1 reply; 4+ messages in thread
From: Jeff Johnson @ 2024-10-23 17:14 UTC (permalink / raw)
To: Raj Kumar Bhagat, ath12k; +Cc: linux-wireless
On 10/22/2024 12:24 AM, Raj Kumar Bhagat wrote:
> Currently in Ath12k, tasklet is used to handle the BH context of CE
> interrupts. However the tasklet is marked deprecated and has some
> design flaws. To replace tasklets, BH workqueue support has been
> added. BH workqueue behaves similarly to regular workqueues except
> that the queued work items are executed in the BH context.
>
> Hence, convert the tasklet to BH workqueue for handling CE interrupts
> in the BH context.
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00214-QCAHKSWPL_SILICONZ-1
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
(Not sure how to stress-test this, but it does survive multiple rmmod/insmod
with a Youtube video stream running)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3] wifi: ath12k: convert tasklet to BH workqueue for CE interrupts
2024-10-23 17:14 ` Jeff Johnson
@ 2024-10-24 9:48 ` Kalle Valo
0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2024-10-24 9:48 UTC (permalink / raw)
To: Jeff Johnson; +Cc: Raj Kumar Bhagat, ath12k, linux-wireless
Jeff Johnson <quic_jjohnson@quicinc.com> writes:
> On 10/22/2024 12:24 AM, Raj Kumar Bhagat wrote:
>> Currently in Ath12k, tasklet is used to handle the BH context of CE
>> interrupts. However the tasklet is marked deprecated and has some
>> design flaws. To replace tasklets, BH workqueue support has been
>> added. BH workqueue behaves similarly to regular workqueues except
>> that the queued work items are executed in the BH context.
>>
>> Hence, convert the tasklet to BH workqueue for handling CE interrupts
>> in the BH context.
>>
>> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00214-QCAHKSWPL_SILICONZ-1
>> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
>
> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
>
> (Not sure how to stress-test this, but it does survive multiple rmmod/insmod
> with a Youtube video stream running)
Raj, did you notice any changes in throughput?
Passes my tests as well:
Acked-by: Kalle Valo <kvalo@kernel.org>
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3] wifi: ath12k: convert tasklet to BH workqueue for CE interrupts
2024-10-22 7:24 [PATCH v3] wifi: ath12k: convert tasklet to BH workqueue for CE interrupts Raj Kumar Bhagat
2024-10-23 17:14 ` Jeff Johnson
@ 2024-10-25 19:25 ` Jeff Johnson
1 sibling, 0 replies; 4+ messages in thread
From: Jeff Johnson @ 2024-10-25 19:25 UTC (permalink / raw)
To: ath12k, Raj Kumar Bhagat; +Cc: linux-wireless
On Tue, 22 Oct 2024 12:54:06 +0530, Raj Kumar Bhagat wrote:
> Currently in Ath12k, tasklet is used to handle the BH context of CE
> interrupts. However the tasklet is marked deprecated and has some
> design flaws. To replace tasklets, BH workqueue support has been
> added. BH workqueue behaves similarly to regular workqueues except
> that the queued work items are executed in the BH context.
>
> Hence, convert the tasklet to BH workqueue for handling CE interrupts
> in the BH context.
>
> [...]
Applied, thanks!
[1/1] wifi: ath12k: convert tasklet to BH workqueue for CE interrupts
commit: cdad737160571a98cc4933a62c9f2728e965ab27
Best regards,
--
Jeff Johnson <quic_jjohnson@quicinc.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-10-25 19:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-22 7:24 [PATCH v3] wifi: ath12k: convert tasklet to BH workqueue for CE interrupts Raj Kumar Bhagat
2024-10-23 17:14 ` Jeff Johnson
2024-10-24 9:48 ` Kalle Valo
2024-10-25 19:25 ` Jeff Johnson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox