[PATCH 1/4] x86: fix assign_irq_vector boot up problem

From: Mike Travis
Date: Thu Dec 11 2008 - 06:28:30 EST


Impact: fix boot up problem.

Fix a problem encountered with the Intel SATA-AHCI disk driver
right at system startup. Cpumask_intersects really needs to be
a 3-way intersect, and since we need a cpumask_var_t later on,
then just use it for the 3-way intersect as well.

Based on:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
+ git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git/cpus4096
+ git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-ingo.git

Signed-off-by: Mike Travis <travis@xxxxxxx>
---
arch/x86/kernel/io_apic.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)

--- linux-2.6-for-ingo.orig/arch/x86/kernel/io_apic.c
+++ linux-2.6-for-ingo/arch/x86/kernel/io_apic.c
@@ -1084,15 +1084,19 @@ static int __assign_irq_vector(int irq,
if ((cfg->move_in_progress) || cfg->move_cleanup_count)
return -EBUSY;

+ if (!alloc_cpumask_var(&tmp_mask, GFP_ATOMIC))
+ return -ENOMEM;
+
old_vector = cfg->vector;
if (old_vector) {
- if (!cpumask_intersects(mask, cpu_online_mask))
- return 0;
+ cpumask_and(tmp_mask, mask, cpu_online_mask);
+ cpumask_and(tmp_mask, cfg->domain, tmp_mask);
+ if (!cpumask_empty(tmp_mask)) {
+ free_cpumask_var(tmp_mask);
+ return 0;
+ }
}

- if (!alloc_cpumask_var(&tmp_mask, GFP_ATOMIC))
- return -ENOMEM;
-
/* Only try and allocate irqs on cpus that are present */
err = -ENOSPC;
for_each_cpu_and(cpu, mask, cpu_online_mask) {

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/