Skip to content

Commit

Permalink
genirq: Clear CPU mask in affinity_hint when none is provided
Browse files Browse the repository at this point in the history
When an interrupt is disabled and torn down, the CPU mask returned
through affinity_hint right now is all CPUs. Also, for drivers that
don't provide an affinity_hint mask, this can be misleading. There
should be no hint at all, meaning an empty CPU mask.

[ tglx: use zalloc_cpumask_var instead of clearing it under the lock ]

Signed-off-by: Peter P Waskiewicz Jr <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
LKML-Reference: <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
  • Loading branch information
ppwaskie authored and KAGA-KOKO committed May 12, 2010
1 parent e7a297b commit 4308ad8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions kernel/irq/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,12 @@ static int irq_affinity_hint_proc_show(struct seq_file *m, void *v)
unsigned long flags;
cpumask_var_t mask;

if (!alloc_cpumask_var(&mask, GFP_KERNEL))
if (!zalloc_cpumask_var(&mask, GFP_KERNEL))
return -ENOMEM;

raw_spin_lock_irqsave(&desc->lock, flags);
if (desc->affinity_hint)
cpumask_copy(mask, desc->affinity_hint);
else
cpumask_setall(mask);
raw_spin_unlock_irqrestore(&desc->lock, flags);

seq_cpumask(m, mask);
Expand Down

0 comments on commit 4308ad8

Please sign in to comment.