提交 4234319d 编写于 作者: S Shunfeng Yang 提交者: Yang Yingliang

RDMA/hns: Fix bug during CMDQ initialization

mainline inclusion
from mainline-v5.13
commit af06b628
category: bugfix
bugzilla: NA
CVE: NA

When re-insmod hns-roce-hw-v2.ko and init CMDQ, we need to reinit PI and CI of CMDQ.
But, after last rmmod hns-roce-hw-v2.ko, the CMDQ is NOT reset, firmware still is waiting software to send cmd..
So,  if we re-init PI first, the firmware would thought that the software sent new cmds. then it start to process CMDQ.
It may be a long time for driver. If driver start to init hardware and really send cmds, the status of PI and CI are unexpected.
Signed-off-by: NShunfeng Yang <yangshunfeng2@huawei.com>
Signed-off-by: NYangyang Li <liyangyang20@huawei.com>
Reviewed-by: Nchunzhi hu <huchunzhi@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 13a82e56
......@@ -1039,8 +1039,10 @@ static void hns_roce_cmq_init_regs(struct hns_roce_dev *hr_dev, bool ring_type)
upper_32_bits(dma));
roce_write(hr_dev, ROCEE_TX_CMQ_DEPTH_REG,
ring->desc_num >> HNS_ROCE_CMQ_DESC_NUM_S);
roce_write(hr_dev, ROCEE_TX_CMQ_HEAD_REG, 0);
/* Make sure to write tail first and then head */
roce_write(hr_dev, ROCEE_TX_CMQ_TAIL_REG, 0);
roce_write(hr_dev, ROCEE_TX_CMQ_HEAD_REG, 0);
} else {
roce_write(hr_dev, ROCEE_RX_CMQ_BASEADDR_L_REG, (u32)dma);
roce_write(hr_dev, ROCEE_RX_CMQ_BASEADDR_H_REG,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册