Skip to content

Commit

Permalink
genirq: Always apply cpu online mask
Browse files Browse the repository at this point in the history
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: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Thomas Gleixner committed Feb 19, 2011
1 parent b008207 commit 569bda8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions kernel/irq/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ EXPORT_SYMBOL_GPL(irq_set_affinity_notifier);
*/
static int setup_affinity(unsigned int irq, struct irq_desc *desc)
{
struct cpumask *set = irq_default_affinity;

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

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

return 0;
Expand Down

0 comments on commit 569bda8

Please sign in to comment.