Commit 4308ad80 authored by Peter P Waskiewicz Jr's avatar Peter P Waskiewicz Jr Committed by Thomas Gleixner

genirq: Clear CPU mask in affinity_hint when none is provided

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: default avatarPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Cc: davem@davemloft.net
Cc: arjan@linux.jf.intel.com
Cc: bhutchings@solarflare.com
LKML-Reference: <20100505205638.5426.87189.stgit@ppwaskie-hc2.jf.intel.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent e7a297b0
...@@ -38,14 +38,12 @@ static int irq_affinity_hint_proc_show(struct seq_file *m, void *v) ...@@ -38,14 +38,12 @@ static int irq_affinity_hint_proc_show(struct seq_file *m, void *v)
unsigned long flags; unsigned long flags;
cpumask_var_t mask; cpumask_var_t mask;
if (!alloc_cpumask_var(&mask, GFP_KERNEL)) if (!zalloc_cpumask_var(&mask, GFP_KERNEL))
return -ENOMEM; return -ENOMEM;
raw_spin_lock_irqsave(&desc->lock, flags); raw_spin_lock_irqsave(&desc->lock, flags);
if (desc->affinity_hint) if (desc->affinity_hint)
cpumask_copy(mask, desc->affinity_hint); cpumask_copy(mask, desc->affinity_hint);
else
cpumask_setall(mask);
raw_spin_unlock_irqrestore(&desc->lock, flags); raw_spin_unlock_irqrestore(&desc->lock, flags);
seq_cpumask(m, mask); seq_cpumask(m, mask);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment