diff mbox series

[3/7] nfp: Use IRQF_NO_AUTOEN flag in request_irq()

Message ID 20240909133034.1296930-4-ruanjinjie@huawei.com (mailing list archive)
State Not Applicable
Delegated to: Johannes Berg
Headers show
Series net: Use IRQF_NO_AUTOEN flag in request_irq() | expand

Commit Message

Jinjie Ruan Sept. 9, 2024, 1:30 p.m. UTC
disable_irq() after request_irq() still has a time gap in which
interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will
disable IRQ auto-enable when request IRQ.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
 drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Louis Peens Sept. 10, 2024, 9:53 a.m. UTC | #1
On Mon, Sep 09, 2024 at 09:30:30PM +0800, Jinjie Ruan wrote:
> [Some people who received this message don't often get email from ruanjinjie@huawei.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> disable_irq() after request_irq() still has a time gap in which
> interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will
> disable IRQ auto-enable when request IRQ.
> 
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> ---
>  drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
Hi, thanks for propagating this. For the nfp driver:

Signed-off-by: Louis Peens <louis.peens@corigine.com>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
index 182ba0a8b095..6e0929af0f72 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
@@ -821,14 +821,13 @@  nfp_net_prepare_vector(struct nfp_net *nn, struct nfp_net_r_vector *r_vec,
 
 	snprintf(r_vec->name, sizeof(r_vec->name),
 		 "%s-rxtx-%d", nfp_net_name(nn), idx);
-	err = request_irq(r_vec->irq_vector, r_vec->handler, 0, r_vec->name,
-			  r_vec);
+	err = request_irq(r_vec->irq_vector, r_vec->handler, IRQF_NO_AUTOEN,
+			  r_vec->name, r_vec);
 	if (err) {
 		nfp_net_napi_del(&nn->dp, r_vec);
 		nn_err(nn, "Error requesting IRQ %d\n", r_vec->irq_vector);
 		return err;
 	}
-	disable_irq(r_vec->irq_vector);
 
 	irq_set_affinity_hint(r_vec->irq_vector, &r_vec->affinity_mask);