Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2380011lqp; Sun, 24 Mar 2024 16:50:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWaScd6PqJd/28UJJxq5mqPkntmTPC819GB8tC1X//Vths6VsdvWiLSd9ZfAojiNU43MhZaBT9/6l2lfScqLG36uWjRepOv/jMzCI7piQ== X-Google-Smtp-Source: AGHT+IECUqNpfdH9h7TH73ZqD8v0IgzTmLbijzBqt163hxv7l2aGikMinmaH7cBfDOxwMOkg8Ywh X-Received: by 2002:a05:6a00:2294:b0:6e8:1b04:29f2 with SMTP id f20-20020a056a00229400b006e81b0429f2mr5865978pfe.28.1711324205603; Sun, 24 Mar 2024 16:50:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711324205; cv=pass; d=google.com; s=arc-20160816; b=Cx/ROSnoz3XyO2KCMGT7QP1cNvclp4bKviUmWXrYODb7d9JT2hOpaTtxWQhgNKZqry gR0nO7gYCufwXIHncon2lw8UWgc4ToVEZEQ7n9/mFLm38wYgFofb9N4vpgOEwedMZ1Ol TE0aUrwa2ysvVEGlNZnBh4e9R0Zv17LDJ6Y8FQ6YNED4nRUr6wMdApCizlrCc6uwas6W t7+BgThp5lwYOLvWQCTa4P+SUSG+lKLd8NbqHnqV/n7e93AppTJgRxppXU6f/c8sqcUz 1/8M1g1Qngl4756aFn4AEv0NA8gr508H2WhWp61+ZmCbhU/M1DRlPMQ7Y/bS6TkwGnGT S28g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=VJB3pSs6ihxSjX9BcLjJScVgxfGIp888bs0/U07xQLY=; fh=DASOo9xo6NeFeQYErQVypAP4rmn+HrVeR3NPn4gxaIg=; b=FedHtc/sV05/+ARtOwUzriOjIFwMORax8nZIdjM6F3TuGIWcuF6piJuBhipVblMXUY 7zTtnR+3NmH8lxuCl2CjcSz9FqpG7z2qZtvv7MvK2J9DfGx9hAGQzO9Vs1JlgvmuG8Ih F+P/N62qNetZqmsWHE4WSA171TMgnNVbWNhwx7gHPayl65WMrpl2W7ACXVtzM5cvd608 O2Sz8mJkhRXgurpPIp/BAI7a/Gyub0DGYb8Ul7bDULgvtehN13mjg29aHTnSm/Gf+rh5 KB1fjpY6XNE3dIzrBvhc/9l5/AsGbz6xwVJHdUBoeK4fGx42ZSETEv5IaDLkLXjmgUgq dudw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pwAvBi8m; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113223-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113223-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u6-20020a62ed06000000b006e8f569a4bcsi4116983pfh.63.2024.03.24.16.50.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 16:50:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113223-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pwAvBi8m; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113223-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113223-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id C3B7028A581 for ; Sun, 24 Mar 2024 23:48:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 74748181CEC; Sun, 24 Mar 2024 22:40:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pwAvBi8m" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6CC90181491; Sun, 24 Mar 2024 22:40:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320024; cv=none; b=T0t9eq7aOUm1G2HG8kFteZNKNCa5jsp7ihWaoFa53Ef4j6JpC8q5Cm7osDMCLy2+OovSl/mYU2OgRvOiKqZHyCpW7/L+tVCYepcQeLzlaM+VUHJjzHr43DId1Rns6BN5PdEe3hVJ18I1QD7GWLxTLXW4VDm8hCoELCNYihxdZGI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320024; c=relaxed/simple; bh=cfO/pSwv8DvtXWRMznN57ZBsrXBoyZbOV1j5gmASnTI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UWMGizT+tdqPY4gEHVF6mYU1ePYHjDJJmWdLZBOUZCqIeUm7Hngs5yUNrdg4ZVMH9SwRrbInd9G3IOc1uuqBdt9xCruMRNKUBk5kfBy7y6GK4u+9Ucj1xCWjo4eir72e3a01QwmNohtwmdMgzTVY+fU2HeFOo6kLYsIo55ijTws= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pwAvBi8m; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95B63C43399; Sun, 24 Mar 2024 22:40:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320024; bh=cfO/pSwv8DvtXWRMznN57ZBsrXBoyZbOV1j5gmASnTI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pwAvBi8mwyAEr9PaNyJTzK48Uc39QYZfwEXIoQcM4KhYEpdMJkW881yaicuKoYyqQ Bw/LbFlLFgO5qjcKMvViLYkjXWmo2AXUHv3MRNtJrI2RBJlyW8w3KkxH3xMOs0vQHT mEhqC8JvIHna+/XdbeOF0mfat6JID07o0ffHCnOt2dGEaKEkg0rzB4eTskichmTAND BBlgWSnqd/3ObeGDHJaJvc+0X8jUbupCbsMww4pEe9R2xp8Z1dUWCLqgPfhatLo5k+ 1iBI5BivAGHDYNcyOkgRwtSoH99Wv7vmRRRmZsBQuaJhItiV+Qx0CA0R/O/CtQWLu5 WdqZg8LmDZJfw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jie Wang , Jijie Shao , "David S . Miller" , Sasha Levin Subject: [PATCH 6.8 332/715] net: hns3: fix port duplex configure error in IMP reset Date: Sun, 24 Mar 2024 18:28:31 -0400 Message-ID: <20240324223455.1342824-333-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Jie Wang [ Upstream commit 11d80f79dd9f871a52feba4bf24b5ac39f448eb7 ] Currently, the mac port is fixed to configured as full dplex mode in hclge_mac_init() when driver initialization or reset restore. Users may change the mode to half duplex with ethtool, so it may cause the user configuration dropped after reset. To fix it, don't change the duplex mode when resetting. Fixes: 2d03eacc0b7e ("net: hns3: Only update mac configuation when necessary") Signed-off-by: Jie Wang Signed-off-by: Jijie Shao Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 5ea9e59569eff..609d3799d7738 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -2890,7 +2890,10 @@ static int hclge_mac_init(struct hclge_dev *hdev) int ret; hdev->support_sfp_query = true; - hdev->hw.mac.duplex = HCLGE_MAC_FULL; + + if (!test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state)) + hdev->hw.mac.duplex = HCLGE_MAC_FULL; + ret = hclge_cfg_mac_speed_dup_hw(hdev, hdev->hw.mac.speed, hdev->hw.mac.duplex, hdev->hw.mac.lane_num); if (ret) -- 2.43.0