提交 0f6833b2 编写于 作者: L liweihang 提交者: Xie XiuQi

net: hns3: push back from kernel v5.1

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

There are some new review comments after previous patch about
hclge_cmd_check_retval() being merged. This patch aims to push back
these changes from kernel v5.1 to kernel-hulk v4.19.

Feature or Bugfix: Bugfix
Signed-off-by: Nliweihang <liweihang@huawei.com>
Reviewed-by: Nlipeng <lipeng321@huawei.com>
Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 4700cf13
......@@ -183,22 +183,22 @@ static bool hclge_is_special_opcode(u16 opcode)
return false;
}
static int hclge_cmd_check_retval(struct hclge_hw *hw,
struct hclge_desc *desc,
int num, int *ntc)
static int hclge_cmd_check_retval(struct hclge_hw *hw, struct hclge_desc *desc,
int num, int ntc)
{
struct hclge_desc *desc_to_use;
u16 opcode, desc_ret;
int handle = 0;
int retval = 0;
int handle;
int retval;
opcode = le16_to_cpu(desc[0].opcode);
while (handle < num) {
desc_to_use = &hw->cmq.csq.desc[*ntc];
desc[handle] = *desc_to_use;
for (handle = 0; handle < num; handle++) {
desc[handle] = hw->cmq.csq.desc[ntc];
ntc++;
if (ntc >= hw->cmq.csq.desc_num)
ntc = 0;
}
if (likely(!hclge_is_special_opcode(opcode)))
desc_ret = le16_to_cpu(desc[handle].retval);
desc_ret = le16_to_cpu(desc[num - 1].retval);
else
desc_ret = le16_to_cpu(desc[0].retval);
......@@ -213,15 +213,10 @@ static int hclge_cmd_check_retval(struct hclge_hw *hw,
else
retval = -EIO;
hw->cmq.last_status = desc_ret;
(*ntc)++;
handle++;
if (*ntc >= hw->cmq.csq.desc_num)
*ntc = 0;
}
return retval;
}
/**
* hclge_cmd_send - send command to command queue
* @hw: pointer to the hw struct
......@@ -284,7 +279,7 @@ int hclge_cmd_send(struct hclge_hw *hw, struct hclge_desc *desc, int num)
if (!complete) {
retval = -EAGAIN;
} else {
retval = hclge_cmd_check_retval(hw, desc, num, &ntc);
retval = hclge_cmd_check_retval(hw, desc, num, ntc);
}
/* Clean the command send queue */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册