genirq/irqdomain: Add force reactivation flag to irq domains
authorThomas Gleixner <tglx@linutronix.de>
Wed, 13 Sep 2017 21:29:13 +0000 (23:29 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 25 Sep 2017 18:38:25 +0000 (20:38 +0200)
Allow irqdomains to tell the core code, that after early activation the
interrupt needs to be reactivated at request_irq() time.

This allows reservation of vectors at early activation time and actual
vector assignment at request_irq() time.

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.106242536@linutronix.de
include/linux/msi.h
kernel/irq/msi.c

index 80e3b562bef6c9cb5f3e966b397ec61ef711940d..eff16ef81f43b2db56b5e037e80421888d5a2ac8 100644 (file)
@@ -283,6 +283,11 @@ enum {
        MSI_FLAG_PCI_MSIX               = (1 << 3),
        /* Needs early activate, required for PCI */
        MSI_FLAG_ACTIVATE_EARLY         = (1 << 4),
+       /*
+        * Must reactivate when irq is started even when
+        * MSI_FLAG_ACTIVATE_EARLY has been set.
+        */
+       MSI_FLAG_MUST_REACTIVATE        = (1 << 5),
 };
 
 int msi_domain_set_affinity(struct irq_data *data, const struct cpumask *mask,
index d7553d0151754e15cab5044ef96f3114c87cadb6..edb987b2c58dc1553342b5a87c91335b42888e8b 100644 (file)
@@ -404,6 +404,8 @@ int msi_domain_alloc_irqs(struct irq_domain *domain, struct device *dev,
                        ret = irq_domain_activate_irq(irq_data, true);
                        if (ret)
                                goto cleanup;
+                       if (info->flags & MSI_FLAG_MUST_REACTIVATE)
+                               irqd_clr_activated(irq_data);
                }
        }
        return 0;