Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1305220 > unrolled thread

[PATCH] irq: action setting before irq_startup

Started byYoshinori Sato <ysato@users.sourceforge.jp>
First post2016-01-09 13:00 +0100
Last post2016-01-10 11:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] irq: action setting before irq_startup Yoshinori Sato <ysato@users.sourceforge.jp> - 2016-01-09 13:00 +0100
    Re: [PATCH] irq: action setting before irq_startup Thomas Gleixner <tglx@linutronix.de> - 2016-01-10 11:20 +0100

#1305220 — [PATCH] irq: action setting before irq_startup

FromYoshinori Sato <ysato@users.sourceforge.jp>
Date2016-01-09 13:00 +0100
Subject[PATCH] irq: action setting before irq_startup
Message-ID<qP0lA-54s-13@gated-at.bofh.it>
In non shared and non threaded IRQ case.
irq_startup calling before desc->action initialize.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
---
 kernel/irq/manage.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 0eebaee..f6cdb63 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -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 */
-- 
2.6.1

[toc] | [next] | [standalone]


#1305529

FromThomas Gleixner <tglx@linutronix.de>
Date2016-01-10 11:20 +0100
Message-ID<qPlgm-2Ne-7@gated-at.bofh.it>
In reply to#1305220
On Sat, 9 Jan 2016, Yoshinori Sato wrote:

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

And how does that matter? 
 
> Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
> ---
>  kernel/irq/manage.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
> index 0eebaee..f6cdb63 100644
> --- a/kernel/irq/manage.c
> +++ b/kernel/irq/manage.c
> @@ -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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web