From patchwork Tue May 1 18:56:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 134794 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp5280331lji; Tue, 1 May 2018 11:58:51 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqZPK+ROQTa+iODvPDXWB6tHZxTEY87N6bjXOyU/bvUL4BB3iAHUzAxh2IVIpvn4nPnESiH X-Received: by 10.98.217.217 with SMTP id b86mr16826561pfl.41.1525201130915; Tue, 01 May 2018 11:58:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525201130; cv=none; d=google.com; s=arc-20160816; b=mby/OpW+S5M6eViX00KYcS2SBXXSf14R3tu5FqPt18C2bVx/LLM0w7uaVEt3tPWMPm vdDlmpYLa8GG7ZbqIEBEcQwkKKBaZXFunbQtFYU9i65hiLm03nVuF9qfRMoQ3sTBai64 LC3vmVRw+lvymXiFfYI+YLyY5v3/3gcUB7BZjkg3nsQo/ArGTxDxhsAsDhFW8MB9X3UP WqGyNcbrpTeDE5wiPhcStJMl1tnO6wDqr3OdNC0m9dyzElzKugXrXhlwi3xv2y7IK4a5 ALvL4Mh1JyMzTBdwFh479vh1k75/g8dzI1ZP8ogf1QfiylSnuYmU1dd+CvaywCu7Q4mf HxsA== 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=bLB0g2Uks9n5lV74CbD2OUkNO1VHyegC2b9hYdz1ZVo=; b=VmnYiVBaQi6KNjqFgcfuYiTc6K46LnDKLvCDGL79F/lf4+1K78nRJHGFqTT6woatfd QRhWO72xW92vO0gZHKsyC6tue0ihKhFWH30aeYnqxVbgBNGEkmRoiMLoqShW969k9+ze F1L7hhECCxIds1hOivNzBskMbNgTF/LIh5oyf30MAUX3OXKeEw8grNmOYdlewANTiY7R gUti3fWI16LOUc2yoxm0vnNzrB1fQyhsUmlmHF5zAdELepsR/knfgKX/M1jAVXxNPWu1 LmMRBnn1RlZIx8DJX+Ld6m4qRM2vzbNaVGlm81Jr6gXRBoclBOxy2AptJuqVt1mQP/5y zNXQ== 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 s1-v6si8220928pgq.282.2018.05.01.11.58.50; Tue, 01 May 2018 11:58: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 S1756737AbeEAS6s (ORCPT + 29 others); Tue, 1 May 2018 14:58:48 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:7644 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756654AbeEAS6K (ORCPT ); Tue, 1 May 2018 14:58:10 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 76A46B93EA053; Wed, 2 May 2018 02:57:57 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.226.46) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.361.1; Wed, 2 May 2018 02:57:50 +0800 From: Salil Mehta To: CC: , , , , , , , Fuyun Liang Subject: [PATCH net-next 6/9] net: hns3: Fix to support autoneg only for port attached with phy Date: Tue, 1 May 2018 19:56:02 +0100 Message-ID: <20180501185605.9584-7-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180501185605.9584-1-salil.mehta@huawei.com> References: <20180501185605.9584-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.226.46] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fuyun Liang This patch adds a check to support autoneg(ethtool -A) only when PHY is attached with the port. Fixes: e2cb1dec9779 ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support") Signed-off-by: Fuyun Liang Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 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 cc09713..a4e9991 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -5169,12 +5169,6 @@ static int hclge_set_pauseparam(struct hnae3_handle *handle, u32 auto_neg, struct phy_device *phydev = hdev->hw.mac.phydev; u32 fc_autoneg; - /* Only support flow control negotiation for netdev with - * phy attached for now. - */ - if (!phydev) - return -EOPNOTSUPP; - fc_autoneg = hclge_get_autoneg(handle); if (auto_neg != fc_autoneg) { dev_info(&hdev->pdev->dev, @@ -5193,6 +5187,12 @@ static int hclge_set_pauseparam(struct hnae3_handle *handle, u32 auto_neg, if (!fc_autoneg) return hclge_cfg_pauseparam(hdev, rx_en, tx_en); + /* Only support flow control negotiation for netdev with + * phy attached for now. + */ + if (!phydev) + return -EOPNOTSUPP; + return phy_start_aneg(phydev); }