]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blobdiff - kernel/irq/manage.c
Merge tag 'irqchip-4.15-4' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm...
[mirror_ubuntu-focal-kernel.git] / kernel / irq / manage.c
index 21e04e780be424840614be3074a61b0d323c8512..0f922729bab9b202d1d79054dee2ff56d8a523a2 100644 (file)
@@ -168,6 +168,19 @@ void irq_set_thread_affinity(struct irq_desc *desc)
                        set_bit(IRQTF_AFFINITY, &action->thread_flags);
 }
 
+static void irq_validate_effective_affinity(struct irq_data *data)
+{
+#ifdef CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK
+       const struct cpumask *m = irq_data_get_effective_affinity_mask(data);
+       struct irq_chip *chip = irq_data_get_irq_chip(data);
+
+       if (!cpumask_empty(m))
+               return;
+       pr_warn_once("irq_chip %s did not update eff. affinity mask of irq %u\n",
+                    chip->name, data->irq);
+#endif
+}
+
 int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask,
                        bool force)
 {
@@ -175,12 +188,16 @@ int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask,
        struct irq_chip *chip = irq_data_get_irq_chip(data);
        int ret;
 
+       if (!chip || !chip->irq_set_affinity)
+               return -EINVAL;
+
        ret = chip->irq_set_affinity(data, mask, force);
        switch (ret) {
        case IRQ_SET_MASK_OK:
        case IRQ_SET_MASK_OK_DONE:
                cpumask_copy(desc->irq_common_data.affinity, mask);
        case IRQ_SET_MASK_OK_NOCOPY:
+               irq_validate_effective_affinity(data);
                irq_set_thread_affinity(desc);
                ret = 0;
        }
@@ -381,7 +398,8 @@ int irq_select_affinity_usr(unsigned int irq)
 /**
  *     irq_set_vcpu_affinity - Set vcpu affinity for the interrupt
  *     @irq: interrupt number to set affinity
- *     @vcpu_info: vCPU specific data
+ *     @vcpu_info: vCPU specific data or pointer to a percpu array of vCPU
+ *                 specific data for percpu_devid interrupts
  *
  *     This function uses the vCPU specific data to set the vCPU
  *     affinity for an irq. The vCPU specific data is passed from
@@ -1299,7 +1317,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
                 * thread_mask assigned. See the loop above which or's
                 * all existing action->thread_mask bits.
                 */
-               new->thread_mask = 1 << ffz(thread_mask);
+               new->thread_mask = 1UL << ffz(thread_mask);
 
        } else if (new->handler == irq_default_primary_handler &&
                   !(desc->irq_data.chip->flags & IRQCHIP_ONESHOT_SAFE)) {