Thread (6 messages) flat view 6 messages, 3 authors, 2021-12-25

Re: [PATCH 1/3] dmaengine: nbpfaxi: Use platform_get_irq_optional() to get the interrupt

From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
Date: 2021-12-25 23:51:15
Also in: dmaengine, linux-mediatek, linux-renesas-soc, lkml

Hi Andy,

Thank you for the review.

On Sat, Dec 25, 2021 at 5:47 PM Andy Shevchenko
[off-list ref] wrote:
On Fri, Dec 24, 2021 at 3:14 PM Lad Prabhakar
[off-list ref] wrote:
quoted
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_optional().

There are no non-DT users for this driver so interrupt range
(irq_res->start-irq_res->end) is no longer required and with DT we will
be sure it will be a single IRQ resource for each index.
quoted
        for (i = 0; irqs < ARRAY_SIZE(irqbuf); i++) {
-               irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, i);
-               if (!irq_res)
+               irq = platform_get_irq_optional(pdev, i);
+               if (irq == -ENXIO)
                        break;
-
-               for (irq = irq_res->start; irq <= irq_res->end;
-                    irq++, irqs++)
-                       irqbuf[irqs] = irq;
+               if (irq < 0)
+                       return irq;
+               irqbuf[irqs++] = irq;
        }
Same comment as per other patch(es), i.e. consider 0 as no IRQ.
Will do.

Cheers,
Prabhakar

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help