Skip to content

Commit bdd6558

Browse files
KAGA-KOKOIngo Molnar
authored andcommitted
x86/i8259: Use printk_deferred() to prevent deadlock
0day reported a possible circular locking dependency: Chain exists of: &irq_desc_lock_class --> console_owner --> &port_lock_key Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&port_lock_key); lock(console_owner); lock(&port_lock_key); lock(&irq_desc_lock_class); The reason for this is a printk() in the i8259 interrupt chip driver which is invoked with the irq descriptor lock held, which reverses the lock operations vs. printk() from arbitrary contexts. Switch the printk() to printk_deferred() to avoid that. Reported-by: kernel test robot <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected]
1 parent 92ed301 commit bdd6558

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kernel/i8259.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static void mask_and_ack_8259A(struct irq_data *data)
207207
* lets ACK and report it. [once per IRQ]
208208
*/
209209
if (!(spurious_irq_mask & irqmask)) {
210-
printk(KERN_DEBUG
210+
printk_deferred(KERN_DEBUG
211211
"spurious 8259A interrupt: IRQ%d.\n", irq);
212212
spurious_irq_mask |= irqmask;
213213
}

0 commit comments

Comments
 (0)