Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9987168ybi; Wed, 24 Jul 2019 13:36:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzeMxpDZF9cXfVjn3yNU1gmEHuzNf7FgPJGhZcSxEQxSsby5vNF4maxkeI84UX8UWE86Zri X-Received: by 2002:a17:902:e30d:: with SMTP id cg13mr87124439plb.173.1564000599695; Wed, 24 Jul 2019 13:36:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564000599; cv=none; d=google.com; s=arc-20160816; b=Ilai9m5WN/GuPTHk0OARIwgijcpWxm0eJl5CHv3kq7cOW7AOctYECgeuBGOmH/59l5 3Rf0uhRjKQflTwUUWWD2Tt/mnhxQpvNk9IzzZWZH0uQ3/EEAmR/wgDqEFmaENODsb5jj GZJRQGFPgvWAlUOxkWGIAvqZPRPvb6RtzN53cai6Swf5m+fyDMtC2FFJ5PcsMzmr/SIZ aLZF1R9ao+4WJ6nPULKmRoXNyWHW9ftWYgudR6KS9xb7aYeMWVC7F/muN3nKKXzUtvb7 apWTKC0J0k1qbFyAVDhiyfUmpjNqzrt7ETUnIS7P3N8NvCgON9OfuSFiFLr+oEnuiIoJ kNnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AO9pkHt1iN1eJqr9qwmHXsdB2M91jJM0XvIuYGVzUtM=; b=nWQLe8tj610EiGUWhpSVuNDLYzfsGuCGziW90jQowiPPgkUHio8rmYNsPRGS5sHsr/ thzY0U4manJ/XBZEwX8gSGBpmiibXFLfz03+ie6gnyVx1NUYPDeqTaK5WPrCECdEm5HA 9g1bo79M9bhTtbc4C8xwgF9R/TVZRwNUKoacFdu+IkaaPKvq7t3+aYDfBitGvvqJr710 jpVzYP0ICkvvP6xEm6uuctwThB6ROnnCK7DMzI0K7KR05Cy8wjS2oY7Yf9BH6MAHhV1Z tJ3sQTM/y0WxyHxN8aA1os7kNKYatAXF9ptHjBL27tXMVqsprSsxMgVrPDkqFcdvYqEk JUbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hid31+SY; 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 y134si16073821pfc.285.2019.07.24.13.36.25; Wed, 24 Jul 2019 13:36:39 -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; dkim=pass header.i=@kernel.org header.s=default header.b=hid31+SY; 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 S2390302AbfGXUfM (ORCPT + 99 others); Wed, 24 Jul 2019 16:35:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:43086 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388078AbfGXT0I (ORCPT ); Wed, 24 Jul 2019 15:26:08 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 53238229F3; Wed, 24 Jul 2019 19:26:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996367; bh=35gqSgFFgFhclDpTnJY/MV9ueyv3aP4Lk8CgSO14UvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hid31+SYBCS8doNcjfrdI+eaXDSmc4NjpCfNXN/l2UN97unZLeWD+XczcPqsP4yBj QF3LWvWvMh3RSezrkOP85gmZiORH9F5/nDd7lFz32mdmrXjnMyMvHOIVCbVJls7zoD DuM9+ZeEhcCweNtbXTKWg0eAUNPKJFS4xX24gQss= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jian Shen , Huazhong Tan , "David S. Miller" , Sasha Levin Subject: [PATCH 5.2 035/413] net: hns3: fix for FEC configuration Date: Wed, 24 Jul 2019 21:15:26 +0200 Message-Id: <20190724191738.128109214@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit f438bfe9d4fe2e491505abfbf04d7c506e00d146 ] The FEC capbility may be changed with port speed changes. Driver needs to read the active FEC mode, and update FEC capability when port speed changes. Fixes: 7e6ec9148a1d ("net: hns3: add support for FEC encoding control") Signed-off-by: Jian Shen Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index d3b1f8cb1155..4d9bcad26f06 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -2508,6 +2508,9 @@ static void hclge_update_link_status(struct hclge_dev *hdev) static void hclge_update_port_capability(struct hclge_mac *mac) { + /* update fec ability by speed */ + hclge_convert_setting_fec(mac); + /* firmware can not identify back plane type, the media type * read from configuration can help deal it */ @@ -2580,6 +2583,10 @@ static int hclge_get_sfp_info(struct hclge_dev *hdev, struct hclge_mac *mac) mac->speed_ability = le32_to_cpu(resp->speed_ability); mac->autoneg = resp->autoneg; mac->support_autoneg = resp->autoneg_ability; + if (!resp->active_fec) + mac->fec_mode = 0; + else + mac->fec_mode = BIT(resp->active_fec); } else { mac->speed_type = QUERY_SFP_SPEED; } -- 2.20.1