|
@@ -347,14 +347,22 @@ int check_irq_vectors_for_cpu_disable(void)
|
|
if (!desc)
|
|
if (!desc)
|
|
continue;
|
|
continue;
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * Protect against concurrent action removal,
|
|
|
|
+ * affinity changes etc.
|
|
|
|
+ */
|
|
|
|
+ raw_spin_lock(&desc->lock);
|
|
data = irq_desc_get_irq_data(desc);
|
|
data = irq_desc_get_irq_data(desc);
|
|
cpumask_copy(&affinity_new, data->affinity);
|
|
cpumask_copy(&affinity_new, data->affinity);
|
|
cpumask_clear_cpu(this_cpu, &affinity_new);
|
|
cpumask_clear_cpu(this_cpu, &affinity_new);
|
|
|
|
|
|
/* Do not count inactive or per-cpu irqs. */
|
|
/* Do not count inactive or per-cpu irqs. */
|
|
- if (!irq_has_action(irq) || irqd_is_per_cpu(data))
|
|
|
|
|
|
+ if (!irq_has_action(irq) || irqd_is_per_cpu(data)) {
|
|
|
|
+ raw_spin_unlock(&desc->lock);
|
|
continue;
|
|
continue;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ raw_spin_unlock(&desc->lock);
|
|
/*
|
|
/*
|
|
* A single irq may be mapped to multiple
|
|
* A single irq may be mapped to multiple
|
|
* cpu's vector_irq[] (for example IOAPIC cluster
|
|
* cpu's vector_irq[] (for example IOAPIC cluster
|
|
@@ -385,6 +393,9 @@ int check_irq_vectors_for_cpu_disable(void)
|
|
* vector. If the vector is marked in the used vectors
|
|
* vector. If the vector is marked in the used vectors
|
|
* bitmap or an irq is assigned to it, we don't count
|
|
* bitmap or an irq is assigned to it, we don't count
|
|
* it as available.
|
|
* it as available.
|
|
|
|
+ *
|
|
|
|
+ * As this is an inaccurate snapshot anyway, we can do
|
|
|
|
+ * this w/o holding vector_lock.
|
|
*/
|
|
*/
|
|
for (vector = FIRST_EXTERNAL_VECTOR;
|
|
for (vector = FIRST_EXTERNAL_VECTOR;
|
|
vector < first_system_vector; vector++) {
|
|
vector < first_system_vector; vector++) {
|