aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/irq/proc.c
diff options
context:
space:
mode:
authorPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>2010-05-05 16:56:42 -0400
committerThomas Gleixner <tglx@linutronix.de>2010-05-12 05:23:34 -0400
commit4308ad801193f14ff42cb746da37cf07e35f0d08 (patch)
treed25466295270408c11a234658b70c43095aed4d3 /kernel/irq/proc.c
parente7a297b0d7d6049bd4e423ac1e17da31e4c401b8 (diff)
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: Peter 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: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/irq/proc.c')
-rw-r--r--kernel/irq/proc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index 4f9427a30e14..09a2ee540bd2 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -38,14 +38,12 @@ static int irq_affinity_hint_proc_show(struct seq_file *m, void *v)
38 unsigned long flags; 38 unsigned long flags;
39 cpumask_var_t mask; 39 cpumask_var_t mask;
40 40
41 if (!alloc_cpumask_var(&mask, GFP_KERNEL)) 41 if (!zalloc_cpumask_var(&mask, GFP_KERNEL))
42 return -ENOMEM; 42 return -ENOMEM;
43 43
44 raw_spin_lock_irqsave(&desc->lock, flags); 44 raw_spin_lock_irqsave(&desc->lock, flags);
45 if (desc->affinity_hint) 45 if (desc->affinity_hint)
46 cpumask_copy(mask, desc->affinity_hint); 46 cpumask_copy(mask, desc->affinity_hint);
47 else
48 cpumask_setall(mask);
49 raw_spin_unlock_irqrestore(&desc->lock, flags); 47 raw_spin_unlock_irqrestore(&desc->lock, flags);
50 48
51 seq_cpumask(m, mask); 49 seq_cpumask(m, mask);