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
607607 */
608608 get_task_struct(t);
609609 new->thread = t;
610− wake_up_process(t);
611610 }
612611
613612 /*
@@ -690,6 +689,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) · 76 unmodified lines
690689 (int)(new->flags & IRQF_TRIGGER_MASK));
691690 }
692691
692+ new->irq = irq;
693693 *old_ptr = new;
694694
695695 /* 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
707707
708708 spin_unlock_irqrestore(&desc->lock, flags);
709709
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+
711717 register_irq_proc(irq, desc);
712718 new->dir = NULL;
713719 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