genirq/irqdomain: Propagate early activation
authorThomas Gleixner <tglx@linutronix.de>
Wed, 13 Sep 2017 21:29:12 +0000 (23:29 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 25 Sep 2017 18:38:25 +0000 (20:38 +0200)
Propagate the early activation mode to the irqdomain activate()
callbacks. This is required for the upcoming reservation, late vector
assignment scheme, so that the early activation call can act accordingly.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Juergen Gross <jgross@suse.com>
Tested-by: Yu Chen <yu.c.chen@intel.com>
Acked-by: Juergen Gross <jgross@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Alok Kataria <akataria@vmware.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Rui Zhang <rui.zhang@intel.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Len Brown <lenb@kernel.org>
Link: https://lkml.kernel.org/r/20170913213153.028353660@linutronix.de
arch/x86/kernel/apic/io_apic.c
include/linux/irqdomain.h
kernel/irq/chip.c
kernel/irq/internals.h
kernel/irq/irqdomain.c
kernel/irq/msi.c

index d50e46757f6d0c0f46fb1d0552da35f95b0945e3..6f1007fd97836c664851ae16c874f9c0724a5f68 100644 (file)
@@ -2096,7 +2096,7 @@ static inline void __init check_timer(void)
                                unmask_ioapic_irq(irq_get_irq_data(0));
                }
                irq_domain_deactivate_irq(irq_data);
-               irq_domain_activate_irq(irq_data);
+               irq_domain_activate_irq(irq_data, false);
                if (timer_irq_works()) {
                        if (disable_timer_pin_1 > 0)
                                clear_IO_APIC_pin(0, pin1);
@@ -2118,7 +2118,7 @@ static inline void __init check_timer(void)
                 */
                replace_pin_at_irq_node(data, node, apic1, pin1, apic2, pin2);
                irq_domain_deactivate_irq(irq_data);
-               irq_domain_activate_irq(irq_data);
+               irq_domain_activate_irq(irq_data, false);
                legacy_pic->unmask(0);
                if (timer_irq_works()) {
                        apic_printk(APIC_QUIET, KERN_INFO "....... works.\n");
index 8fb87712198451aceca9daa56748f503aa246e04..7d0c6c1447084f57568cfc612aff107d15be8d22 100644 (file)
@@ -441,7 +441,7 @@ extern int __irq_domain_alloc_irqs(struct irq_domain *domain, int irq_base,
                                   unsigned int nr_irqs, int node, void *arg,
                                   bool realloc, const struct cpumask *affinity);
 extern void irq_domain_free_irqs(unsigned int virq, unsigned int nr_irqs);
-extern int irq_domain_activate_irq(struct irq_data *irq_data);
+extern int irq_domain_activate_irq(struct irq_data *irq_data, bool early);
 extern void irq_domain_deactivate_irq(struct irq_data *irq_data);
 
 static inline int irq_domain_alloc_irqs(struct irq_domain *domain,
index cd5b3eb38082edd54e80018c61fdeae02ffce50e..82333835ac66ee183087eeeb9d8c203c3f702d38 100644 (file)
@@ -223,7 +223,7 @@ __irq_startup_managed(struct irq_desc *desc, struct cpumask *aff, bool force)
         * Managed interrupts have reserved resources, so this should not
         * happen.
         */
-       if (WARN_ON(irq_domain_activate_irq(d)))
+       if (WARN_ON(irq_domain_activate_irq(d, false)))
                return IRQ_STARTUP_ABORT;
        return IRQ_STARTUP_MANAGED;
 }
@@ -290,7 +290,7 @@ int irq_activate(struct irq_desc *desc)
        struct irq_data *d = irq_desc_get_irq_data(desc);
 
        if (!irqd_affinity_is_managed(d))
-               return irq_domain_activate_irq(d);
+               return irq_domain_activate_irq(d, false);
        return 0;
 }
 
index e84d0e3899f6b4fa6183ec62adda0a248a447b90..a0327136e469a13850553a0e26a8e35b714221f1 100644 (file)
@@ -439,7 +439,7 @@ static inline bool irq_fixup_move_pending(struct irq_desc *desc, bool fclear)
 #endif /* !CONFIG_GENERIC_PENDING_IRQ */
 
 #if !defined(CONFIG_IRQ_DOMAIN) || !defined(CONFIG_IRQ_DOMAIN_HIERARCHY)
-static inline int irq_domain_activate_irq(struct irq_data *data)
+static inline int irq_domain_activate_irq(struct irq_data *data, bool early)
 {
        irqd_set_activated(data);
        return 0;
index 47e8ddd9e8cfa5c3a28742bf90ac1fb356f29d3d..b50f737574ae1370f98912826abfc0d5a0cf3ee0 100644 (file)
@@ -1694,7 +1694,7 @@ static void __irq_domain_deactivate_irq(struct irq_data *irq_data)
        }
 }
 
-static int __irq_domain_activate_irq(struct irq_data *irqd)
+static int __irq_domain_activate_irq(struct irq_data *irqd, bool early)
 {
        int ret = 0;
 
@@ -1702,9 +1702,10 @@ static int __irq_domain_activate_irq(struct irq_data *irqd)
                struct irq_domain *domain = irqd->domain;
 
                if (irqd->parent_data)
-                       ret = __irq_domain_activate_irq(irqd->parent_data);
+                       ret = __irq_domain_activate_irq(irqd->parent_data,
+                                                       early);
                if (!ret && domain->ops->activate) {
-                       ret = domain->ops->activate(domain, irqd, false);
+                       ret = domain->ops->activate(domain, irqd, early);
                        /* Rollback in case of error */
                        if (ret && irqd->parent_data)
                                __irq_domain_deactivate_irq(irqd->parent_data);
@@ -1721,12 +1722,12 @@ static int __irq_domain_activate_irq(struct irq_data *irqd)
  * This is the second step to call domain_ops->activate to program interrupt
  * controllers, so the interrupt could actually get delivered.
  */
-int irq_domain_activate_irq(struct irq_data *irq_data)
+int irq_domain_activate_irq(struct irq_data *irq_data, bool early)
 {
        int ret = 0;
 
        if (!irqd_is_activated(irq_data))
-               ret = __irq_domain_activate_irq(irq_data);
+               ret = __irq_domain_activate_irq(irq_data, early);
        if (!ret)
                irqd_set_activated(irq_data);
        return ret;
index 5ece369950ece988f63f622838777634c4946824..d7553d0151754e15cab5044ef96f3114c87cadb6 100644 (file)
@@ -401,7 +401,7 @@ int msi_domain_alloc_irqs(struct irq_domain *domain, struct device *dev,
                        struct irq_data *irq_data;
 
                        irq_data = irq_domain_get_irq_data(domain, desc->irq);
-                       ret = irq_domain_activate_irq(irq_data);
+                       ret = irq_domain_activate_irq(irq_data, true);
                        if (ret)
                                goto cleanup;
                }