Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp275048ybk; Sat, 9 May 2020 02:31:13 -0700 (PDT) X-Google-Smtp-Source: APiQypL5HIX4oqTERkPSvPntocrNVIQ1o41hnltHy5HeEsa6P100gzVm0W6ATuSEvUz+TLamSpnQ X-Received: by 2002:a05:6402:1adc:: with SMTP id ba28mr5705237edb.336.1589016673025; Sat, 09 May 2020 02:31:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589016673; cv=none; d=google.com; s=arc-20160816; b=jtdDMxGFLvMUVPo0kGvfTOM3QqhfX9Ww1lvECRDpHET4Uz1rXTnJTpHpHAF4S742Dz 3QKeoVfmkfG6Plxlhcym0HrTdtmH5ykjVIJGKiKtQm1K6c9TZi/2sXJDrYUnSg7HWonG rLuov8c5tkU9aG6NB11oknc+xLdbp/P0eRHksqeO1mHJ8ILQXpbcEWV/hSDi2dxqykOg mTwfyY7Hkdcw92q+a7ZT4SW8hVn/X2Nwx9aOoCbW3aToMTLWeazD3eGEqAHeIqA84Y78 R+VjEmpZAGj7q+XDAnN7UmT/1JjyqkCds+jaw92nvGJTNalzGx73UdrD9Y/F7TVBGwPO Kbww== 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; bh=hGm+7tQZ8q0AKICxGGpwyPUjxx6kIqUzmIVGuEOKzNo=; b=F0gvJxTE6dp4YhWxQdDwiC3l8Il6QsPI37RIAoyZAcByAUuoYy/bPHgkJQxGHntJ7S GpedsiJjYDNZktiWrUQDR9pgjxnTr7pVigeSlQLmJBr+i17879cofnxfzi3zTHtGPJaZ 3D1wQFugUiWfBJdZ5THW5lA6kAxDZagZPeJbB5t/ZzFufK+glWeTeR76ekePjR0hHCpU ZNX+vIe/tLZRCGSqvRKeinJD7qy5QzsN7dlghp/KCoxuADq0/9x8xfMoTXM3JAIiDldj bgN3EW2/U39MZDVQAqWK6NZFGjRJ73Qq34aea+ONiIkCAtOPAuo2BSjCIE9T44xAb5jw Exxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n18si2522224ejj.459.2020.05.09.02.30.49; Sat, 09 May 2020 02:31:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728224AbgEIJ3O (ORCPT + 99 others); Sat, 9 May 2020 05:29:14 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:4378 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727086AbgEIJ3G (ORCPT ); Sat, 9 May 2020 05:29:06 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 65F8A76E6C49B76A88C6; Sat, 9 May 2020 17:29:00 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Sat, 9 May 2020 17:28:50 +0800 From: Huazhong Tan To: CC: , , , , , , Yufeng Mo , Huazhong Tan Subject: [PATCH net-next 5/5] net: hns3: disable auto-negotiation off with 1000M setting in ethtool Date: Sat, 9 May 2020 17:27:41 +0800 Message-ID: <1589016461-10130-6-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589016461-10130-1-git-send-email-tanhuazhong@huawei.com> References: <1589016461-10130-1-git-send-email-tanhuazhong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yufeng Mo The 802.3 specification does not specify the behavior of auto-negotiation off with 1000M in PHY. Therefore, some PHY compatibility issues occur. This patch forbids the setting of this unreasonable mode by ethtool in driver. Signed-off-by: Yufeng Mo Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c index 1a105f2..6b1545f 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c @@ -773,8 +773,13 @@ static int hns3_set_link_ksettings(struct net_device *netdev, cmd->base.autoneg, cmd->base.speed, cmd->base.duplex); /* Only support ksettings_set for netdev with phy attached for now */ - if (netdev->phydev) + if (netdev->phydev) { + if (cmd->base.speed == SPEED_1000 && + cmd->base.autoneg == AUTONEG_DISABLE) + return -EINVAL; + return phy_ethtool_ksettings_set(netdev->phydev, cmd); + } if (handle->pdev->revision == 0x20) return -EOPNOTSUPP; -- 2.7.4