Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2577222lqp; Mon, 25 Mar 2024 03:17:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXd6aXEZ2mMiluzdfkodOpVDyRgEILUe1A1EU0VZV4c2lfWMciAbkcyPnkHYaBDIQXyD3FOCYQ+OtS7DjPTIaMZI0EEQJJ+26DsgnmZ+w== X-Google-Smtp-Source: AGHT+IHvcMKs4U1iMbM52OkUuB4Fv3DTfonLNLPjMDgK5KLCtLiPOARhkHugzljSTE/ulPCx5gZP X-Received: by 2002:a05:620a:1356:b0:789:f76c:a02d with SMTP id c22-20020a05620a135600b00789f76ca02dmr6816586qkl.22.1711361821076; Mon, 25 Mar 2024 03:17:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711361821; cv=pass; d=google.com; s=arc-20160816; b=khbz+WjwUYFz+XZyuB2GrGYevV3xexOad0Qa7+NXXSyW0gaWXdq6lU1GLhhgRIPt9S DS6Q5aC2/9CKxbjo7/tr0SICsk2j+1xH+rb8XRqbLBiu62XAFPFyb9UHoyVABXW0BV73 U9QWMxPS4pxEWqw6af2zQbSYH5lXBvQtZTdn52q2+W1ylnUL/PhTL3WsqGKytbsQOXI4 GM+hm7GFF+pxb45u7J7HK2O2OjAEdrhOPnwY2KqZRAF8QTtGQNZsnafHUvSupi90KQN7 v17GbCwDNUPaTwTeOKcrKZ315x2qPcQIPikA1YCt+pYHt2bmtkblYqP4p0cupMpb6bU0 8cxw== 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=Fv9QNJUDvS11d6HMinspvJcm6C9wA73s73lkzkJ4HF8=; fh=DASOo9xo6NeFeQYErQVypAP4rmn+HrVeR3NPn4gxaIg=; b=jQIFJdXHr5PbKWZI+a1K7Rf8Suzut4NAGYUnUViJ+qppUy+vG/4Rb0+ugDdpmTKM/5 6reWI5V3YTvStnElqZMQCe6W1WkcIPeDG89yV+lTLZyuAbQRJ/4w/9Jf4rHn1rt+AJbq MtXJ9CYhsuzMND5hmnVhvxpcZEGq8EJI202ffIh+nb41h5cEyrrifLy3uvFOiGyHfIRt HQrzaVkuSE34HnyO3aXmzftjX+m+y5ykXf87VtITId6O6WEb4Gk9Qr9jjw7XURFowRKf Q1AJq/kPGhh2Gwm1ltd5Cv+hSMVtdjkPhQeMzW/sgaB1XT44W9CnEdtQSOeWYPkHf9N8 is4g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dzFR8A29; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116157-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116157-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a31-20020a05620a439f00b0078a546f0cf0si2460642qkp.479.2024.03.25.03.17.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 03:17:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116157-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dzFR8A29; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116157-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116157-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C73951C31D1E for ; Mon, 25 Mar 2024 10:17:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 976332827DE; Mon, 25 Mar 2024 03:32:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dzFR8A29" 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 245B117B4FB; Sun, 24 Mar 2024 23:42:03 +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=1711323724; cv=none; b=ib6f2naLsQYcXCRY+sfVhrIWxXryqEEcSaYoZI4nYimv3fqVWea6K4ekA6YyvCO8Xd7KhrwgM7I17xsjbHAILtTG2Ti9MUGsE8xZXpUvwQmjqjSbCB2opOn6nAuL2gzsXqyI5fbjVorN+sLMQLwcfmwNkhHc86Nuuh/XOSTh5IE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711323724; c=relaxed/simple; bh=EWdZk2t0N8dwccaXvhhlbSDrH2hjfcC9HGHEuRAS7cM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qeUQrehLQI+aH6/gHFc1mrxYEcBrBq08BjKM61xd5J8LPpLta38qcqiNiU1mVAY+b/e3i7Bwggeh/jSl62KuRQBCvkOy167QNGFHlPCS7r2nb8RJSrHT/f4B51yshBTt0bRlSF+OklU0QqDdjSStxWT6GHPYJFJSnNknF3gVlbg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dzFR8A29; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B253C433C7; Sun, 24 Mar 2024 23:42:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711323723; bh=EWdZk2t0N8dwccaXvhhlbSDrH2hjfcC9HGHEuRAS7cM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dzFR8A29vSyrNFSMX3aONdAqnpNEgXWVBPOdzOZJjmL+xAaBqmJHl4hR4q1n2mP1+ DvA8WyiXZAgTOQOHcACGZWbcjch7WtOFi9ydM9LdXLOeP0eC87wOEEMXEpW3ncD3OH jg+gGeSE6TmbcNV3wN1R5EsH7gUKBuobKiSzm7slidiNKnWip0o/EFdh0XuL05Jvm9 Q8rsjETMfkYU2HQie7zfHvtDZxXrmyiBczjRr8p2V5DluvLCTnURQa29sFaMINHAGv gR6Or4sS/iq8EIw515OyAVmzaBS0oaKn+2KGMdqx5loiU1T0eJ52awWKI4aku+soLu LLqabG4Fs8yBQ== 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 5.10 096/238] net: hns3: fix port duplex configure error in IMP reset Date: Sun, 24 Mar 2024 19:38:04 -0400 Message-ID: <20240324234027.1354210-97-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324234027.1354210-1-sashal@kernel.org> References: <20240324234027.1354210-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 deba485ced1bd..c14c391a0cec6 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -2723,7 +2723,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); if (ret) -- 2.43.0