genirq: Look-up percpu trigger type if not specified by caller
authorMarc Zyngier <marc.zyngier@arm.com>
Mon, 13 Jun 2016 09:39:44 +0000 (10:39 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Mon, 13 Jun 2016 10:53:51 +0000 (11:53 +0100)
As we now do for non-percpu interrupt, perform a lookup of the
interrupt trigger if the user doesn't supply one. The difference
here is that we can only do it at enable time (trigger configuration
can be per-cpu as well).

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
kernel/irq/manage.c

index eaedeb74b49dbaaee7c7e175c4771f314fc02781..f78b0846afb1c4978cc300fc78b54fbb940389b5 100644 (file)
@@ -1737,7 +1737,14 @@ void enable_percpu_irq(unsigned int irq, unsigned int type)
        if (!desc)
                return;
 
+       /*
+        * If the trigger type is not specified by the caller, then
+        * use the default for this interrupt.
+        */
        type &= IRQ_TYPE_SENSE_MASK;
+       if (type == IRQ_TYPE_NONE)
+               type = irqd_get_trigger_type(&desc->irq_data);
+
        if (type != IRQ_TYPE_NONE) {
                int ret;