* [PATCH v2 2/3] dmaengine: mediatek: mtk-hsdma: Use platform_get_irq() to get the interrupt
2022-01-04 16:35 [PATCH v2 0/3] dmaengine: Use platform_get_irq*() variants to fetch IRQ's Lad Prabhakar
@ 2022-01-04 16:35 ` Lad Prabhakar
2022-01-06 5:27 ` Vinod Koul
2022-01-04 16:35 ` [PATCH v2 3/3] dmaengine: mediatek-cqdma: " Lad Prabhakar
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Lad Prabhakar @ 2022-01-04 16:35 UTC (permalink / raw)
To: Sean Wang, Vinod Koul, Matthias Brugger
Cc: Rob Herring, Andy Shevchenko, Prabhakar, Lad Prabhakar,
dmaengine, linux-arm-kernel, linux-mediatek, linux-kernel
platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
allocation of IRQ resources in DT core code, this causes an issue
when using hierarchical interrupt domains using "interrupts" property
in the node as this bypasses the hierarchical setup and messes up the
irq chaining.
In preparation for removal of static setup of IRQ resource from DT core
code use platform_get_irq().
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
v1->v2
* No change
---
drivers/dma/mediatek/mtk-hsdma.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/dma/mediatek/mtk-hsdma.c b/drivers/dma/mediatek/mtk-hsdma.c
index 6ad8afbb95f2..c0fffde7fe08 100644
--- a/drivers/dma/mediatek/mtk-hsdma.c
+++ b/drivers/dma/mediatek/mtk-hsdma.c
@@ -923,13 +923,10 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
return PTR_ERR(hsdma->clk);
}
- res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
- if (!res) {
- dev_err(&pdev->dev, "No irq resource for %s\n",
- dev_name(&pdev->dev));
- return -EINVAL;
- }
- hsdma->irq = res->start;
+ err = platform_get_irq(pdev, 0);
+ if (err < 0)
+ return err;
+ hsdma->irq = err;
refcount_set(&hsdma->pc_refcnt, 0);
spin_lock_init(&hsdma->lock);
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/3] dmaengine: mediatek: mtk-hsdma: Use platform_get_irq() to get the interrupt
2022-01-04 16:35 ` [PATCH v2 2/3] dmaengine: mediatek: mtk-hsdma: Use platform_get_irq() to get the interrupt Lad Prabhakar
@ 2022-01-06 5:27 ` Vinod Koul
2022-01-06 8:44 ` Lad, Prabhakar
0 siblings, 1 reply; 8+ messages in thread
From: Vinod Koul @ 2022-01-06 5:27 UTC (permalink / raw)
To: Lad Prabhakar
Cc: Sean Wang, Matthias Brugger, Rob Herring, Andy Shevchenko,
Prabhakar, dmaengine, linux-arm-kernel, linux-mediatek,
linux-kernel
On 04-01-22, 16:35, Lad Prabhakar wrote:
> platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
> allocation of IRQ resources in DT core code, this causes an issue
> when using hierarchical interrupt domains using "interrupts" property
> in the node as this bypasses the hierarchical setup and messes up the
> irq chaining.
>
> In preparation for removal of static setup of IRQ resource from DT core
> code use platform_get_irq().
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> ---
> v1->v2
> * No change
> ---
> drivers/dma/mediatek/mtk-hsdma.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/dma/mediatek/mtk-hsdma.c b/drivers/dma/mediatek/mtk-hsdma.c
> index 6ad8afbb95f2..c0fffde7fe08 100644
> --- a/drivers/dma/mediatek/mtk-hsdma.c
> +++ b/drivers/dma/mediatek/mtk-hsdma.c
> @@ -923,13 +923,10 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
> return PTR_ERR(hsdma->clk);
> }
>
> - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> - if (!res) {
> - dev_err(&pdev->dev, "No irq resource for %s\n",
> - dev_name(&pdev->dev));
> - return -EINVAL;
> - }
> - hsdma->irq = res->start;
> + err = platform_get_irq(pdev, 0);
why not platform_get_irq_optional() here and 3rd patch ?
> + if (err < 0)
> + return err;
> + hsdma->irq = err;
>
> refcount_set(&hsdma->pc_refcnt, 0);
> spin_lock_init(&hsdma->lock);
> --
> 2.17.1
--
~Vinod
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/3] dmaengine: mediatek: mtk-hsdma: Use platform_get_irq() to get the interrupt
2022-01-06 5:27 ` Vinod Koul
@ 2022-01-06 8:44 ` Lad, Prabhakar
0 siblings, 0 replies; 8+ messages in thread
From: Lad, Prabhakar @ 2022-01-06 8:44 UTC (permalink / raw)
To: Vinod Koul
Cc: Lad Prabhakar, Sean Wang, Matthias Brugger, Rob Herring,
Andy Shevchenko, dmaengine, LAK,
moderated list:ARM/Mediatek SoC support, LKML
Hi Vinod,
Thank you for the review.
On Thu, Jan 6, 2022 at 5:27 AM Vinod Koul <vkoul@kernel.org> wrote:
>
> On 04-01-22, 16:35, Lad Prabhakar wrote:
> > platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
> > allocation of IRQ resources in DT core code, this causes an issue
> > when using hierarchical interrupt domains using "interrupts" property
> > in the node as this bypasses the hierarchical setup and messes up the
> > irq chaining.
> >
> > In preparation for removal of static setup of IRQ resource from DT core
> > code use platform_get_irq().
> >
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> > ---
> > v1->v2
> > * No change
> > ---
> > drivers/dma/mediatek/mtk-hsdma.c | 11 ++++-------
> > 1 file changed, 4 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/dma/mediatek/mtk-hsdma.c b/drivers/dma/mediatek/mtk-hsdma.c
> > index 6ad8afbb95f2..c0fffde7fe08 100644
> > --- a/drivers/dma/mediatek/mtk-hsdma.c
> > +++ b/drivers/dma/mediatek/mtk-hsdma.c
> > @@ -923,13 +923,10 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
> > return PTR_ERR(hsdma->clk);
> > }
> >
> > - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> > - if (!res) {
> > - dev_err(&pdev->dev, "No irq resource for %s\n",
> > - dev_name(&pdev->dev));
> > - return -EINVAL;
> > - }
> > - hsdma->irq = res->start;
> > + err = platform_get_irq(pdev, 0);
>
> why not platform_get_irq_optional() here and 3rd patch ?
>
For patches #2 and #3 the driver expects the IRQ to be present
strictly, that is the reason platform_get_irq_optional() isn't used so
that the behavior of the driver is unchanged with this patch.
Cheers,
Prabhakar
> > + if (err < 0)
> > + return err;
> > + hsdma->irq = err;
> >
> > refcount_set(&hsdma->pc_refcnt, 0);
> > spin_lock_init(&hsdma->lock);
> > --
> > 2.17.1
>
> --
> ~Vinod
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 3/3] dmaengine: mediatek-cqdma: Use platform_get_irq() to get the interrupt
2022-01-04 16:35 [PATCH v2 0/3] dmaengine: Use platform_get_irq*() variants to fetch IRQ's Lad Prabhakar
2022-01-04 16:35 ` [PATCH v2 2/3] dmaengine: mediatek: mtk-hsdma: Use platform_get_irq() to get the interrupt Lad Prabhakar
@ 2022-01-04 16:35 ` Lad Prabhakar
2022-01-05 9:56 ` [PATCH v2 0/3] dmaengine: Use platform_get_irq*() variants to fetch IRQ's Andy Shevchenko
2022-03-09 11:37 ` Lad, Prabhakar
3 siblings, 0 replies; 8+ messages in thread
From: Lad Prabhakar @ 2022-01-04 16:35 UTC (permalink / raw)
To: Sean Wang, Vinod Koul, Matthias Brugger
Cc: Rob Herring, Andy Shevchenko, Prabhakar, Lad Prabhakar,
dmaengine, linux-arm-kernel, linux-mediatek, linux-kernel
platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static
allocation of IRQ resources in DT core code, this causes an issue
when using hierarchical interrupt domains using "interrupts" property
in the node as this bypasses the hierarchical setup and messes up the
irq chaining.
In preparation for removal of static setup of IRQ resource from DT core
code use platform_get_irq().
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
v1->v2
* No change
---
drivers/dma/mediatek/mtk-cqdma.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/dma/mediatek/mtk-cqdma.c b/drivers/dma/mediatek/mtk-cqdma.c
index 41ef9f15d3d5..f8847c48ba03 100644
--- a/drivers/dma/mediatek/mtk-cqdma.c
+++ b/drivers/dma/mediatek/mtk-cqdma.c
@@ -751,7 +751,6 @@ static int mtk_cqdma_probe(struct platform_device *pdev)
struct mtk_cqdma_device *cqdma;
struct mtk_cqdma_vchan *vc;
struct dma_device *dd;
- struct resource *res;
int err;
u32 i;
@@ -824,13 +823,10 @@ static int mtk_cqdma_probe(struct platform_device *pdev)
return PTR_ERR(cqdma->pc[i]->base);
/* allocate IRQ resource */
- res = platform_get_resource(pdev, IORESOURCE_IRQ, i);
- if (!res) {
- dev_err(&pdev->dev, "No irq resource for %s\n",
- dev_name(&pdev->dev));
- return -EINVAL;
- }
- cqdma->pc[i]->irq = res->start;
+ err = platform_get_irq(pdev, i);
+ if (err < 0)
+ return err;
+ cqdma->pc[i]->irq = err;
err = devm_request_irq(&pdev->dev, cqdma->pc[i]->irq,
mtk_cqdma_irq, 0, dev_name(&pdev->dev),
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 0/3] dmaengine: Use platform_get_irq*() variants to fetch IRQ's
2022-01-04 16:35 [PATCH v2 0/3] dmaengine: Use platform_get_irq*() variants to fetch IRQ's Lad Prabhakar
2022-01-04 16:35 ` [PATCH v2 2/3] dmaengine: mediatek: mtk-hsdma: Use platform_get_irq() to get the interrupt Lad Prabhakar
2022-01-04 16:35 ` [PATCH v2 3/3] dmaengine: mediatek-cqdma: " Lad Prabhakar
@ 2022-01-05 9:56 ` Andy Shevchenko
2022-03-09 11:37 ` Lad, Prabhakar
3 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2022-01-05 9:56 UTC (permalink / raw)
To: Lad Prabhakar
Cc: Matthias Brugger, Rob Herring, Prabhakar, linux-arm Mailing List,
moderated list:ARM/Mediatek SoC support
On Tue, Jan 4, 2022 at 6:35 PM Lad Prabhakar
<prabhakar.mahadev-lad.rj@bp.renesas.com> wrote:
>
> Hi All,
>
> This patch series aims to drop using platform_get_resource() for IRQ types
> in preparation for removal of static setup of IRQ resource from DT core
> code.
>
> Dropping usage of platform_get_resource() was agreed based on
> the discussion [0].
All three looks good to me, FWIW,
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> [0] https://patchwork.kernel.org/project/linux-renesas-soc/
> patch/20211209001056.29774-1-prabhakar.mahadev-lad.rj@bp.renesas.com/
>
> Cheers,
> Prabhakar
>
> Lad Prabhakar (3):
> dmaengine: nbpfaxi: Use platform_get_irq_optional() to get the
> interrupt
> dmaengine: mediatek: mtk-hsdma: Use platform_get_irq() to get the
> interrupt
> dmaengine: mediatek-cqdma: Use platform_get_irq() to get the interrupt
>
> drivers/dma/mediatek/mtk-cqdma.c | 12 ++++--------
> drivers/dma/mediatek/mtk-hsdma.c | 11 ++++-------
> drivers/dma/nbpfaxi.c | 14 ++++++--------
> 3 files changed, 14 insertions(+), 23 deletions(-)
>
> --
> 2.17.1
>
--
With Best Regards,
Andy Shevchenko
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 0/3] dmaengine: Use platform_get_irq*() variants to fetch IRQ's
2022-01-04 16:35 [PATCH v2 0/3] dmaengine: Use platform_get_irq*() variants to fetch IRQ's Lad Prabhakar
` (2 preceding siblings ...)
2022-01-05 9:56 ` [PATCH v2 0/3] dmaengine: Use platform_get_irq*() variants to fetch IRQ's Andy Shevchenko
@ 2022-03-09 11:37 ` Lad, Prabhakar
2022-03-11 10:36 ` Vinod Koul
3 siblings, 1 reply; 8+ messages in thread
From: Lad, Prabhakar @ 2022-03-09 11:37 UTC (permalink / raw)
To: Sean Wang, Vinod Koul, moderated list:ARM/Mediatek SoC support
Cc: Lad Prabhakar, Matthias Brugger, Rob Herring, Andy Shevchenko, LAK
Hi Sean/Vinod,
Not sure how I missed you to add in the To/CC list.
On Tue, Jan 4, 2022 at 4:35 PM Lad Prabhakar
<prabhakar.mahadev-lad.rj@bp.renesas.com> wrote:
>
> Hi All,
>
> This patch series aims to drop using platform_get_resource() for IRQ types
> in preparation for removal of static setup of IRQ resource from DT core
> code.
>
> Dropping usage of platform_get_resource() was agreed based on
> the discussion [0].
>
> [0] https://patchwork.kernel.org/project/linux-renesas-soc/
> patch/20211209001056.29774-1-prabhakar.mahadev-lad.rj@bp.renesas.com/
>
> Cheers,
> Prabhakar
>
> Lad Prabhakar (3):
> dmaengine: nbpfaxi: Use platform_get_irq_optional() to get the
> interrupt
> dmaengine: mediatek: mtk-hsdma: Use platform_get_irq() to get the
> interrupt
> dmaengine: mediatek-cqdma: Use platform_get_irq() to get the interrupt
>
> drivers/dma/mediatek/mtk-cqdma.c | 12 ++++--------
> drivers/dma/mediatek/mtk-hsdma.c | 11 ++++-------
> drivers/dma/nbpfaxi.c | 14 ++++++--------
> 3 files changed, 14 insertions(+), 23 deletions(-)
>
These patches aren't in -next yet. Do you want me to resend them?
Cheers,
Prabhakar
> --
> 2.17.1
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 0/3] dmaengine: Use platform_get_irq*() variants to fetch IRQ's
2022-03-09 11:37 ` Lad, Prabhakar
@ 2022-03-11 10:36 ` Vinod Koul
0 siblings, 0 replies; 8+ messages in thread
From: Vinod Koul @ 2022-03-11 10:36 UTC (permalink / raw)
To: Lad, Prabhakar
Cc: Sean Wang, moderated list:ARM/Mediatek SoC support,
Lad Prabhakar, Matthias Brugger, Rob Herring, Andy Shevchenko,
LAK
On 09-03-22, 11:37, Lad, Prabhakar wrote:
> Hi Sean/Vinod,
>
> Not sure how I missed you to add in the To/CC list.
>
> On Tue, Jan 4, 2022 at 4:35 PM Lad Prabhakar
> <prabhakar.mahadev-lad.rj@bp.renesas.com> wrote:
> >
> > Hi All,
> >
> > This patch series aims to drop using platform_get_resource() for IRQ types
> > in preparation for removal of static setup of IRQ resource from DT core
> > code.
> >
> > Dropping usage of platform_get_resource() was agreed based on
> > the discussion [0].
> >
> > [0] https://patchwork.kernel.org/project/linux-renesas-soc/
> > patch/20211209001056.29774-1-prabhakar.mahadev-lad.rj@bp.renesas.com/
> >
> > Cheers,
> > Prabhakar
> >
> > Lad Prabhakar (3):
> > dmaengine: nbpfaxi: Use platform_get_irq_optional() to get the
> > interrupt
> > dmaengine: mediatek: mtk-hsdma: Use platform_get_irq() to get the
> > interrupt
> > dmaengine: mediatek-cqdma: Use platform_get_irq() to get the interrupt
> >
> > drivers/dma/mediatek/mtk-cqdma.c | 12 ++++--------
> > drivers/dma/mediatek/mtk-hsdma.c | 11 ++++-------
> > drivers/dma/nbpfaxi.c | 14 ++++++--------
> > 3 files changed, 14 insertions(+), 23 deletions(-)
> >
> These patches aren't in -next yet. Do you want me to resend them?
Yes that would be ideal! But after upcoming merge window closes
--
~Vinod
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 8+ messages in thread