Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9983995ybi; Wed, 24 Jul 2019 13:32:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwUP8Ix8DBltzCaaC74kEJfeJhwE0j+TQrLHzyxyw3vLxmzQWRYOkv/HdH/7OvChV4DkYK6 X-Received: by 2002:a63:8f16:: with SMTP id n22mr12559597pgd.306.1564000344443; Wed, 24 Jul 2019 13:32:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564000344; cv=none; d=google.com; s=arc-20160816; b=RNi9GN772WNsWglha6ZtRZWS36L0zLSX+3OcA3cLtPKTL9oZuVkeNign6nr71kLMF7 SnrYJScfrkJ3AeP+4pn+Xo7v06aGws35r9pU1TgdkC1TTo9LIP9I9K272raRUJ9tcA9G Sy+VlcWQzznUUnINprZtLgklRpyP6+xiqKmr4F3dfeCeNU8vP1Z6zJBRMCiM8Dd49kUM LclvTg6Iyrmzydte2yaNEfcvjx9DNWl/yVAAG2X9v0mFVXkte7yDAkgzlmfd7ls689wL g/mXPEaytbrTNQNPlL9Sqg/n1rzSJlqpUcUG+7jXa86KtDWCqixCTW9zhfAH4CLKucr+ Tp5A== 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=OLXeEnWWqw5y7zV9qkPE1JXtP7ZkAbbMrah8xbHHoms=; b=RCOoEKCRiQNPJToec+WGwsOvEqD+LlfN/J5kzGWZx4Y26gAvslyJPudPiLPc5INgrq +41jvX7lQB99vEjc0UxqESH5066w0Q4ar8XuYqYdJ+sOOIn//X/3+v8ADSDEu6ZpCfOQ NbXjC4XqQnQbzvq3gZndBV8QeydbpJpRzxw0HAU8u49vDLaw1YhIkack/MKqvjANQJic NZnF0yCAUV1la3SULheKsPYJykcMDyqQ3rhV/hg0szxKBPkyP5aKVbqWW1uZFWGwbwcE FevEz8vEAJL90HomwcmyaszdA8w+dmx9vUJaw4FwEFhwmgL6poRrM9RjjxAxz3ADR8tO ktJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ks06ZPJs; 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 r17si14509991pgg.155.2019.07.24.13.32.09; Wed, 24 Jul 2019 13:32:24 -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=ks06ZPJs; 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 S2388426AbfGXTbM (ORCPT + 99 others); Wed, 24 Jul 2019 15:31:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:51830 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387625AbfGXTbJ (ORCPT ); Wed, 24 Jul 2019 15:31:09 -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 8BC0322ADC; Wed, 24 Jul 2019 19:31:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996669; bh=pSoYODkGw1XNJJXndGg8c6zsQxwYstfcpwBikoEnivA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ks06ZPJs5kzjXul4y5FKo8wBMINd+JBiC4eJvczTsY0H28rqxH5xltMeFcohjjkDa NUTMQkNtKfTfs+Lu/mre4ErALSwsMiyDwgQqSQjScWoyha/IeBYsoCcwD7BrRV72RD QOLokCwprXvLJj0kJPUQuD5e/K8S4zwG9sOhLRv4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jian Shen , Peng Li , Huazhong Tan , "David S. Miller" , Sasha Levin Subject: [PATCH 5.2 177/413] net: hns3: restore the MAC autoneg state after reset Date: Wed, 24 Jul 2019 21:17:48 +0200 Message-Id: <20190724191747.544403271@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 d736fc6c68a5f76e89a6c2c4100e3678706003a3 ] When doing global reset, the MAC autoneg state of fibre port is set to default, which may cause user configuration lost. This patch fixes it by restore the MAC autoneg state after reset. Fixes: 22f48e24a23d ("net: hns3: add autoneg and change speed support for fibre port") Signed-off-by: Jian Shen Signed-off-by: Peng Li 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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 4d9bcad26f06..645b9b3e0256 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -2389,6 +2389,15 @@ static int hclge_mac_init(struct hclge_dev *hdev) return ret; } + if (hdev->hw.mac.support_autoneg) { + ret = hclge_set_autoneg_en(hdev, hdev->hw.mac.autoneg); + if (ret) { + dev_err(&hdev->pdev->dev, + "Config mac autoneg fail ret=%d\n", ret); + return ret; + } + } + mac->link = 0; if (mac->user_fec_mode & BIT(HNAE3_FEC_USER_DEF)) { -- 2.20.1