Stephan Linz | 20 Jun 2011 21:38

[microblaze-linux] [PATCH] uio_pdrv_genirq: extensive interrupt search

In some circumstances, especially in a complex OF environment,
the interrupt will not present as second resource entry (hard
coded as &pdev->resource[1]). We need a more precise lookup
algorithm to find the first valid interrupt entry.

Signed-off-by: Stephan Linz <linz@...>
---
 drivers/uio/uio_pdrv_genirq.c |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c
index dd94385..715a68d 100644
--- a/drivers/uio/uio_pdrv_genirq.c
+++ b/drivers/uio/uio_pdrv_genirq.c
 <at>  <at>  -112,13 +112,22  <at>  <at>  static int uio_pdrv_genirq_probe(struct platform_device *pdev)
 		uioinfo->name = pdev->dev.of_node->name;
 		uioinfo->version = uioinfo->name; /* FIXME */

-		/* Multiple IRQs are not supported */
-		if (pdev->num_resources > 1) {
-			struct resource *r = &pdev->resource[1];
+		/* Looking for IRQ */
+		uioinfo->irq = UIO_IRQ_NONE;
+		for (i = 0; i < pdev->num_resources; ++i) {
+			struct resource *r = &pdev->resource[i];
+
+			if (r->flags != IORESOURCE_IRQ)
+				continue;
+
 			uioinfo->irq = r->start;
(Continue reading)

Michal Simek | 5 Jul 2011 13:33
Picon

Re: [microblaze-linux] [PATCH] uio_pdrv_genirq: extensive interrupt search

Hi Stephan,

Stephan Linz wrote:
> In some circumstances, especially in a complex OF environment,
> the interrupt will not present as second resource entry (hard
> coded as &pdev->resource[1]). We need a more precise lookup
> algorithm to find the first valid interrupt entry.
> 
> Signed-off-by: Stephan Linz <linz@...>

I am not sure what your patch solved. I have sent to LKML uio patch which add 
support for OF to UIO. Here is the link https://lkml.org/lkml/2011/5/5/18

There is used platform_get_irq function to find out IRQ.

Is it what you wanted to solved by your patch?

Anyway this is UIO patch not Microblaze specific that's why it is better to send 
it to appropriate mailing list and CC UIO maintainer.

Best regards,
Michal

--

-- 
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
_______________________________________________
microblaze-linux mailing list
(Continue reading)


Gmane