Commit f6762f38 authored by Huazhong Tan's avatar Huazhong Tan Committed by David S. Miller

net: hns3: remove a redundant hclge_cmd_csq_done

Set complete in the first hclge_cmd_csq_done of hclge_cmd_send,
and check if complete later, unnecessary to do hclge_cmd_csq_done
again.
Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1c1270da
...@@ -242,15 +242,18 @@ int hclge_cmd_send(struct hclge_hw *hw, struct hclge_desc *desc, int num) ...@@ -242,15 +242,18 @@ int hclge_cmd_send(struct hclge_hw *hw, struct hclge_desc *desc, int num)
*/ */
if (HCLGE_SEND_SYNC(le16_to_cpu(desc->flag))) { if (HCLGE_SEND_SYNC(le16_to_cpu(desc->flag))) {
do { do {
if (hclge_cmd_csq_done(hw)) if (hclge_cmd_csq_done(hw)) {
complete = true;
break; break;
}
udelay(1); udelay(1);
timeout++; timeout++;
} while (timeout < hw->cmq.tx_timeout); } while (timeout < hw->cmq.tx_timeout);
} }
if (hclge_cmd_csq_done(hw)) { if (!complete) {
complete = true; retval = -EAGAIN;
} else {
handle = 0; handle = 0;
while (handle < num) { while (handle < num) {
/* Get the result of hardware write back */ /* Get the result of hardware write back */
...@@ -274,9 +277,6 @@ int hclge_cmd_send(struct hclge_hw *hw, struct hclge_desc *desc, int num) ...@@ -274,9 +277,6 @@ int hclge_cmd_send(struct hclge_hw *hw, struct hclge_desc *desc, int num)
} }
} }
if (!complete)
retval = -EAGAIN;
/* Clean the command send queue */ /* Clean the command send queue */
handle = hclge_cmd_csq_clean(hw); handle = hclge_cmd_csq_clean(hw);
if (handle != num) { if (handle != num) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment