From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 B185E4EFFD2; Thu, 17 Sep 2026 17:57:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789667838; cv=none; b=u9Fj5tHcyoEbZOx5uXjgUFlcIrZ0piDK9310FLk9yXgkEysx0+uGPUnzFKe9noF4fa6hi1zPf5iqrIyVjxmlKMDnKKdQeoPTLAQ6D5oIF20HrZCZpfbqB/Ah83qa3Son49Y1N+ikePJ/xGod13j4jcu+tF13U8jEGVYNGXApZsw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789667838; c=relaxed/simple; bh=yhe+KDxBy69tistMbRngLd2u+0iPfJQBFvKKLpwi7LI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ClQ7S6+fCEXpsODk+WNYANpdjxurhqF9aTxJMIKD3wXe9wikzzEtZRBvkorjxEVn2RBV6U0/+G2llZXGNasjRRmXKDfxhmbmyh306VFUz80UAlZsamzWIXSi2CZR3v97DfAG53dFCjO/SWvnxw25/znnPsOjxeICiq3m2WJiTpE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=n0uEDnpi; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="n0uEDnpi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12EFD1F000FF; Thu, 17 Sep 2026 17:57:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789667837; bh=CReqMzvOOJAdZiuauzgvAieIkbcJPdZ7quBtMnDJUhQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=n0uEDnpiLPkzfKQvc8qf/Ri9dOBtypnT1PcSXAz0siRu+o7MEfjA1V0r+GDU1XXwI SrooeiRq60EvRu7e2uYSBd+SCcdMFDnwYa8BSoDKiaK1KUgc3agvj4lpN+aLicYWdC Nyye5FiTzSvomPsD+ATvUe2pkZYCeJGXXV3CEk+8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Shay Drory , Mark Bloch , Tariq Toukan , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.12 0227/1102] net/mlx5: E-Switch, align disable sequence with switchdev-to-legacy transition Date: Thu, 17 Sep 2026 16:02:50 +0100 Message-ID: <20260917151545.282435744@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260917151539.408551884@linuxfoundation.org> References: <20260917151539.408551884@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shay Drory [ Upstream commit b48b6308dfaeae49fcda61b4066773cb5e8a9ce8 ] This patch align the eswitch disable sequence with the switchdev-to-legacy mode transition, where eswitch must be disabled before device detachment. The consistent ordering is required for proper SD LAG cleanup which depends on eswitch state during teardown. Signed-off-by: Shay Drory Reviewed-by: Mark Bloch Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20260531113954.395443-3-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index f77b6362fd9f5..fd5676dfda4af 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -1438,7 +1438,6 @@ static int mlx5_load(struct mlx5_core_dev *dev) static void mlx5_unload(struct mlx5_core_dev *dev) { - mlx5_eswitch_disable(dev->priv.eswitch); mlx5_devlink_traps_unregister(priv_to_devlink(dev)); mlx5_sf_dev_table_destroy(dev); mlx5_sriov_detach(dev); @@ -1546,6 +1545,7 @@ void mlx5_uninit_one(struct mlx5_core_dev *dev) mlx5_hwmon_dev_unregister(dev); mlx5_crdump_disable(dev); + mlx5_eswitch_disable(dev->priv.eswitch); mlx5_unregister_device(dev); if (!test_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state)) { @@ -1630,6 +1630,7 @@ void mlx5_unload_one_devl_locked(struct mlx5_core_dev *dev, bool suspend) devl_assert_locked(priv_to_devlink(dev)); mutex_lock(&dev->intf_state_mutex); + mlx5_eswitch_disable(dev->priv.eswitch); mlx5_detach_device(dev, suspend); if (!test_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state)) { -- 2.53.0