Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 569bda8d authored by Thomas Gleixner's avatar Thomas Gleixner
Browse files

genirq: Always apply cpu online mask



If the affinity had been set by the user, then a later request_irq()
will honour that setting. But online cpus can have changed. So apply
the online mask and for this case as well.

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent b008207c
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -256,6 +256,8 @@ EXPORT_SYMBOL_GPL(irq_set_affinity_notifier);
 */
 */
static int setup_affinity(unsigned int irq, struct irq_desc *desc)
static int setup_affinity(unsigned int irq, struct irq_desc *desc)
{
{
	struct cpumask *set = irq_default_affinity;

	/* Excludes PER_CPU and NO_BALANCE interrupts */
	/* Excludes PER_CPU and NO_BALANCE interrupts */
	if (!irq_can_set_affinity(irq))
	if (!irq_can_set_affinity(irq))
		return 0;
		return 0;
@@ -265,15 +267,13 @@ static int setup_affinity(unsigned int irq, struct irq_desc *desc)
	 * one of the targets is online.
	 * one of the targets is online.
	 */
	 */
	if (desc->status & (IRQ_AFFINITY_SET)) {
	if (desc->status & (IRQ_AFFINITY_SET)) {
		if (cpumask_any_and(desc->irq_data.affinity, cpu_online_mask)
		if (cpumask_intersects(desc->irq_data.affinity,
		    < nr_cpu_ids)
				       cpu_online_mask))
			goto set_affinity;
			set = desc->irq_data.affinity;
		else
		else
			desc->status &= ~IRQ_AFFINITY_SET;
			desc->status &= ~IRQ_AFFINITY_SET;
	}
	}

	cpumask_and(desc->irq_data.affinity, cpu_online_mask, set);
	cpumask_and(desc->irq_data.affinity, cpu_online_mask, irq_default_affinity);
set_affinity:
	desc->irq_data.chip->irq_set_affinity(&desc->irq_data, desc->irq_data.affinity, false);
	desc->irq_data.chip->irq_set_affinity(&desc->irq_data, desc->irq_data.affinity, false);


	return 0;
	return 0;