mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RESEND] dmaengine: qcom: bam_dma: Defer IRQ trigger type to device tree
@ 2026-07-17  5:00 Vishnu Santhosh
  2026-09-15 10:33 ` Vishnu Santhosh
  2026-09-15 14:06 ` Frank Li
  0 siblings, 2 replies; 4+ messages in thread
From: Vishnu Santhosh @ 2026-07-17  5:00 UTC (permalink / raw)
  To: Vinod Koul, Frank Li, Andy Gross
  Cc: linux-arm-msm, dmaengine, linux-kernel, Deepak Kumar Singh,
	Vishnu Santhosh

The driver hardcodes IRQF_TRIGGER_HIGH when registering the BAM
interrupt, which overrides the trigger type specified in the device
tree. On Qualcomm Shikra SoC, the A2 BAM signals an edge interrupt
to the apps processor; registering it as level-high causes the
interrupt to not fire, resulting in missed DMA completions.

Use IRQF_TRIGGER_NONE instead, which causes the kernel to use the
trigger type already configured by platform_get_irq() when it parsed
the device tree interrupts property. This makes the driver
platform-agnostic.

Fixes: e7c0fe2a5c84 ("dmaengine: add Qualcomm BAM dma driver")
Co-developed-by: Deepak Kumar Singh <deepak.singh@oss.qualcomm.com>
Signed-off-by: Deepak Kumar Singh <deepak.singh@oss.qualcomm.com>
Signed-off-by: Vishnu Santhosh <vishnu.santhosh@oss.qualcomm.com>
---
 drivers/dma/qcom/bam_dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c
index 19116295f8325767a0d97a7848077885b118241c..6c3e2ca8a572fd04c925de0adbd5cc0616b361ef 100644
--- a/drivers/dma/qcom/bam_dma.c
+++ b/drivers/dma/qcom/bam_dma.c
@@ -1303,7 +1303,7 @@ static int bam_dma_probe(struct platform_device *pdev)
 		bam_channel_init(bdev, &bdev->channels[i], i);
 
 	ret = devm_request_irq(bdev->dev, bdev->irq, bam_dma_irq,
-			IRQF_TRIGGER_HIGH, "bam_dma", bdev);
+			IRQF_TRIGGER_NONE, "bam_dma", bdev);
 	if (ret)
 		goto err_bam_channel_exit;
 

---
base-commit: e43ffb69e0438cddd72aaa30898b4dc446f664f8
change-id: 20260601-qcom-bam-dma-irq-trigger-0366e7e86f17

Best regards,
-- 
Vishnu Santhosh <vishnu.santhosh@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH RESEND] dmaengine: qcom: bam_dma: Defer IRQ trigger type to device tree
  2026-07-17  5:00 [PATCH RESEND] dmaengine: qcom: bam_dma: Defer IRQ trigger type to device tree Vishnu Santhosh
@ 2026-09-15 10:33 ` Vishnu Santhosh
  2026-09-15 14:06 ` Frank Li
  1 sibling, 0 replies; 4+ messages in thread
From: Vishnu Santhosh @ 2026-09-15 10:33 UTC (permalink / raw)
  To: Vinod Koul, Frank Li, Andy Gross
  Cc: linux-arm-msm, dmaengine, linux-kernel, Deepak Kumar Singh,
	bjorn.andersson, chris.lew


On 17-07-2026 10:30 am, Vishnu Santhosh wrote:
> The driver hardcodes IRQF_TRIGGER_HIGH when registering the BAM
> interrupt, which overrides the trigger type specified in the device
> tree. On Qualcomm Shikra SoC, the A2 BAM signals an edge interrupt
> to the apps processor; registering it as level-high causes the
> interrupt to not fire, resulting in missed DMA completions.
>
> Use IRQF_TRIGGER_NONE instead, which causes the kernel to use the
> trigger type already configured by platform_get_irq() when it parsed
> the device tree interrupts property. This makes the driver
> platform-agnostic.
>
> Fixes: e7c0fe2a5c84 ("dmaengine: add Qualcomm BAM dma driver")
> Co-developed-by: Deepak Kumar Singh <deepak.singh@oss.qualcomm.com>
> Signed-off-by: Deepak Kumar Singh <deepak.singh@oss.qualcomm.com>
> Signed-off-by: Vishnu Santhosh <vishnu.santhosh@oss.qualcomm.com>
> ---
>   drivers/dma/qcom/bam_dma.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c
> index 19116295f8325767a0d97a7848077885b118241c..6c3e2ca8a572fd04c925de0adbd5cc0616b361ef 100644
> --- a/drivers/dma/qcom/bam_dma.c
> +++ b/drivers/dma/qcom/bam_dma.c
> @@ -1303,7 +1303,7 @@ static int bam_dma_probe(struct platform_device *pdev)
>   		bam_channel_init(bdev, &bdev->channels[i], i);
>   
>   	ret = devm_request_irq(bdev->dev, bdev->irq, bam_dma_irq,
> -			IRQF_TRIGGER_HIGH, "bam_dma", bdev);
> +			IRQF_TRIGGER_NONE, "bam_dma", bdev);
>   	if (ret)
>   		goto err_bam_channel_exit;
>   
>
> ---
> base-commit: e43ffb69e0438cddd72aaa30898b4dc446f664f8
> change-id: 20260601-qcom-bam-dma-irq-trigger-0366e7e86f17
>
> Best regards,

