Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull IRQ changes from Ingo Molnar: "The only change in this cycle is a CPU hotplug related spurious warning fix" * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/irq: Fix kbuild warning in smp_irq_move_cleanup_interrupt() x86/irq: Fix do_IRQ() interrupt warning for cpu hotplug retriggered irqs
This commit is contained in:
Коммит
2cc3f16cad
|
@ -191,6 +191,9 @@ extern void (*__initconst interrupt[NR_VECTORS-FIRST_EXTERNAL_VECTOR])(void);
|
||||||
#define trace_interrupt interrupt
|
#define trace_interrupt interrupt
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define VECTOR_UNDEFINED -1
|
||||||
|
#define VECTOR_RETRIGGERED -2
|
||||||
|
|
||||||
typedef int vector_irq_t[NR_VECTORS];
|
typedef int vector_irq_t[NR_VECTORS];
|
||||||
DECLARE_PER_CPU(vector_irq_t, vector_irq);
|
DECLARE_PER_CPU(vector_irq_t, vector_irq);
|
||||||
extern void setup_vector_irq(int cpu);
|
extern void setup_vector_irq(int cpu);
|
||||||
|
|
|
@ -1142,9 +1142,10 @@ next:
|
||||||
if (test_bit(vector, used_vectors))
|
if (test_bit(vector, used_vectors))
|
||||||
goto next;
|
goto next;
|
||||||
|
|
||||||
for_each_cpu_and(new_cpu, tmp_mask, cpu_online_mask)
|
for_each_cpu_and(new_cpu, tmp_mask, cpu_online_mask) {
|
||||||
if (per_cpu(vector_irq, new_cpu)[vector] != -1)
|
if (per_cpu(vector_irq, new_cpu)[vector] > VECTOR_UNDEFINED)
|
||||||
goto next;
|
goto next;
|
||||||
|
}
|
||||||
/* Found one! */
|
/* Found one! */
|
||||||
current_vector = vector;
|
current_vector = vector;
|
||||||
current_offset = offset;
|
current_offset = offset;
|
||||||
|
@ -1183,7 +1184,7 @@ static void __clear_irq_vector(int irq, struct irq_cfg *cfg)
|
||||||
|
|
||||||
vector = cfg->vector;
|
vector = cfg->vector;
|
||||||
for_each_cpu_and(cpu, cfg->domain, cpu_online_mask)
|
for_each_cpu_and(cpu, cfg->domain, cpu_online_mask)
|
||||||
per_cpu(vector_irq, cpu)[vector] = -1;
|
per_cpu(vector_irq, cpu)[vector] = VECTOR_UNDEFINED;
|
||||||
|
|
||||||
cfg->vector = 0;
|
cfg->vector = 0;
|
||||||
cpumask_clear(cfg->domain);
|
cpumask_clear(cfg->domain);
|
||||||
|
@ -1191,11 +1192,10 @@ static void __clear_irq_vector(int irq, struct irq_cfg *cfg)
|
||||||
if (likely(!cfg->move_in_progress))
|
if (likely(!cfg->move_in_progress))
|
||||||
return;
|
return;
|
||||||
for_each_cpu_and(cpu, cfg->old_domain, cpu_online_mask) {
|
for_each_cpu_and(cpu, cfg->old_domain, cpu_online_mask) {
|
||||||
for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS;
|
for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
|
||||||
vector++) {
|
|
||||||
if (per_cpu(vector_irq, cpu)[vector] != irq)
|
if (per_cpu(vector_irq, cpu)[vector] != irq)
|
||||||
continue;
|
continue;
|
||||||
per_cpu(vector_irq, cpu)[vector] = -1;
|
per_cpu(vector_irq, cpu)[vector] = VECTOR_UNDEFINED;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1228,12 +1228,12 @@ void __setup_vector_irq(int cpu)
|
||||||
/* Mark the free vectors */
|
/* Mark the free vectors */
|
||||||
for (vector = 0; vector < NR_VECTORS; ++vector) {
|
for (vector = 0; vector < NR_VECTORS; ++vector) {
|
||||||
irq = per_cpu(vector_irq, cpu)[vector];
|
irq = per_cpu(vector_irq, cpu)[vector];
|
||||||
if (irq < 0)
|
if (irq <= VECTOR_UNDEFINED)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
cfg = irq_cfg(irq);
|
cfg = irq_cfg(irq);
|
||||||
if (!cpumask_test_cpu(cpu, cfg->domain))
|
if (!cpumask_test_cpu(cpu, cfg->domain))
|
||||||
per_cpu(vector_irq, cpu)[vector] = -1;
|
per_cpu(vector_irq, cpu)[vector] = VECTOR_UNDEFINED;
|
||||||
}
|
}
|
||||||
raw_spin_unlock(&vector_lock);
|
raw_spin_unlock(&vector_lock);
|
||||||
}
|
}
|
||||||
|
@ -2202,13 +2202,13 @@ asmlinkage void smp_irq_move_cleanup_interrupt(void)
|
||||||
|
|
||||||
me = smp_processor_id();
|
me = smp_processor_id();
|
||||||
for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
|
for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
|
||||||
unsigned int irq;
|
int irq;
|
||||||
unsigned int irr;
|
unsigned int irr;
|
||||||
struct irq_desc *desc;
|
struct irq_desc *desc;
|
||||||
struct irq_cfg *cfg;
|
struct irq_cfg *cfg;
|
||||||
irq = __this_cpu_read(vector_irq[vector]);
|
irq = __this_cpu_read(vector_irq[vector]);
|
||||||
|
|
||||||
if (irq == -1)
|
if (irq <= VECTOR_UNDEFINED)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
desc = irq_to_desc(irq);
|
desc = irq_to_desc(irq);
|
||||||
|
|
|
@ -193,9 +193,13 @@ __visible unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
|
||||||
if (!handle_irq(irq, regs)) {
|
if (!handle_irq(irq, regs)) {
|
||||||
ack_APIC_irq();
|
ack_APIC_irq();
|
||||||
|
|
||||||
if (printk_ratelimit())
|
if (irq != VECTOR_RETRIGGERED) {
|
||||||
pr_emerg("%s: %d.%d No irq handler for vector (irq %d)\n",
|
pr_emerg_ratelimited("%s: %d.%d No irq handler for vector (irq %d)\n",
|
||||||
__func__, smp_processor_id(), vector, irq);
|
__func__, smp_processor_id(),
|
||||||
|
vector, irq);
|
||||||
|
} else {
|
||||||
|
__this_cpu_write(vector_irq[vector], VECTOR_UNDEFINED);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
irq_exit();
|
irq_exit();
|
||||||
|
@ -344,7 +348,7 @@ void fixup_irqs(void)
|
||||||
for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
|
for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
|
||||||
unsigned int irr;
|
unsigned int irr;
|
||||||
|
|
||||||
if (__this_cpu_read(vector_irq[vector]) < 0)
|
if (__this_cpu_read(vector_irq[vector]) <= VECTOR_UNDEFINED)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
irr = apic_read(APIC_IRR + (vector / 32 * 0x10));
|
irr = apic_read(APIC_IRR + (vector / 32 * 0x10));
|
||||||
|
@ -355,11 +359,14 @@ void fixup_irqs(void)
|
||||||
data = irq_desc_get_irq_data(desc);
|
data = irq_desc_get_irq_data(desc);
|
||||||
chip = irq_data_get_irq_chip(data);
|
chip = irq_data_get_irq_chip(data);
|
||||||
raw_spin_lock(&desc->lock);
|
raw_spin_lock(&desc->lock);
|
||||||
if (chip->irq_retrigger)
|
if (chip->irq_retrigger) {
|
||||||
chip->irq_retrigger(data);
|
chip->irq_retrigger(data);
|
||||||
|
__this_cpu_write(vector_irq[vector], VECTOR_RETRIGGERED);
|
||||||
|
}
|
||||||
raw_spin_unlock(&desc->lock);
|
raw_spin_unlock(&desc->lock);
|
||||||
}
|
}
|
||||||
__this_cpu_write(vector_irq[vector], -1);
|
if (__this_cpu_read(vector_irq[vector]) != VECTOR_RETRIGGERED)
|
||||||
|
__this_cpu_write(vector_irq[vector], VECTOR_UNDEFINED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -52,7 +52,7 @@ static struct irqaction irq2 = {
|
||||||
};
|
};
|
||||||
|
|
||||||
DEFINE_PER_CPU(vector_irq_t, vector_irq) = {
|
DEFINE_PER_CPU(vector_irq_t, vector_irq) = {
|
||||||
[0 ... NR_VECTORS - 1] = -1,
|
[0 ... NR_VECTORS - 1] = VECTOR_UNDEFINED,
|
||||||
};
|
};
|
||||||
|
|
||||||
int vector_used_by_percpu_irq(unsigned int vector)
|
int vector_used_by_percpu_irq(unsigned int vector)
|
||||||
|
@ -60,7 +60,7 @@ int vector_used_by_percpu_irq(unsigned int vector)
|
||||||
int cpu;
|
int cpu;
|
||||||
|
|
||||||
for_each_online_cpu(cpu) {
|
for_each_online_cpu(cpu) {
|
||||||
if (per_cpu(vector_irq, cpu)[vector] != -1)
|
if (per_cpu(vector_irq, cpu)[vector] > VECTOR_UNDEFINED)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче