diff mbox

[Xen-devel,v2] xen/dt: Allow only IRQ translation that are mapped to main GIC

Message ID 1404817331-10195-1-git-send-email-julien.grall@linaro.org
State Superseded, archived
Headers show

Commit Message

Julien Grall July 8, 2014, 11:02 a.m. UTC
Xen is only able to handle one GIC controller. Some platform may contain
other interrupt controller.

Make sure to only translate IRQ mapped into the GIC handled by Xen.

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

---
    Changes in v2:
        - Fix compilation...
---
 xen/common/device_tree.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Julien Grall July 9, 2014, 12:33 p.m. UTC | #1
On 07/08/2014 12:02 PM, Julien Grall wrote:
> Xen is only able to handle one GIC controller. Some platform may contain
> other interrupt controller.
> 
> Make sure to only translate IRQ mapped into the GIC handled by Xen.
> 
> Signed-off-by: Julien Grall <julien.grall@linaro.org>
> 
> ---
>     Changes in v2:
>         - Fix compilation...

Please ignore this patch. The problem is bigger than I though. I will
send a proper series later.

> ---
>  xen/common/device_tree.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 310635e..7178c77 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -1444,6 +1444,8 @@ int dt_irq_translate(const struct dt_raw_irq *raw,
>      ASSERT(dt_irq_xlate != NULL);
>  
>      /* TODO: Retrieve the right irq_xlate. This is only work for the gic */
> +    if ( raw->controller != dt_interrupt_controller )
> +        return -EINVAL;
>  
>      return dt_irq_xlate(raw->specifier, raw->size,
>                          &out_irq->irq, &out_irq->type);
>
diff mbox

Patch

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 310635e..7178c77 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -1444,6 +1444,8 @@  int dt_irq_translate(const struct dt_raw_irq *raw,
     ASSERT(dt_irq_xlate != NULL);
 
     /* TODO: Retrieve the right irq_xlate. This is only work for the gic */
+    if ( raw->controller != dt_interrupt_controller )
+        return -EINVAL;
 
     return dt_irq_xlate(raw->specifier, raw->size,
                         &out_irq->irq, &out_irq->type);