All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: hns: use IRQ_NOAUTOEN to avoid irq is enabled due to request_irq
@ 2020-09-11  1:55 Barry Song
  2020-09-12  0:41 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Barry Song @ 2020-09-11  1:55 UTC (permalink / raw)
  To: davem, kuba, netdev; +Cc: linuxarm, Barry Song, Salil Mehta, Yunsheng Lin

Rather than doing request_irq and then disabling the irq immediately, it
should be safer to use IRQ_NOAUTOEN flag for the irq. It removes any gap
between request_irq() and disable_irq().

Cc: Salil Mehta <salil.mehta@huawei.com>
Reviewed-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
---
 drivers/net/ethernet/hisilicon/hns/hns_enet.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index 22522f8a5299..34cc469656e8 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
@@ -11,6 +11,7 @@
 #include <linux/io.h>
 #include <linux/ip.h>
 #include <linux/ipv6.h>
+#include <linux/irq.h>
 #include <linux/module.h>
 #include <linux/phy.h>
 #include <linux/platform_device.h>
@@ -1293,6 +1294,7 @@ static int hns_nic_init_irq(struct hns_nic_priv *priv)
 
 		rd->ring->ring_name[RCB_RING_NAME_LEN - 1] = '\0';
 
+		irq_set_status_flags(rd->ring->irq, IRQ_NOAUTOEN);
 		ret = request_irq(rd->ring->irq,
 				  hns_irq_handle, 0, rd->ring->ring_name, rd);
 		if (ret) {
@@ -1300,7 +1302,6 @@ static int hns_nic_init_irq(struct hns_nic_priv *priv)
 				   rd->ring->irq);
 			goto out_free_irq;
 		}
-		disable_irq(rd->ring->irq);
 
 		cpu = hns_nic_init_affinity_mask(h->q_num, i,
 						 rd->ring, &rd->mask);
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: hns: use IRQ_NOAUTOEN to avoid irq is enabled due to request_irq
  2020-09-11  1:55 [PATCH net-next] net: hns: use IRQ_NOAUTOEN to avoid irq is enabled due to request_irq Barry Song
@ 2020-09-12  0:41 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-09-12  0:41 UTC (permalink / raw)
  To: song.bao.hua; +Cc: kuba, netdev, linuxarm, salil.mehta, linyunsheng

From: Barry Song <song.bao.hua@hisilicon.com>
Date: Fri, 11 Sep 2020 13:55:10 +1200

> Rather than doing request_irq and then disabling the irq immediately, it
> should be safer to use IRQ_NOAUTOEN flag for the irq. It removes any gap
> between request_irq() and disable_irq().
> 
> Cc: Salil Mehta <salil.mehta@huawei.com>
> Reviewed-by: Yunsheng Lin <linyunsheng@huawei.com>
> Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-12  0:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-11  1:55 [PATCH net-next] net: hns: use IRQ_NOAUTOEN to avoid irq is enabled due to request_irq Barry Song
2020-09-12  0:41 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.