diff options
| -rw-r--r-- | arch/x86/kernel/irq.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index 88b366487b0e..85ca76e6241c 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c | |||
| @@ -347,14 +347,22 @@ int check_irq_vectors_for_cpu_disable(void) | |||
| 347 | if (!desc) | 347 | if (!desc) |
| 348 | continue; | 348 | continue; |
| 349 | 349 | ||
| 350 | /* | ||
| 351 | * Protect against concurrent action removal, | ||
| 352 | * affinity changes etc. | ||
| 353 | */ | ||
| 354 | raw_spin_lock(&desc->lock); | ||
| 350 | data = irq_desc_get_irq_data(desc); | 355 | data = irq_desc_get_irq_data(desc); |
| 351 | cpumask_copy(&affinity_new, data->affinity); | 356 | cpumask_copy(&affinity_new, data->affinity); |
| 352 | cpumask_clear_cpu(this_cpu, &affinity_new); | 357 | cpumask_clear_cpu(this_cpu, &affinity_new); |
| 353 | 358 | ||
| 354 | /* Do not count inactive or per-cpu irqs. */ | 359 | /* Do not count inactive or per-cpu irqs. */ |
| 355 | if (!irq_has_action(irq) || irqd_is_per_cpu(data)) | 360 | if (!irq_has_action(irq) || irqd_is_per_cpu(data)) { |
| 361 | raw_spin_unlock(&desc->lock); | ||
| 356 | continue; | 362 | continue; |
| 363 | } | ||
| 357 | 364 | ||
| 365 | raw_spin_unlock(&desc->lock); | ||
| 358 | /* | 366 | /* |
| 359 | * A single irq may be mapped to multiple | 367 | * A single irq may be mapped to multiple |
| 360 | * cpu's vector_irq[] (for example IOAPIC cluster | 368 | * cpu's vector_irq[] (for example IOAPIC cluster |
| @@ -385,6 +393,9 @@ int check_irq_vectors_for_cpu_disable(void) | |||
| 385 | * vector. If the vector is marked in the used vectors | 393 | * vector. If the vector is marked in the used vectors |
| 386 | * bitmap or an irq is assigned to it, we don't count | 394 | * bitmap or an irq is assigned to it, we don't count |
| 387 | * it as available. | 395 | * it as available. |
| 396 | * | ||
| 397 | * As this is an inaccurate snapshot anyway, we can do | ||
| 398 | * this w/o holding vector_lock. | ||
| 388 | */ | 399 | */ |
| 389 | for (vector = FIRST_EXTERNAL_VECTOR; | 400 | for (vector = FIRST_EXTERNAL_VECTOR; |
| 390 | vector < first_system_vector; vector++) { | 401 | vector < first_system_vector; vector++) { |
