summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Song <song.bao.hua@hisilicon.com>2020-09-11 13:55:10 +1200
committerDavid S. Miller <davem@davemloft.net>2020-09-11 17:40:28 -0700
commit5a6bd84f815485800699f55c78f690b2ed35f0c5 (patch)
tree3f06d8a91da7db60d849a3dfcf4cab672bb77cac
parent1cf814a0dce9a9fd5d06e754a886a79ab91bf4f1 (diff)
downloadlinux-5a6bd84f815485800699f55c78f690b2ed35f0c5.tar.gz
linux-5a6bd84f815485800699f55c78f690b2ed35f0c5.tar.bz2
linux-5a6bd84f815485800699f55c78f690b2ed35f0c5.zip
net: hns: use IRQ_NOAUTOEN to avoid irq is enabled due to request_irq
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> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/hisilicon/hns/hns_enet.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index b658b9de81d7..3cdc65d38fb7 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>
@@ -1290,6 +1291,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) {
@@ -1297,7 +1299,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);