All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/1] xen/device-tree: Do not remap IRQs for secondary IRQ controllers
@ 2016-05-17 12:15 Edgar E. Iglesias
  2016-05-17 13:14 ` Wei Liu
  0 siblings, 1 reply; 2+ messages in thread
From: Edgar E. Iglesias @ 2016-05-17 12:15 UTC (permalink / raw)
  To: xen-devel; +Cc: edgar.iglesias, julien.grall, sstabellini, wei.liu2, wei.chen

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.

Reviewed-by: Julien Grall <julien.grall@linaro.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
---

ChangeLog:
v2 -> v3:
* Fix coding style issue with the comment

v1 -> v2:
* Rephrased comment no longer mentioning bus-bridges.
* Fixed coding style issues.
* Added a dt_dprintk to log skipped IRQs.

 xen/common/device_tree.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 0ed86a7..06a2837 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -1176,6 +1176,23 @@ 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 )
         {
-- 
2.5.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-17 13:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-17 12:15 [PATCH v3 1/1] xen/device-tree: Do not remap IRQs for secondary IRQ controllers Edgar E. Iglesias
2016-05-17 13:14 ` Wei Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.