Gentle ping on this patch. Could you please review it and let me know if
there are any concerns with the approach?


Thanks,
Vishnu


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH RESEND] dmaengine: qcom: bam_dma: Defer IRQ trigger type to device tree
  2026-07-17  5:00 [PATCH RESEND] dmaengine: qcom: bam_dma: Defer IRQ trigger type to device tree Vishnu Santhosh
  2026-09-15 10:33 ` Vishnu Santhosh
@ 2026-09-15 14:06 ` Frank Li
  2026-09-16 15:00   ` Vishnu Santhosh
  1 sibling, 1 reply; 4+ messages in thread
From: Frank Li @ 2026-09-15 14:06 UTC (permalink / raw)
  To: Vishnu Santhosh
  Cc: Vinod Koul, Frank Li, Andy Gross, linux-arm-msm, dmaengine,
	linux-kernel, Deepak Kumar Singh

On Fri, Jul 17, 2026 at 10:30:28AM +0530, Vishnu Santhosh wrote:
> The driver hardcodes IRQF_TRIGGER_HIGH when registering the BAM
> interrupt, which overrides the trigger type specified in the device
> tree. On Qualcomm Shikra SoC, the A2 BAM signals an edge interrupt
> to the apps processor; registering it as level-high causes the
> interrupt to not fire, resulting in missed DMA completions.
>
> Use IRQF_TRIGGER_NONE instead, which causes the kernel to use the
> trigger type already configured by platform_get_irq() when it parsed
> the device tree interrupts property. This makes the driver
> platform-agnostic.

where show this? can you point me doc or code?

Frank

>
> Fixes: e7c0fe2a5c84 ("dmaengine: add Qualcomm BAM dma driver")
> Co-developed-by: Deepak Kumar Singh <deepak.singh@oss.qualcomm.com>
> Signed-off-by: Deepak Kumar Singh <deepak.singh@oss.qualcomm.com>
> Signed-off-by: Vishnu Santhosh <vishnu.santhosh@oss.qualcomm.com>
> ---
>  drivers/dma/qcom/bam_dma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c
> index 19116295f8325767a0d97a7848077885b118241c..6c3e2ca8a572fd04c925de0adbd5cc0616b361ef 100644
> --- a/drivers/dma/qcom/bam_dma.c
> +++ b/drivers/dma/qcom/bam_dma.c
> @@ -1303,7 +1303,7 @@ static int bam_dma_probe(struct platform_device *pdev)
>  		bam_channel_init(bdev, &bdev->channels[i], i);
>
>  	ret = devm_request_irq(bdev->dev, bdev->irq, bam_dma_irq,
> -			IRQF_TRIGGER_HIGH, "bam_dma", bdev);
> +			IRQF_TRIGGER_NONE, "bam_dma", bdev);
>  	if (ret)
>  		goto err_bam_channel_exit;
>
>
> ---
> base-commit: e43ffb69e0438cddd72aaa30898b4dc446f664f8
> change-id: 20260601-qcom-bam-dma-irq-trigger-0366e7e86f17
>
> Best regards,
> --
> Vishnu Santhosh <vishnu.santhosh@oss.qualcomm.com>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH RESEND] dmaengine: qcom: bam_dma: Defer IRQ trigger type to device tree
  2026-09-15 14:06 ` Frank Li
