From patchwork Fri Jun 1 16:52:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 137567 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1181745lji; Fri, 1 Jun 2018 09:57:50 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJbFPNf+b8h2rgQ5w+cSpKn3+Ytd30ixTxDtRQtzPubULTTRxhTbUQzEmf/IRUQS4g5r7xa X-Received: by 2002:a17:902:a616:: with SMTP id u22-v6mr12128937plq.186.1527872270491; Fri, 01 Jun 2018 09:57:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527872270; cv=none; d=google.com; s=arc-20160816; b=bnQg9CX+DJdcnS030QoH565LtaWlxruQOmBhLZjH8hpZrRRqxmkwxO7YIPrLG++MUU 15TsdKXBW5eIzm/6ctkvUXhaJrfpVuBTv+6Qx+BOMvRWgvIprlIfyDU/mAS5XY0bvWy4 4k2LP6kQKxDZyVJk4+esj+WRU0lkaqWCKkpEOXSl/3T4vV9Rcn0hbGojT3TR1nPJ2MOZ Mw5e3D/AhO4AcxskKNqepqeUn0t7aCGAut1wVX/bsUIXVkUsMDMCdpPubW4B64pfna/c JkZr0AVcZxB/bPxR8HpA3eaVrXWoW5L72AAoZhLcrAEIP/oZd4fwtIR1Sx5aRwkO8aNC xYPQ== 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 d24-v6si39922329plr.302.2018.06.01.09.57.50; Fri, 01 Jun 2018 09:57:50 -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 S1753652AbeFAQ5s (ORCPT + 30 others); Fri, 1 Jun 2018 12:57:48 -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 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(-) -- 2.7.4 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);