Commit b50ae26c authored by Peng Li's avatar Peng Li Committed by David S. Miller

net: hns3: never send command queue message to IMP when reset

IMP will not handle and command queue message any more when it is
in core/global, driver should not send command queue message to
IMP until reinitialize the NIC HW.

This patch checks the status and avoid the message sent to IMP when
reset.
Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ea739c90
...@@ -3584,6 +3584,9 @@ static int hclge_unmap_ring_frm_vector(struct hnae3_handle *handle, ...@@ -3584,6 +3584,9 @@ static int hclge_unmap_ring_frm_vector(struct hnae3_handle *handle,
struct hclge_dev *hdev = vport->back; struct hclge_dev *hdev = vport->back;
int vector_id, ret; int vector_id, ret;
if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state))
return 0;
vector_id = hclge_get_vector_index(hdev, vector); vector_id = hclge_get_vector_index(hdev, vector);
if (vector_id < 0) { if (vector_id < 0) {
dev_err(&handle->pdev->dev, dev_err(&handle->pdev->dev,
...@@ -3781,13 +3784,16 @@ static int hclge_ae_start(struct hnae3_handle *handle) ...@@ -3781,13 +3784,16 @@ static int hclge_ae_start(struct hnae3_handle *handle)
clear_bit(HCLGE_STATE_DOWN, &hdev->state); clear_bit(HCLGE_STATE_DOWN, &hdev->state);
mod_timer(&hdev->service_timer, jiffies + HZ); mod_timer(&hdev->service_timer, jiffies + HZ);
/* reset tqp stats */
hclge_reset_tqp_stats(handle);
if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state))
return 0;
ret = hclge_mac_start_phy(hdev); ret = hclge_mac_start_phy(hdev);
if (ret) if (ret)
return ret; return ret;
/* reset tqp stats */
hclge_reset_tqp_stats(handle);
return 0; return 0;
} }
...@@ -3797,6 +3803,12 @@ static void hclge_ae_stop(struct hnae3_handle *handle) ...@@ -3797,6 +3803,12 @@ static void hclge_ae_stop(struct hnae3_handle *handle)
struct hclge_dev *hdev = vport->back; struct hclge_dev *hdev = vport->back;
int i; int i;
del_timer_sync(&hdev->service_timer);
cancel_work_sync(&hdev->service_task);
if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state))
return;
for (i = 0; i < vport->alloc_tqps; i++) for (i = 0; i < vport->alloc_tqps; i++)
hclge_tqp_enable(hdev, i, 0, false); hclge_tqp_enable(hdev, i, 0, false);
...@@ -3807,8 +3819,6 @@ static void hclge_ae_stop(struct hnae3_handle *handle) ...@@ -3807,8 +3819,6 @@ static void hclge_ae_stop(struct hnae3_handle *handle)
/* reset tqp stats */ /* reset tqp stats */
hclge_reset_tqp_stats(handle); hclge_reset_tqp_stats(handle);
del_timer_sync(&hdev->service_timer);
cancel_work_sync(&hdev->service_task);
hclge_update_link_status(hdev); hclge_update_link_status(hdev);
} }
...@@ -4940,6 +4950,9 @@ void hclge_reset_tqp(struct hnae3_handle *handle, u16 queue_id) ...@@ -4940,6 +4950,9 @@ void hclge_reset_tqp(struct hnae3_handle *handle, u16 queue_id)
u16 queue_gid; u16 queue_gid;
int ret; int ret;
if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state))
return;
queue_gid = hclge_covert_handle_qid_global(handle, queue_id); queue_gid = hclge_covert_handle_qid_global(handle, queue_id);
ret = hclge_tqp_enable(hdev, queue_id, 0, false); ret = hclge_tqp_enable(hdev, queue_id, 0, false);
......
...@@ -60,6 +60,9 @@ static int hclge_mdio_write(struct mii_bus *bus, int phyid, int regnum, ...@@ -60,6 +60,9 @@ static int hclge_mdio_write(struct mii_bus *bus, int phyid, int regnum,
struct hclge_desc desc; struct hclge_desc desc;
int ret; int ret;
if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state))
return 0;
hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_MDIO_CONFIG, false); hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_MDIO_CONFIG, false);
mdio_cmd = (struct hclge_mdio_cfg_cmd *)desc.data; mdio_cmd = (struct hclge_mdio_cfg_cmd *)desc.data;
...@@ -95,6 +98,9 @@ static int hclge_mdio_read(struct mii_bus *bus, int phyid, int regnum) ...@@ -95,6 +98,9 @@ static int hclge_mdio_read(struct mii_bus *bus, int phyid, int regnum)
struct hclge_desc desc; struct hclge_desc desc;
int ret; int ret;
if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state))
return 0;
hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_MDIO_CONFIG, true); hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_MDIO_CONFIG, true);
mdio_cmd = (struct hclge_mdio_cfg_cmd *)desc.data; mdio_cmd = (struct hclge_mdio_cfg_cmd *)desc.data;
......
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