2021-04-16 05:17:49

by zhuguangqing83

[permalink] [raw]
Subject: [PATCH] drivers: ipa: Fix missing IRQF_ONESHOT as only threaded handler

From: Guangqing Zhu <[email protected]>

Coccinelle noticed:
drivers/net/ipa/ipa_smp2p.c:186:7-27: ERROR: Threaded IRQ with no primary
handler requested without IRQF_ONESHOT

Signed-off-by: Guangqing Zhu <[email protected]>
---
drivers/net/ipa/ipa_smp2p.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ipa/ipa_smp2p.c b/drivers/net/ipa/ipa_smp2p.c
index a5f7a79a1923..74e04427a711 100644
--- a/drivers/net/ipa/ipa_smp2p.c
+++ b/drivers/net/ipa/ipa_smp2p.c
@@ -183,7 +183,8 @@ static int ipa_smp2p_irq_init(struct ipa_smp2p *smp2p, const char *name,
}
irq = ret;

- ret = request_threaded_irq(irq, NULL, handler, 0, name, smp2p);
+ ret = request_threaded_irq(irq, NULL, handler, IRQF_ONESHOT,
+ name, smp2p);
if (ret) {
dev_err(dev, "error %d requesting \"%s\" IRQ\n", ret, name);
return ret;
--
2.17.1


2021-04-16 08:49:13

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH] drivers: ipa: Fix missing IRQF_ONESHOT as only threaded handler

On Fri, 16 Apr 2021 at 06:26, <[email protected]> wrote:
>
> From: Guangqing Zhu <[email protected]>
>
> Coccinelle noticed:
> drivers/net/ipa/ipa_smp2p.c:186:7-27: ERROR: Threaded IRQ with no primary
> handler requested without IRQF_ONESHOT
>
> Signed-off-by: Guangqing Zhu <[email protected]>
> ---
> drivers/net/ipa/ipa_smp2p.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)

Did you test it? There are several patches like this all over the tree
so it looks like "let's fix everything from Coccinelle" because you
ignored at least in some of the cases that the handler is not the
default primary one. I am not saying that the change is bad, but
rather it looks automated and needs more consideration.

Best regards,
Krzysztof
Best regards,
Krzysztof

2021-04-16 14:07:11

by Alex Elder

[permalink] [raw]
Subject: Re: [PATCH] drivers: ipa: Fix missing IRQF_ONESHOT as only threaded handler

On 4/15/21 10:40 PM, [email protected] wrote:
> From: Guangqing Zhu <[email protected]>

This is not required here. -Alex

https://lore.kernel.org/netdev/[email protected]/

> Coccinelle noticed:
> drivers/net/ipa/ipa_smp2p.c:186:7-27: ERROR: Threaded IRQ with no primary
> handler requested without IRQF_ONESHOT
>
> Signed-off-by: Guangqing Zhu <[email protected]>
> ---
> drivers/net/ipa/ipa_smp2p.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ipa/ipa_smp2p.c b/drivers/net/ipa/ipa_smp2p.c
> index a5f7a79a1923..74e04427a711 100644
> --- a/drivers/net/ipa/ipa_smp2p.c
> +++ b/drivers/net/ipa/ipa_smp2p.c
> @@ -183,7 +183,8 @@ static int ipa_smp2p_irq_init(struct ipa_smp2p *smp2p, const char *name,
> }
> irq = ret;
>
> - ret = request_threaded_irq(irq, NULL, handler, 0, name, smp2p);
> + ret = request_threaded_irq(irq, NULL, handler, IRQF_ONESHOT,
> + name, smp2p);
> if (ret) {
> dev_err(dev, "error %d requesting \"%s\" IRQ\n", ret, name);
> return ret;
>