[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] xen/arm: irq: Use appropriate priority for SGIs in setup_irq()



From: Mykola Kvach <mykola_kvach@xxxxxxxx>

Use GIC_PRI_IPI priority for SGI interrupts instead of the generic
GIC_PRI_IRQ priority in setup_irq().

This change ensures that SGIs get the correct priority level when
being set up for Xen's use, maintaining proper interrupt precedence
in the system.

The priority assignment now follows ARM GIC best practices:
- SGIs (0-15): GIC_PRI_IPI (higher priority)
- PPIs/SPIs (16+): GIC_PRI_IRQ (standard priority)

Signed-off-by: Mykola Kvach <mykola_kvach@xxxxxxxx>
---
 xen/arch/arm/irq.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 02ca82c089..17c7ac92b5 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -397,7 +397,13 @@ int setup_irq(unsigned int irq, unsigned int irqflags, 
struct irqaction *new)
     /* First time the IRQ is setup */
     if ( disabled )
     {
-        gic_route_irq_to_xen(desc, GIC_PRI_IRQ);
+        unsigned int prio = GIC_PRI_IRQ;
+
+        /* Use appropriate priority based on interrupt type */
+        if (desc->irq < NR_GIC_SGI)
+            prio = GIC_PRI_IPI;
+
+        gic_route_irq_to_xen(desc, prio);
         /* It's fine to use smp_processor_id() because:
          * For SGI and PPI: irq_desc is banked
          * For SPI: we don't care for now which CPU will receive the
-- 
2.43.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.