History

genirq: Wake up irq thread after action has been installed

The wake_up_process() of the new irq thread in __setup_irq() is too early as the irqaction is not yet fully initialized especially action->irq is not yet set. The interrupt thread might dereference the wrong irq descriptor. Move the wakeup after the action is installed and action->irq has been set.

Thomas Gleixner committed 17 years ago

Commit 69ab8491 parent 2d860ad1 file · +8 −2Browse files

Unified · Split

kernel/irq/manage.c+8−2
@@ -607,7 +607,6 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) · 606 unmodified lines
607 */607 */
608 get_task_struct(t);608 get_task_struct(t);
609 new->thread = t;609 new->thread = t;
610 wake_up_process(t);
611 }610 }
612 611
613 /*612 /*
@@ -690,6 +689,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) · 76 unmodified lines
690 (int)(new->flags & IRQF_TRIGGER_MASK));689 (int)(new->flags & IRQF_TRIGGER_MASK));
691 }690 }
692 691
692 new->irq = irq;
693 *old_ptr = new;693 *old_ptr = new;
694 694
695 /* Reset broken irq detection when installing new handler */695 /* Reset broken irq detection when installing new handler */
@@ -707,7 +707,13 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) · 11 unmodified lines
707 707
708 spin_unlock_irqrestore(&desc->lock, flags);708 spin_unlock_irqrestore(&desc->lock, flags);
709 709
710 new->irq = irq;710 /*
711 * Strictly no need to wake it up, but hung_task complains
712 * when no hard interrupt wakes the thread up.
713 */
714 if (new->thread)
715 wake_up_process(new->thread);
716
711 register_irq_proc(irq, desc);717 register_irq_proc(irq, desc);
712 new->dir = NULL;718 new->dir = NULL;
713 register_handler_proc(irq, new);719 register_handler_proc(irq, new);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t