Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp812974imm; Fri, 1 Jun 2018 09:58:49 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJNMxcwYwbWZJtLx5CkiXYL4HCSk0A4pRfV/siw7D6Qt74zn4yLlRAlcqz966B9dkFcqmlQ X-Received: by 2002:a17:902:5a87:: with SMTP id r7-v6mr11989320pli.78.1527872329372; Fri, 01 Jun 2018 09:58:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527872329; cv=none; d=google.com; s=arc-20160816; b=aT+u/mJPC1fKeNzaJ+rYx1b9J9bFxbm1oNHrHPAjhoKaEkUJL20jgxLn0GlORuwf3l YTeQLuDObQHrxGoF8S+xIwdjz7iGLzAbRez96rj22/iSI9qj+p2/5yTNoou3o8B3g/DR FDkruN21R2+O/u61fQA2bRU/P5IZnCb4L+zTFhxJpK4PjkWM3A0mb6WRhKQFjtVaozQi P3qjBiHprOW5xuZaW2t7+Ia6e41juyrTvwL23BVxBVl2oOCWk+9LQq66xSVCCRmoWsIg G5dj2bsjObnDL6REOx9jwfKdGLpCnp6xzKZAvJENXekBXP47TqKGvoSM2AehJMNx7gdP 4sHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=z916/IqhHPiAycbPZG0mZiaB4rSNXr88ydGXAwo+0VE=; b=JBoUqjOw6Kps1prdHnzru3ZIE+qJWFEcxte44il6j4xoLtE5F2FhzaDZ3oddOjjAOZ /bg4Ef0bMETetKPvrOnJtSGrE0Ka+XVWxjYdAy3nmaKuGp6zpz7U7eGVz9tIFxW5QdAW 6uXuI1XCEFbq70E4uQwuRVkFL1RGmC1LmKlNbJwTGTX5N7CX2kEPzq+SWuDIbi4DvCqy n4CEyZ+zcLbKprcVDSIIgSjTUqhGgfaNJPg3KeLsdiTCET1KwNjCWICA7LhxyJavUGAX FONsfq1piH/4mIhk9DfzDLgDksr3c9fn2S8rWSovsMdwP0Xwbg8ga51FrpTPxyDQd+dO nDsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g194-v6si7618096pfb.280.2018.06.01.09.58.35; Fri, 01 Jun 2018 09:58:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753582AbeFAQ5r (ORCPT + 99 others); Fri, 1 Jun 2018 12:57:47 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:40993 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753197AbeFAQxz (ORCPT ); Fri, 1 Jun 2018 12:53:55 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 3C35C1E119BA6; Sat, 2 Jun 2018 00:53:51 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.227.234) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.382.0; Sat, 2 Jun 2018 00:53:46 +0800 From: Salil Mehta To: CC: , , , , , , , Yunsheng Lin Subject: [PATCH net-next 07/11] net: hns3: Fix for phy not link up problem after resetting Date: Fri, 1 Jun 2018 17:52:07 +0100 Message-ID: <20180601165211.46372-8-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180601165211.46372-1-salil.mehta@huawei.com> References: <20180601165211.46372-1-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.202.227.234] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yunsheng Lin When resetting, phy_state_machine may be accessing the phy through firmware if the phy is not stopped or disconnected, which will cause firemware timeout problem because the firmware is busy processing the reset request. This patch fixes it by disabling the phy when resetting. Fixes: b940aeae0ed6 ("net: hns3: never send command queue message to IMP when reset") Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index fb44b1e..58fef5e 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3761,9 +3761,6 @@ static int hclge_ae_start(struct hnae3_handle *handle) /* 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); if (ret) return ret; @@ -3781,8 +3778,10 @@ static void hclge_ae_stop(struct hnae3_handle *handle) cancel_work_sync(&hdev->service_task); clear_bit(HCLGE_STATE_SERVICE_SCHED, &hdev->state); - if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state)) + if (test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state)) { + hclge_mac_stop_phy(hdev); return; + } for (i = 0; i < vport->alloc_tqps; i++) hclge_tqp_enable(hdev, i, 0, false); -- 2.7.4