提交 826e82ed 编写于 作者: H Haoyue Xu 提交者: Zheng Zengkai

RDMA/hns: Fix the wrong type of return value of the interrupt handler

mainline inclusion
from mainline-for-next
commit d95e0a0c
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5IZO5
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/commit/?id=d95e0a0c6c9602ff6bb90c1c20987b204493d8e1

----------------------------------------------------------------------

The type of return value of the interrupt handler should be irqreturn_t.

Link: https://lore.kernel.org/r/20220714134353.16700-3-liangwenpeng@huawei.comSigned-off-by: NHaoyue Xu <xuhaoyue1@hisilicon.com>
Signed-off-by: NWenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: NLeon Romanovsky <leon@kernel.org>
Signed-off-by: NZhengfeng Luo <luozhengfeng@h-partners.com>
Reviewed-by: NYangyang Li <liyangyang20@huawei.com>
Reviewed-by: NYue Haibing <yuehaibing@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 7a2e51cf
...@@ -5501,12 +5501,12 @@ static struct hns_roce_aeqe *next_aeqe_sw_v2(struct hns_roce_eq *eq) ...@@ -5501,12 +5501,12 @@ static struct hns_roce_aeqe *next_aeqe_sw_v2(struct hns_roce_eq *eq)
!!(eq->cons_index & eq->entries)) ? aeqe : NULL; !!(eq->cons_index & eq->entries)) ? aeqe : NULL;
} }
static int hns_roce_v2_aeq_int(struct hns_roce_dev *hr_dev, static irqreturn_t hns_roce_v2_aeq_int(struct hns_roce_dev *hr_dev,
struct hns_roce_eq *eq) struct hns_roce_eq *eq)
{ {
struct device *dev = hr_dev->dev; struct device *dev = hr_dev->dev;
struct hns_roce_aeqe *aeqe = next_aeqe_sw_v2(eq); struct hns_roce_aeqe *aeqe = next_aeqe_sw_v2(eq);
int aeqe_found = 0; irqreturn_t aeqe_found = IRQ_NONE;
int event_type; int event_type;
u32 queue_num; u32 queue_num;
int sub_type; int sub_type;
...@@ -5560,7 +5560,7 @@ static int hns_roce_v2_aeq_int(struct hns_roce_dev *hr_dev, ...@@ -5560,7 +5560,7 @@ static int hns_roce_v2_aeq_int(struct hns_roce_dev *hr_dev,
eq->event_type = event_type; eq->event_type = event_type;
eq->sub_type = sub_type; eq->sub_type = sub_type;
++eq->cons_index; ++eq->cons_index;
aeqe_found = 1; aeqe_found = IRQ_HANDLED;
hns_roce_v2_init_irq_work(hr_dev, eq, queue_num); hns_roce_v2_init_irq_work(hr_dev, eq, queue_num);
...@@ -5568,7 +5568,8 @@ static int hns_roce_v2_aeq_int(struct hns_roce_dev *hr_dev, ...@@ -5568,7 +5568,8 @@ static int hns_roce_v2_aeq_int(struct hns_roce_dev *hr_dev,
} }
update_eq_db(eq); update_eq_db(eq);
return aeqe_found;
return IRQ_RETVAL(aeqe_found);
} }
static struct hns_roce_ceqe *next_ceqe_sw_v2(struct hns_roce_eq *eq) static struct hns_roce_ceqe *next_ceqe_sw_v2(struct hns_roce_eq *eq)
...@@ -5583,11 +5584,11 @@ static struct hns_roce_ceqe *next_ceqe_sw_v2(struct hns_roce_eq *eq) ...@@ -5583,11 +5584,11 @@ static struct hns_roce_ceqe *next_ceqe_sw_v2(struct hns_roce_eq *eq)
!!(eq->cons_index & eq->entries)) ? ceqe : NULL; !!(eq->cons_index & eq->entries)) ? ceqe : NULL;
} }
static int hns_roce_v2_ceq_int(struct hns_roce_dev *hr_dev, static irqreturn_t hns_roce_v2_ceq_int(struct hns_roce_dev *hr_dev,
struct hns_roce_eq *eq) struct hns_roce_eq *eq)
{ {
struct hns_roce_ceqe *ceqe = next_ceqe_sw_v2(eq); struct hns_roce_ceqe *ceqe = next_ceqe_sw_v2(eq);
int ceqe_found = 0; irqreturn_t ceqe_found = IRQ_NONE;
u32 cqn; u32 cqn;
while (ceqe) { while (ceqe) {
...@@ -5601,21 +5602,21 @@ static int hns_roce_v2_ceq_int(struct hns_roce_dev *hr_dev, ...@@ -5601,21 +5602,21 @@ static int hns_roce_v2_ceq_int(struct hns_roce_dev *hr_dev,
hns_roce_cq_completion(hr_dev, cqn); hns_roce_cq_completion(hr_dev, cqn);
++eq->cons_index; ++eq->cons_index;
ceqe_found = 1; ceqe_found = IRQ_HANDLED;
ceqe = next_ceqe_sw_v2(eq); ceqe = next_ceqe_sw_v2(eq);
} }
update_eq_db(eq); update_eq_db(eq);
return ceqe_found; return IRQ_RETVAL(ceqe_found);
} }
static irqreturn_t hns_roce_v2_msix_interrupt_eq(int irq, void *eq_ptr) static irqreturn_t hns_roce_v2_msix_interrupt_eq(int irq, void *eq_ptr)
{ {
struct hns_roce_eq *eq = eq_ptr; struct hns_roce_eq *eq = eq_ptr;
struct hns_roce_dev *hr_dev = eq->hr_dev; struct hns_roce_dev *hr_dev = eq->hr_dev;
int int_work; irqreturn_t int_work;
if (eq->type_flag == HNS_ROCE_CEQ) if (eq->type_flag == HNS_ROCE_CEQ)
/* Completion event interrupt */ /* Completion event interrupt */
...@@ -5631,7 +5632,7 @@ static irqreturn_t hns_roce_v2_msix_interrupt_abn(int irq, void *dev_id) ...@@ -5631,7 +5632,7 @@ static irqreturn_t hns_roce_v2_msix_interrupt_abn(int irq, void *dev_id)
{ {
struct hns_roce_dev *hr_dev = dev_id; struct hns_roce_dev *hr_dev = dev_id;
struct device *dev = hr_dev->dev; struct device *dev = hr_dev->dev;
int int_work = 0; irqreturn_t int_work = IRQ_NONE;
u32 int_st; u32 int_st;
u32 int_en; u32 int_en;
...@@ -5659,7 +5660,7 @@ static irqreturn_t hns_roce_v2_msix_interrupt_abn(int irq, void *dev_id) ...@@ -5659,7 +5660,7 @@ static irqreturn_t hns_roce_v2_msix_interrupt_abn(int irq, void *dev_id)
int_en |= 1 << HNS_ROCE_V2_VF_ABN_INT_EN_S; int_en |= 1 << HNS_ROCE_V2_VF_ABN_INT_EN_S;
roce_write(hr_dev, ROCEE_VF_ABN_INT_EN_REG, int_en); roce_write(hr_dev, ROCEE_VF_ABN_INT_EN_REG, int_en);
int_work = 1; int_work = IRQ_HANDLED;
} else { } else {
dev_err(dev, "There is no abnormal irq found!\n"); dev_err(dev, "There is no abnormal irq found!\n");
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册