From: Barry Song song.bao.hua@hisilicon.com
mainline inclusion from mainline-v5.9-rc1 commit e99a308da3c1518009a740c4d3962f616edeb642 category: bugfix bugzilla: NA CVE: NA
----------------------------
disable_irq() after request_irq() is still risk as there is a chance irq can come after request_irq() and before disable_irq(). this should be done by IRQ_NOAUTOEN flag.
Signed-off-by: Barry Song song.bao.hua@hisilicon.com Signed-off-by: David S. Miller davem@davemloft.net Signed-off-by: Yonglong Liu liuyonglong@huawei.com Reviewed-by: li yongxin liyongxin1@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index 1db68d60794dd..6ff3ddcf06209 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -6,6 +6,7 @@ #include <linux/interrupt.h> #include <linux/cpu_rmap.h> #include <linux/if_vlan.h> +#include <linux/irq.h> #include <linux/ip.h> #include <linux/ipv6.h> #include <linux/module.h> @@ -155,6 +156,7 @@ static int hns3_nic_init_irq(struct hns3_nic_priv *priv)
tqp_vectors->name[HNAE3_INT_NAME_LEN - 1] = '\0';
+ irq_set_status_flags(tqp_vectors->vector_irq, IRQ_NOAUTOEN); ret = request_irq(tqp_vectors->vector_irq, hns3_irq_handle, 0, tqp_vectors->name, tqp_vectors); if (ret) { @@ -164,8 +166,6 @@ static int hns3_nic_init_irq(struct hns3_nic_priv *priv) return ret; }
- disable_irq(tqp_vectors->vector_irq); - irq_set_affinity_hint(tqp_vectors->vector_irq, &tqp_vectors->affinity_mask);