@ 2026-09-16 15:00   ` Vishnu Santhosh
  0 siblings, 0 replies; 4+ messages in thread
From: Vishnu Santhosh @ 2026-09-16 15:00 UTC (permalink / raw)
  To: Frank Li
  Cc: Vinod Koul, Frank Li, Andy Gross, linux-arm-msm, dmaengine,
	linux-kernel, Deepak Kumar Singh


On 15-09-2026 07:36 pm, Frank Li wrote:
> On Fri, Jul 17, 2026 at 10:30:28AM +0530, Vishnu Santhosh wrote:
>> The driver hardcodes IRQF_TRIGGER_HIGH when registering the BAM
>> interrupt, which overrides the trigger type specified in the device
>> tree. On Qualcomm Shikra SoC, the A2 BAM signals an edge interrupt
>> to the apps processor; registering it as level-high causes the
>> interrupt to not fire, resulting in missed DMA completions.
>>
>> Use IRQF_TRIGGER_NONE instead, which causes the kernel to use the
>> trigger type already configured by platform_get_irq() when it parsed
>> the device tree interrupts property. This makes the driver
>> platform-agnostic.
> where show this? can you point me doc or code?
>
> Frank

Hi Frank,

The BAM driver obtains the IRQ through platform_get_irq():

bdev->irq = platform_get_irq(pdev, 0);

in https://elixir.bootlin.com/linux/v7.3-rc3/source/drivers/dma/qcom/bam_dma.c#L1270

It then registers the same IRQ with:

ret = devm_request_irq(bdev->dev, bdev->irq, bam_dma_irq,
                          IRQF_TRIGGER_HIGH, "bam_dma", bdev);

in https://elixir.bootlin.com/linux/v7.3-rc3/source/drivers/dma/qcom/bam_dma.c#L1335

The comment above IRQF_TRIGGER_NONE in include/linux/interrupt.h
states that when no trigger flag is specified, the interrupt uses the trigger type already
configured by the machine or firmware.

https://elixir.bootlin.com/linux/v7.3-rc3/source/include/linux/interrupt.h#L25

Therefore, IRQF_TRIGGER_HIGH overrides the trigger type associated with the IRQ during
DT/IRQ-domain mapping, while IRQF_TRIGGER_NONE preserves it.

The Shikra DTS which is still under review describes the BAM interrupt as edge-triggered:

interrupts = <GIC_SPI 74 IRQ_TYPE_EDGE_RISING 0>;

This driver change is needed so that the DT-specified trigger type remains effective once
the Shikra DTS change is accepted.


Thanks,
Vishnu


>
>> Fixes: e7c0fe2a5c84 ("dmaengine: add Qualcomm BAM dma driver")
>> Co-developed-by: Deepak Kumar Singh <deepak.singh@oss.qualcomm.com>
>> Signed-off-by: Deepak Kumar Singh <deepak.singh@oss.qualcomm.com>
>> Signed-off-by: Vishnu Santhosh <vishnu.santhosh@oss.qualcomm.com>
>> ---
>>   drivers/dma/qcom/bam_dma.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c
>> index 19116295f8325767a0d97a7848077885b118241c..6c3e2ca8a572fd04c925de0adbd5cc0616b361ef 100644
>> --- a/drivers/dma/qcom/bam_dma.c
>> +++ b/drivers/dma/qcom/bam_dma.c
>> @@ -1303,7 +1303,7 @@ static int bam_dma_probe(struct platform_device *pdev)
>>   		bam_channel_init(bdev, &bdev->channels[i], i);
>>
>>   	ret = devm_request_irq(bdev->dev, bdev->irq, bam_dma_irq,
>> -			IRQF_TRIGGER_HIGH, "bam_dma", bdev);
>> +			IRQF_TRIGGER_NONE, "bam_dma", bdev);
>>   	if (ret)
>>   		goto err_bam_channel_exit;
>>
>>
>> ---
>> base-commit: e43ffb69e0438cddd72aaa30898b4dc446f664f8
>> change-id: 20260601-qcom-bam-dma-irq-trigger-0366e7e86f17
>>
>> Best regards,
>> --
>> Vishnu Santhosh <vishnu.santhosh@oss.qualcomm.com>
>>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-16 15:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-17  5:00 [PATCH RESEND] dmaengine: qcom: bam_dma: Defer IRQ trigger type to device tree Vishnu Santhosh
2026-09-15 10:33 ` Vishnu Santhosh
2026-09-15 14:06 ` Frank Li
2026-09-16 15:00   ` Vishnu Santhosh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®