From: Yanling Song songyl@ramaxel.com
Ramaxel inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4P01N CVE: NA
Remove the code of polling mode since the driver only use interrupt mode and not use poll mode.
Signed-off-by: Yanling Song songyl@ramaxel.com Reviewed-by: Yang Gan yanggan@ramaxel.com Acked-by: Xie XiuQi xiexiuqi@huawei.com Acked-by: Xie XiuQi xiexiuqi@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- .../net/ethernet/ramaxel/spnic/hw/sphw_cmdq.c | 20 ++++--------------- .../net/ethernet/ramaxel/spnic/hw/sphw_crm.h | 2 -- .../net/ethernet/ramaxel/spnic/hw/sphw_eqs.c | 7 +------ .../ethernet/ramaxel/spnic/hw/sphw_hwdev.c | 1 - .../ethernet/ramaxel/spnic/hw/sphw_hwdev.h | 1 - .../net/ethernet/ramaxel/spnic/hw/sphw_mbox.c | 2 +- 6 files changed, 6 insertions(+), 27 deletions(-)
diff --git a/drivers/net/ethernet/ramaxel/spnic/hw/sphw_cmdq.c b/drivers/net/ethernet/ramaxel/spnic/hw/sphw_cmdq.c index 9cc44f15fa0e..b6aaadac19b9 100644 --- a/drivers/net/ethernet/ramaxel/spnic/hw/sphw_cmdq.c +++ b/drivers/net/ethernet/ramaxel/spnic/hw/sphw_cmdq.c @@ -533,22 +533,10 @@ static int cmdq_ceq_handler_status(struct sphw_cmdq *cmdq, { ulong timeo; int err; - ulong start = 0; - ulong end = timeout; - - if (cmdq->hwdev->poll) { - while (start < end) { - sphw_cmdq_ceq_handler(cmdq->hwdev, 0); - if (saved_cmd_info->done->done != 0) - return 0; - usleep_range(900, 1000); - start++; - } - } else { - timeo = msecs_to_jiffies(timeout); - if (wait_for_completion_timeout(saved_cmd_info->done, timeo)) - return 0; - } + + timeo = msecs_to_jiffies(timeout); + if (wait_for_completion_timeout(saved_cmd_info->done, timeo)) + return 0;
spin_lock_bh(&cmdq->cmdq_lock);
diff --git a/drivers/net/ethernet/ramaxel/spnic/hw/sphw_crm.h b/drivers/net/ethernet/ramaxel/spnic/hw/sphw_crm.h index bba3d2d501f2..8cce36698e3d 100644 --- a/drivers/net/ethernet/ramaxel/spnic/hw/sphw_crm.h +++ b/drivers/net/ethernet/ramaxel/spnic/hw/sphw_crm.h @@ -335,8 +335,6 @@ struct sphw_init_para { * need to trasmit message ppf mbox to bmgw arm host. */ void *ppf_hwdev; - /* if use polling mode, set it true */ - bool poll; };
/* B200 config BAR45 4MB, DB & DWQE both 2MB */ diff --git a/drivers/net/ethernet/ramaxel/spnic/hw/sphw_eqs.c b/drivers/net/ethernet/ramaxel/spnic/hw/sphw_eqs.c index 8f71d9de76c1..24c55d656f9c 100644 --- a/drivers/net/ethernet/ramaxel/spnic/hw/sphw_eqs.c +++ b/drivers/net/ethernet/ramaxel/spnic/hw/sphw_eqs.c @@ -392,12 +392,7 @@ static void set_eq_cons_idx(struct sphw_eq *eq, u32 arm_state) u32 addr = EQ_CI_SIMPLE_INDIR_REG_ADDR(eq);
eq_wrap_ci = EQ_CONS_IDX(eq); - - /* if use poll mode only eq0 use int_arm mode */ - if (eq->q_id != 0 && eq->hwdev->poll) - val = EQ_CI_SIMPLE_INDIR_SET(SPHW_EQ_NOT_ARMED, ARMED); - else - val = EQ_CI_SIMPLE_INDIR_SET(arm_state, ARMED); + val = EQ_CI_SIMPLE_INDIR_SET(arm_state, ARMED); if (eq->type == SPHW_AEQ) { val = val | EQ_CI_SIMPLE_INDIR_SET(eq_wrap_ci, CI) | diff --git a/drivers/net/ethernet/ramaxel/spnic/hw/sphw_hwdev.c b/drivers/net/ethernet/ramaxel/spnic/hw/sphw_hwdev.c index 8eda93a5c5bd..783fa46bcfe5 100644 --- a/drivers/net/ethernet/ramaxel/spnic/hw/sphw_hwdev.c +++ b/drivers/net/ethernet/ramaxel/spnic/hw/sphw_hwdev.c @@ -938,7 +938,6 @@ int sphw_init_hwdev(struct sphw_init_para *para) hwdev->pcidev_hdl = para->pcidev_hdl; hwdev->dev_hdl = para->dev_hdl; hwdev->chip_node = para->chip_node; - hwdev->poll = para->poll;
hwdev->chip_fault_stats = vzalloc(SPHW_CHIP_FAULT_SIZE); if (!hwdev->chip_fault_stats) diff --git a/drivers/net/ethernet/ramaxel/spnic/hw/sphw_hwdev.h b/drivers/net/ethernet/ramaxel/spnic/hw/sphw_hwdev.h index 83f9a6630c8b..10da31bda3d2 100644 --- a/drivers/net/ethernet/ramaxel/spnic/hw/sphw_hwdev.h +++ b/drivers/net/ethernet/ramaxel/spnic/hw/sphw_hwdev.h @@ -42,7 +42,6 @@ struct sphw_hwdev {
u32 wq_page_size; int chip_present_flag; - bool poll; /*use polling mode or int mode*/
struct sphw_hwif *hwif; /* include void __iomem *bar */ struct comm_global_attr glb_attr; diff --git a/drivers/net/ethernet/ramaxel/spnic/hw/sphw_mbox.c b/drivers/net/ethernet/ramaxel/spnic/hw/sphw_mbox.c index 672882190907..8abb47422bdd 100644 --- a/drivers/net/ethernet/ramaxel/spnic/hw/sphw_mbox.c +++ b/drivers/net/ethernet/ramaxel/spnic/hw/sphw_mbox.c @@ -1062,7 +1062,7 @@ static int send_mbox_msg(struct sphw_mbox *func_to_func, u8 mod, u16 cmd, u8 *msg_seg = NULL; u64 header = 0;
- if (hwdev->poll || hwdev->hwif->attr.num_aeqs >= 2) + if (hwdev->hwif->attr.num_aeqs >= 2) rsp_aeq_id = SPHW_MBOX_RSP_MSG_AEQ; else rsp_aeq_id = 0;