]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: hns3: stop mailbox handling when command queue need re-init
authorHuazhong Tan <tanhuazhong@huawei.com>
Sat, 6 Apr 2019 07:43:33 +0000 (15:43 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Apr 2019 22:30:49 +0000 (15:30 -0700)
If the command queue needs re-initialization, the mailbox handling
task should do nothing, otherwise this task will just get some error
print.

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

index 1c93da2bcb4bdb3491928acf92061732b6dd1415..11d9739caea5e721d5ce47f30314e180c2e3cff7 100644 (file)
@@ -2164,7 +2164,8 @@ static int hclge_mac_init(struct hclge_dev *hdev)
 
 static void hclge_mbx_task_schedule(struct hclge_dev *hdev)
 {
-       if (!test_and_set_bit(HCLGE_STATE_MBX_SERVICE_SCHED, &hdev->state))
+       if (!test_bit(HCLGE_STATE_CMD_DISABLE, &hdev->state) &&
+           !test_and_set_bit(HCLGE_STATE_MBX_SERVICE_SCHED, &hdev->state))
                schedule_work(&hdev->mbx_service_task);
 }