]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
net: hns3: fix return value error while hclge_cmd_csq_clean failed
authorHuazhong Tan <tanhuazhong@huawei.com>
Wed, 1 Aug 2018 10:27:03 +0000 (18:27 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 14 Jan 2019 09:28:55 +0000 (09:28 +0000)
commit044d6ee5ef4fb95c9f1aceac1511829de919f6c8
tree69733f2ca3fd8070e4d924fcbb0028da497b6271
parentcabf2f0f695944b8a080cf5a75dc77a86a2efeff
net: hns3: fix return value error while hclge_cmd_csq_clean failed

BugLink: https://bugs.launchpad.net/bugs/1810457
While cleaning the command queue, the value of the HEAD register is not
in the range of next_to_clean and next_to_use, meaning that this value
is invalid. This also means that there is a hardware error and the
hardware will trigger a reset soon. At this time we should return an
error code instead of 0, and HCLGE_STATE_CMD_DISABLE needs to be set to
prevent sending command again.

Fixes: 3ff504908f95 ("net: hns3: fix a dead loop in hclge_cmd_csq_clean")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 4a62e252e888f67cb87caf36f48338889b0b8a43)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.c