Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp921389pxb; Wed, 1 Sep 2021 12:44:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxr3jalKlDZvZ4hGxy4PyiAetuhcFYU7F9PQpBA2IJdL1SncnTVtV9327R2yQ9szzAdmQpH X-Received: by 2002:a17:906:2b56:: with SMTP id b22mr1226296ejg.189.1630525458204; Wed, 01 Sep 2021 12:44:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630525458; cv=none; d=google.com; s=arc-20160816; b=0sfe63iojtcE4U0KZ08IlY+xzgPp8civahtJhFZ8qwX5XV81YMMZu9K3zNsy794xhz RGRQAJ4oQJCKyLfvJgLpbfHXHw8vDNHF2FfGlyL3z8lLlAwvfClIC9gYZWTZQqDvH87L QKSra97WueCswUKNnEZWmjBYFthi2OXSWnJ7NUTprCVe8uqYZt29Rovf8ftQ5inHKHOL h+pIv7yfS8FKODTf+CpBRm8YU4rVUD6DTQYstKzWUSx/XUEhclAhtOzxmCLY7xNoEXmA Lgr/ejA/h5ai97lnwbc2TKz5uIgV0IM8D7v9BBqbU7VAsXp5jzTRpYkGfPanfpd/5vh4 SEGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ybapmp64bJgh0qt7t9PP+GRB7FUHj2Wnrw5g1eGGFfM=; b=Q/5yfrFI3pnW2rAd8v0Fb4ktxn73T4ZzaY5bIe3q7cLuvjz4Mh85Ojq77yED11P1Sz dPsVQprxZKz1umaGMmmKD56jDNYGB1RXGqmJprfT1mfp7csYBHsoCGuL9u0OAha+QQc+ geE0sSIk5bXReKCj0Rc3QjMtnNURsgOWXq+7g2EOr4sCynfZE7lcT+iX1DZ9Gl1YOrON NQimiMmNL73eiwITLNDj5T/OrWzQwdmWGe3j50L36EDraTgRD5QGM8/PpjO2GqYUWY+e 1tOttapaJFwF8lMAZ8KxUVDSZ8uLR+IBx2DiajgystokrEP/IYdeeoiUnEiz+MTgR7KX 9q8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rrwnK4oa; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e21si436652edj.249.2021.09.01.12.43.51; Wed, 01 Sep 2021 12:44:18 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rrwnK4oa; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345884AbhIAMwd (ORCPT + 99 others); Wed, 1 Sep 2021 08:52:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:49974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345823AbhIAMsk (ORCPT ); Wed, 1 Sep 2021 08:48:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BDA88610E7; Wed, 1 Sep 2021 12:40:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1630500040; bh=FZ28ebaIHoobKvuJXHwLOsBD2eJgQshKmz5OdwX222o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rrwnK4oaVm4kqdThIeDbbcmQe44HlS5o0BDF7nZ+s+2BQZDoakYpMHunvBWsu5d3g I5b3AHYNNJXDaoRDDm+g3sutj9T2JYwH2hHxFcUow1JQi59pvq4tVSaqAXhOXTP2c0 nhyuTd/e5Gww61KFythiH6kJis+EAche6DEdlzyk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yonglong Liu , Guangbin Huang , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.13 062/113] net: hns3: fix speed unknown issue in bond 4 Date: Wed, 1 Sep 2021 14:28:17 +0200 Message-Id: <20210901122304.037010360@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210901122301.984263453@linuxfoundation.org> References: <20210901122301.984263453@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yonglong Liu [ Upstream commit b15c072a9f4a404c09ad589477f4389034742a8b ] In bond 4, when the link goes down and up repeatedly, the bond may get an unknown speed, and then this port can not work. The driver notify netif_carrier_on() before update the link state, when the bond receive carrier on, will query the speed of the port, if the query operation happens before updating the link state, will get an unknown speed. So need to notify netif_carrier_on() after update the link state. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Fixes: e2cb1dec9779 ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support") Signed-off-by: Yonglong Liu Signed-off-by: Guangbin Huang Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 9ea4007dbac9..00254d167904 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -2924,12 +2924,12 @@ static void hclge_update_link_status(struct hclge_dev *hdev) } if (state != hdev->hw.mac.link) { + hdev->hw.mac.link = state; client->ops->link_status_change(handle, state); hclge_config_mac_tnl_int(hdev, state); if (rclient && rclient->ops->link_status_change) rclient->ops->link_status_change(rhandle, state); - hdev->hw.mac.link = state; hclge_push_link_status(hdev); } diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index fe03c8419890..d3f36e2b2b90 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -498,10 +498,10 @@ void hclgevf_update_link_status(struct hclgevf_dev *hdev, int link_state) link_state = test_bit(HCLGEVF_STATE_DOWN, &hdev->state) ? 0 : link_state; if (link_state != hdev->hw.mac.link) { + hdev->hw.mac.link = link_state; client->ops->link_status_change(handle, !!link_state); if (rclient && rclient->ops->link_status_change) rclient->ops->link_status_change(rhandle, !!link_state); - hdev->hw.mac.link = link_state; } clear_bit(HCLGEVF_STATE_LINK_UPDATING, &hdev->state); diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c index 9b17735b9f4c..987b88d7e0c7 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_mbx.c @@ -304,8 +304,8 @@ void hclgevf_mbx_async_handler(struct hclgevf_dev *hdev) flag = (u8)msg_q[5]; /* update upper layer with new link link status */ - hclgevf_update_link_status(hdev, link_status); hclgevf_update_speed_duplex(hdev, speed, duplex); + hclgevf_update_link_status(hdev, link_status); if (flag & HCLGE_MBX_PUSH_LINK_STATUS_EN) set_bit(HCLGEVF_STATE_PF_PUSH_LINK_STATUS, -- 2.30.2