Skip to contentSkip to conversation

irq: action setting before irq_startup

PATCH In review Yoshinori Sato 2 participants 2 messages Jan 9, 2016 – Jan 10, 2016 IRQ

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 irq: action setting before irq_startup

In non shared and non threaded IRQ case. irq_startup calling before desc->action initialize.

---
 kernel/irq/manage.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/irq/manage.c +2 -2
index 0eebaee..f6cdb63 100644
@@ -1272,6 +1272,8 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
 		goto out_mask;
 	}
 
+	*old_ptr = new;
+
 	if (!shared) {
 		ret = irq_request_resources(desc);
 		if (ret) {
@@ -1328,8 +1330,6 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
 				   irq, nmsk, omsk);
 	}
 
-	*old_ptr = new;
-
 	irq_pm_install_action(desc, new);
 
 	/* Reset broken irq detection when installing new handler */
Signature · 1 line
2.6.1
#1 lore raw
Quoted 2 lines · Yoshinori Sato

In non shared and non threaded IRQ case. irq_startup calling before desc->action initialize.

And how does that matter?

Quoted 10 lines
---
 kernel/irq/manage.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/irq/manage.c +0 -0
index 0eebaee..f6cdb63 100644

kernel/irq/manage.c __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) · line 1279

Quoted 8 lines
kernel/irq/manage.c +2 -0
@@ -1272,6 +1272,8 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
 		goto out_mask;
 	}
 
+	*old_ptr = new;
+
 	if (!shared) {
 		ret = irq_request_resources(desc);
 		if (ret) {

So in case irq_request_resources() fails, you leak the action in the irq descriptor.

Again, what's the problem you are trying to solve?

Thanks,

tglx