ASoC: fsl_sai: add IRQF_SHARED
diff mbox series

Message ID 20191128223802.18228-1-michael@walle.cc
State Accepted
Commit 2eb2d314a80eb8bb1a6faf2a74321d4497e1687d
Headers show
Series
  • ASoC: fsl_sai: add IRQF_SHARED
Related show

Commit Message

Michael Walle Nov. 28, 2019, 10:38 p.m. UTC
The LS1028A SoC uses the same interrupt line for adjacent SAIs. Use
IRQF_SHARED to be able to use these SAIs simultaneously.

Signed-off-by: Michael Walle <michael@walle.cc>
---
 sound/soc/fsl/fsl_sai.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Fabio Estevam Nov. 29, 2019, 9:57 p.m. UTC | #1
Hi Michael,

On Thu, Nov 28, 2019 at 7:38 PM Michael Walle <michael@walle.cc> wrote:
>
> The LS1028A SoC uses the same interrupt line for adjacent SAIs. Use
> IRQF_SHARED to be able to use these SAIs simultaneously.

On i.MX8M SAI5 and SAI6 share the same interrupt number too:

Reviewed-by: Fabio Estevam <festevam@gmail.com>

Thanks
Nicolin Chen Dec. 5, 2019, 2:17 a.m. UTC | #2
On Thu, Nov 28, 2019 at 11:38:02PM +0100, Michael Walle wrote:
> The LS1028A SoC uses the same interrupt line for adjacent SAIs. Use
> IRQF_SHARED to be able to use these SAIs simultaneously.
> 
> Signed-off-by: Michael Walle <michael@walle.cc>

Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>

Thanks

> ---
>  sound/soc/fsl/fsl_sai.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
> index b517e4bc1b87..8c3ea7300972 100644
> --- a/sound/soc/fsl/fsl_sai.c
> +++ b/sound/soc/fsl/fsl_sai.c
> @@ -958,7 +958,8 @@ static int fsl_sai_probe(struct platform_device *pdev)
>  	if (irq < 0)
>  		return irq;
>  
> -	ret = devm_request_irq(&pdev->dev, irq, fsl_sai_isr, 0, np->name, sai);
> +	ret = devm_request_irq(&pdev->dev, irq, fsl_sai_isr, IRQF_SHARED,
> +			       np->name, sai);
>  	if (ret) {
>  		dev_err(&pdev->dev, "failed to claim irq %u\n", irq);
>  		return ret;
> -- 
> 2.20.1
>
Daniel Baluta Dec. 5, 2019, 8:43 a.m. UTC | #3
On Fri, Nov 29, 2019 at 12:40 AM Michael Walle <michael@walle.cc> wrote:
>
> The LS1028A SoC uses the same interrupt line for adjacent SAIs. Use
> IRQF_SHARED to be able to use these SAIs simultaneously.

Hi Michael,

Thanks for the patch. We have a similar change inside our internal tree
(it is on my long TODO list to upstream :D).

We add the shared flag conditionally on a dts property.

Do you think it is a good idea to always add shared flag? I'm thinking
on SAI IP integrations where the interrupt is edge triggered.

AFAIK edge triggered interrupts do not get along very well
with sharing an interrupt line.
Michael Walle Dec. 5, 2019, 9:18 a.m. UTC | #4
Hi Daniel,

Am 2019-12-05 09:43, schrieb Daniel Baluta:
> On Fri, Nov 29, 2019 at 12:40 AM Michael Walle <michael@walle.cc> 
> wrote:
>> 
>> The LS1028A SoC uses the same interrupt line for adjacent SAIs. Use
>> IRQF_SHARED to be able to use these SAIs simultaneously.
> 
> Hi Michael,
> 
> Thanks for the patch. We have a similar change inside our internal tree
> (it is on my long TODO list to upstream :D).
> 
> We add the shared flag conditionally on a dts property.
> 
> Do you think it is a good idea to always add shared flag? I'm thinking
> on SAI IP integrations where the interrupt is edge triggered.

Mhh, I don't really get the point to make the flag conditionally. If
there is only one user, the flag won't hurt, correct?

If there are two users, we need the flag anyway.

> AFAIK edge triggered interrupts do not get along very well
> with sharing an interrupt line.

So in that case you shouldn't use shared edge triggered interrupts in 
the
SoC in the first place, I guess.

-michael
Daniel Baluta Dec. 5, 2019, 9:45 a.m. UTC | #5
On Thu, Dec 5, 2019 at 11:18 AM Michael Walle <michael@walle.cc> wrote:
>
> Hi Daniel,
>
> Am 2019-12-05 09:43, schrieb Daniel Baluta:
> > On Fri, Nov 29, 2019 at 12:40 AM Michael Walle <michael@walle.cc>
> > wrote:
> >>
> >> The LS1028A SoC uses the same interrupt line for adjacent SAIs. Use
> >> IRQF_SHARED to be able to use these SAIs simultaneously.
> >
> > Hi Michael,
> >
> > Thanks for the patch. We have a similar change inside our internal tree
> > (it is on my long TODO list to upstream :D).
> >
> > We add the shared flag conditionally on a dts property.
> >
> > Do you think it is a good idea to always add shared flag? I'm thinking
> > on SAI IP integrations where the interrupt is edge triggered.
>
> Mhh, I don't really get the point to make the flag conditionally. If
> there is only one user, the flag won't hurt, correct?
>
> If there are two users, we need the flag anyway.
>
> > AFAIK edge triggered interrupts do not get along very well
> > with sharing an interrupt line.
>
> So in that case you shouldn't use shared edge triggered interrupts in
> the
> SoC in the first place, I guess.

I think you make a good point. I was thinking that it would hurt the single
user case. But it is fine.

Thanks for the patch.

Acked-by: Daniel Baluta <daniel.baluta@nxp.com>

Patch
diff mbox series

diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index b517e4bc1b87..8c3ea7300972 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -958,7 +958,8 @@  static int fsl_sai_probe(struct platform_device *pdev)
 	if (irq < 0)
 		return irq;
 
-	ret = devm_request_irq(&pdev->dev, irq, fsl_sai_isr, 0, np->name, sai);
+	ret = devm_request_irq(&pdev->dev, irq, fsl_sai_isr, IRQF_SHARED,
+			       np->name, sai);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to claim irq %u\n", irq);
 		return ret;