genirq/affinity: Make affinity setting if activated opt-in
[sfrench/cifs-2.6.git] / kernel / irq / manage.c
index 2a9fec53e15910124dc8190c13ad4bfde3baca63..48c38e09c6733614e3a9d0ae19d77b9d685a36a3 100644 (file)
@@ -320,12 +320,16 @@ static bool irq_set_affinity_deactivated(struct irq_data *data,
        struct irq_desc *desc = irq_data_to_desc(data);
 
        /*
+        * Handle irq chips which can handle affinity only in activated
+        * state correctly
+        *
         * If the interrupt is not yet activated, just store the affinity
         * mask and do not call the chip driver at all. On activation the
         * driver has to make sure anyway that the interrupt is in a
         * useable state so startup works.
         */
-       if (!IS_ENABLED(CONFIG_IRQ_DOMAIN_HIERARCHY) || irqd_is_activated(data))
+       if (!IS_ENABLED(CONFIG_IRQ_DOMAIN_HIERARCHY) ||
+           irqd_is_activated(data) || !irqd_affinity_on_activate(data))
                return false;
 
        cpumask_copy(desc->irq_common_data.affinity, mask);