mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
x86/irq: Retrieve irq data after locking irq_desc
irq_data is protected by irq_desc->lock, so retrieving the irq chip from irq_data outside the lock is racy vs. an concurrent update. Move it into the lock held region. While at it add a comment why the vector walk does not require vector_lock. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: xiao jin <jin.xiao@intel.com> Cc: Joerg Roedel <jroedel@suse.de> Cc: Borislav Petkov <bp@suse.de> Cc: Yanmin Zhang <yanmin_zhang@linux.intel.com> Link: http://lkml.kernel.org/r/20150705171102.331320612@linutronix.de
This commit is contained in:
parent
cbb24dc761
commit
09cf92b784
1 changed files with 6 additions and 1 deletions
|
@ -497,6 +497,11 @@ void fixup_irqs(void)
|
||||||
*/
|
*/
|
||||||
mdelay(1);
|
mdelay(1);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We can walk the vector array of this cpu without holding
|
||||||
|
* vector_lock because the cpu is already marked !online, so
|
||||||
|
* nothing else will touch it.
|
||||||
|
*/
|
||||||
for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
|
for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; vector++) {
|
||||||
unsigned int irr;
|
unsigned int irr;
|
||||||
|
|
||||||
|
@ -508,9 +513,9 @@ void fixup_irqs(void)
|
||||||
irq = __this_cpu_read(vector_irq[vector]);
|
irq = __this_cpu_read(vector_irq[vector]);
|
||||||
|
|
||||||
desc = irq_to_desc(irq);
|
desc = irq_to_desc(irq);
|
||||||
|
raw_spin_lock(&desc->lock);
|
||||||
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);
|
|
||||||
if (chip->irq_retrigger) {
|
if (chip->irq_retrigger) {
|
||||||
chip->irq_retrigger(data);
|
chip->irq_retrigger(data);
|
||||||
__this_cpu_write(vector_irq[vector], VECTOR_RETRIGGERED);
|
__this_cpu_write(vector_irq[vector], VECTOR_RETRIGGERED);
|
||||||
|
|
Loading…
Add table
Reference in a new issue