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 75A71214A84; Sat, 12 Sep 2026 12:32:57 +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=1789216378; cv=none; b=Whzd4MUBo8Fcm2rhBKheYEdsL0YxSk9bYmyjAD8RevFUn6C6XKn8xFWIuVBm79yY+jZInqefBbK66ou8ATjgPpLELGE/qlwZeJ5JewTRk4tX1eFlCyPm0p5Cyfo98tBX6Vnwv+uB6tBkNgvLkrhOZhd0MIpZhwes0Tq1roY+fSc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789216378; c=relaxed/simple; bh=c/HjWgaHkyJgidEje+7QRf97m/udBYLTvYSzIvnp2ac=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rqAjGQC5j9vku70iRkAvkwvi4pMjJ/t2au59YFbJ2Qf/Eb5BigGkpt+1rjkwk25lzi7hkGgFXkwTm1bLs2spF2tifvuVbrN0q2nX6f054Agq/ab7grNBA8bX+m4NVsw6mGA4mwmP7GZSS+/LvI+CSMhsQX0pz2f+Dl9V7XmfHNo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=EgqHS/rs; 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="EgqHS/rs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F0651F000FF; Sat, 12 Sep 2026 12:32:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789216377; bh=kCAEYpC8sHXBNa0LlzlyBTr8IX0qzHGgVxkmvWEjjOs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EgqHS/rsLbHUMYHv4C5KJ8XIVzTNCFzovxq45Z9ytwnes9ZWXTYkIIF2iCjm3txGv xPIoTBQRFEpJYXi4oPweunkwrkWkwHK0I/CZySUZhrvcQ+bJWeWpoY6LYOCxwwgvnt ogPP3OnnCQoeUkmFoPthVAzKni71dkM9UJOYkdNA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Leon Romanovsky , Sasha Levin Subject: [PATCH 6.12 0724/1376] RDMA/mlx5: Send cong param changes to the resolved port mdev Date: Sat, 12 Sep 2026 08:52:30 +0200 Message-ID: <20260912065623.678068594@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.535295758@linuxfoundation.org> References: <20260912065607.535295758@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: Leon Romanovsky [ Upstream commit 033a79e308e4fe832b0924347eda8c4364055174 ] mlx5_ib_set_cc_params() resolves the port-specific mlx5_core_dev via mlx5_ib_get_native_port_mdev() but issued MLX5_CMD_OP_MODIFY_CONG_PARAMS through dev->mdev. On an affiliated secondary RoCE port those pointers refer to different devices, so a write to the secondary port's cc_params debugfs file either altered the master port or failed with a master-side command error, while the read path already used the resolved mdev and returned the unchanged secondary value. Issue the command to the resolved mdev, the same device whose capabilities were checked when its debugfs directory was created. It is already referenced by the get/put pair, so its lifetime is safe. Fixes: 31578defe4eb ("RDMA/mlx5: Update mlx5_ib to use new cmd interface") Link: https://patch.msgid.link/20260726-mlx5-ib-set-cc-params-applies-conges-v1-1-a253edafe1f3@nvidia.com Signed-off-by: Leon Romanovsky Signed-off-by: Sasha Levin --- drivers/infiniband/hw/mlx5/cong.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx5/cong.c b/drivers/infiniband/hw/mlx5/cong.c index 88ac5fd1038ed..e3c4b1c928169 100644 --- a/drivers/infiniband/hw/mlx5/cong.c +++ b/drivers/infiniband/hw/mlx5/cong.c @@ -361,7 +361,7 @@ static int mlx5_ib_set_cc_params(struct mlx5_ib_dev *dev, u32 port_num, MLX5_SET(field_select_r_roce_rp, field, field_select_r_roce_rp, attr_mask); - err = mlx5_cmd_exec_in(dev->mdev, modify_cong_params, in); + err = mlx5_cmd_exec_in(mdev, modify_cong_params, in); kvfree(in); alloc_err: mlx5_ib_put_native_port_mdev(dev, port_num + 1); -- 2.53.0