diff mbox

[v2,1/1] xen/device-tree: Do not remap IRQs for secondary IRQ controllers

Message ID 1463411035-13562-2-git-send-email-edgar.iglesias@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Edgar E. Iglesias May 16, 2016, 3:03 p.m. UTC
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>

Do not remap IRQs connected to secondary interrupt controllers.
These IRQs have no meaning to us until they connect to the
primary controller.

Secondary IRQ controllers will at some point connect to the
primary controller (possibly via other IRQ controllers). We
map the IRQs at that last connection point.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
---
 xen/common/device_tree.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Comments

Julien Grall May 17, 2016, 11:20 a.m. UTC | #1
Hi Edgar,

On 16/05/16 16:03, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
>
> Do not remap IRQs connected to secondary interrupt controllers.
> These IRQs have no meaning to us until they connect to the
> primary controller.
>
> Secondary IRQ controllers will at some point connect to the
> primary controller (possibly via other IRQ controllers). We
> map the IRQs at that last connection point.
>
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>

With the change mention below:

Reviewed-by:  Julien Grall <julien.grall@linaro.org>

> ---
>   xen/common/device_tree.c | 16 ++++++++++++++++
>   1 file changed, 16 insertions(+)
>
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 0ed86a7..02a7ede 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -1176,6 +1176,22 @@ int dt_for_each_irq_map(const struct dt_device_node *dev,
>           for ( i = 0; i < pintsize; i++ )
>               dt_raw_irq.specifier[i] = dt_read_number(imap + i, 1);
>
> +        if ( dt_raw_irq.controller != dt_interrupt_controller )
> +        {
> +            /* We don't map IRQs connected to secondary IRQ controllers as

The comments in Xen looks like:

/*
  * Foo
  * Bart
  */

> +             * these IRQs have no meaning to us until they connect to the
> +             * primary controller.
> +             *
> +             * Secondary IRQ controllers will at some point connect to
> +             * the primary controller (possibly via other IRQ controllers).
> +             * We map the IRQs at that last connection point.
> +             */
> +            imap += pintsize;
> +            imaplen -= pintsize;
> +            dt_dprintk(" -> Skipped IRQ for secondary IRQ controller\n");
> +            continue;
> +        }
> +
>           ret = dt_irq_translate(&dt_raw_irq, &dt_irq);
>           if ( ret )
>           {
>

Regards,
Edgar E. Iglesias May 17, 2016, 12:16 p.m. UTC | #2
On Tue, May 17, 2016 at 12:20:43PM +0100, Julien Grall wrote:
> Hi Edgar,
> 
> On 16/05/16 16:03, Edgar E. Iglesias wrote:
> >From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
> >
> >Do not remap IRQs connected to secondary interrupt controllers.
> >These IRQs have no meaning to us until they connect to the
> >primary controller.
> >
> >Secondary IRQ controllers will at some point connect to the
> >primary controller (possibly via other IRQ controllers). We
> >map the IRQs at that last connection point.
> >
> >Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
> 
> With the change mention below:
> 
> Reviewed-by:  Julien Grall <julien.grall@linaro.org>

Thanks Julien,

I've fixed the style and posted a v3.

Cheers,
Edgar


> 
> >---
> >  xen/common/device_tree.c | 16 ++++++++++++++++
> >  1 file changed, 16 insertions(+)
> >
> >diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> >index 0ed86a7..02a7ede 100644
> >--- a/xen/common/device_tree.c
> >+++ b/xen/common/device_tree.c
> >@@ -1176,6 +1176,22 @@ int dt_for_each_irq_map(const struct dt_device_node *dev,
> >          for ( i = 0; i < pintsize; i++ )
> >              dt_raw_irq.specifier[i] = dt_read_number(imap + i, 1);
> >
> >+        if ( dt_raw_irq.controller != dt_interrupt_controller )
> >+        {
> >+            /* We don't map IRQs connected to secondary IRQ controllers as
> 
> The comments in Xen looks like:
> 
> /*
>  * Foo
>  * Bart
>  */
> 
> >+             * these IRQs have no meaning to us until they connect to the
> >+             * primary controller.
> >+             *
> >+             * Secondary IRQ controllers will at some point connect to
> >+             * the primary controller (possibly via other IRQ controllers).
> >+             * We map the IRQs at that last connection point.
> >+             */
> >+            imap += pintsize;
> >+            imaplen -= pintsize;
> >+            dt_dprintk(" -> Skipped IRQ for secondary IRQ controller\n");
> >+            continue;
> >+        }
> >+
> >          ret = dt_irq_translate(&dt_raw_irq, &dt_irq);
> >          if ( ret )
> >          {
> >
> 
> Regards,
> 
> -- 
> Julien Grall
diff mbox

Patch

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 0ed86a7..02a7ede 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -1176,6 +1176,22 @@  int dt_for_each_irq_map(const struct dt_device_node *dev,
         for ( i = 0; i < pintsize; i++ )
             dt_raw_irq.specifier[i] = dt_read_number(imap + i, 1);
 
+        if ( dt_raw_irq.controller != dt_interrupt_controller )
+        {
+            /* We don't map IRQs connected to secondary IRQ controllers as
+             * these IRQs have no meaning to us until they connect to the
+             * primary controller.
+             *
+             * Secondary IRQ controllers will at some point connect to
+             * the primary controller (possibly via other IRQ controllers).
+             * We map the IRQs at that last connection point.
+             */
+            imap += pintsize;
+            imaplen -= pintsize;
+            dt_dprintk(" -> Skipped IRQ for secondary IRQ controller\n");
+            continue;
+        }
+
         ret = dt_irq_translate(&dt_raw_irq, &dt_irq);
         if ( ret )
         {