diff mbox series

[2/5] hwtracing: hisi_ptt: Handle the interrupt in hardirq context

Message ID 20230809081825.11518-3-yangyicong@huawei.com (mailing list archive)
State Superseded
Headers show
Series Several updates for PTT driver | expand

Commit Message

Yicong Yang Aug. 9, 2023, 8:18 a.m. UTC
From: Yicong Yang <yangyicong@hisilicon.com>

Handle the trace interrupt in the hardirq context, make sure the irq
core won't threaded it by declaring IRQF_NO_THREAD and userspace won't
balance it by declaring IRQF_NOBALANCING. Otherwise we may violate the
synchronization requirements of the perf core, referenced to the
change of arm-ccn PMU commit 0811ef7e2f54 ("bus: arm-ccn: fix PMU interrupt flags").

In the interrupt handler we mainly doing 2 things:
- Copy the data from the local DMA buffer to the AUX buffer
- Commit the data in the AUX buffer

Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
---
 drivers/hwtracing/ptt/hisi_ptt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jonathan Cameron Aug. 25, 2023, 11:24 a.m. UTC | #1
On Wed, 9 Aug 2023 16:18:22 +0800
Yicong Yang <yangyicong@huawei.com> wrote:

> From: Yicong Yang <yangyicong@hisilicon.com>
> 
> Handle the trace interrupt in the hardirq context, make sure the irq
> core won't threaded it by declaring IRQF_NO_THREAD and userspace won't
> balance it by declaring IRQF_NOBALANCING. Otherwise we may violate the
> synchronization requirements of the perf core, referenced to the
> change of arm-ccn PMU commit 0811ef7e2f54 ("bus: arm-ccn: fix PMU interrupt flags").
> 
> In the interrupt handler we mainly doing 2 things:
> - Copy the data from the local DMA buffer to the AUX buffer
> - Commit the data in the AUX buffer
> 
> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>

Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  drivers/hwtracing/ptt/hisi_ptt.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/hwtracing/ptt/hisi_ptt.c b/drivers/hwtracing/ptt/hisi_ptt.c
> index 5f0a8e653ae8..89638ed96cf9 100644
> --- a/drivers/hwtracing/ptt/hisi_ptt.c
> +++ b/drivers/hwtracing/ptt/hisi_ptt.c
> @@ -346,9 +346,9 @@ static int hisi_ptt_register_irq(struct hisi_ptt *hisi_ptt)
>  		return ret;
>  
>  	hisi_ptt->trace_irq = pci_irq_vector(pdev, HISI_PTT_TRACE_DMA_IRQ);
> -	ret = devm_request_threaded_irq(&pdev->dev, hisi_ptt->trace_irq,
> -					NULL, hisi_ptt_isr, 0,
> -					DRV_NAME, hisi_ptt);
> +	ret = devm_request_irq(&pdev->dev, hisi_ptt->trace_irq, hisi_ptt_isr,
> +				IRQF_NOBALANCING | IRQF_NO_THREAD, DRV_NAME,
> +				hisi_ptt);
>  	if (ret) {
>  		pci_err(pdev, "failed to request irq %d, ret = %d\n",
>  			hisi_ptt->trace_irq, ret);
diff mbox series

Patch

diff --git a/drivers/hwtracing/ptt/hisi_ptt.c b/drivers/hwtracing/ptt/hisi_ptt.c
index 5f0a8e653ae8..89638ed96cf9 100644
--- a/drivers/hwtracing/ptt/hisi_ptt.c
+++ b/drivers/hwtracing/ptt/hisi_ptt.c
@@ -346,9 +346,9 @@  static int hisi_ptt_register_irq(struct hisi_ptt *hisi_ptt)
 		return ret;
 
 	hisi_ptt->trace_irq = pci_irq_vector(pdev, HISI_PTT_TRACE_DMA_IRQ);
-	ret = devm_request_threaded_irq(&pdev->dev, hisi_ptt->trace_irq,
-					NULL, hisi_ptt_isr, 0,
-					DRV_NAME, hisi_ptt);
+	ret = devm_request_irq(&pdev->dev, hisi_ptt->trace_irq, hisi_ptt_isr,
+				IRQF_NOBALANCING | IRQF_NO_THREAD, DRV_NAME,
+				hisi_ptt);
 	if (ret) {
 		pci_err(pdev, "failed to request irq %d, ret = %d\n",
 			hisi_ptt->trace_irq, ret);