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 C5B2037FF60; Sat, 12 Sep 2026 10:21: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=1789208478; cv=none; b=iHW1uPd4gwoyvA+9B/rmzOBxOOwWKSSqgbC2aACFXyXSetDBk4sfXl8w/xEHiZlszDmJPXn57OBmz4hmQOhBXedmNvHxMGiv+hq4+ctPV/lyGHKtnYrEBSuMdkL39d2niLyudwk1LmkIfa/eG1K063SOZ1fykNEXfhcMc5cdcEo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789208478; c=relaxed/simple; bh=QrgeL1925P9grvVD0IkChjtCQi0IhTu68C7MIb6hp78=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WJpgrLHAc3MPTNKKKJv6S/sS6rWdJqZt2Rft7dm0zHkDAWKzGZ6DYcgeEQwg8NgLs6EXFLkfvLtBRix5TfLAtt7qzEeyLtHSCYHsSyu1tPk/20Wv7O4xw6ZeTue3sJX1tQNQIfzHFKwelYMmJ4UsTVP0F9eUshMhTfX6Wo4duhI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=t1aIzZKZ; 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="t1aIzZKZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4AD91F000FF; Sat, 12 Sep 2026 10:21:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789208477; bh=r8HJW5kz2MzwdFE/ntQCLceRbxSAy5N99o8SLhWqZ3A=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=t1aIzZKZSGuZZvt9bD4Wj3i4zOfW/dUZZBofUdku/GBGLGbw6W7AmOcm+jOCmfZT8 YORHg071RNRIHN0e6IMUzaJhKflhLjaompuzyyV8d+TFg6qKa86teE2GUPsmY+X80I sEUGJEgbI1uTqM9z+rAKQMMbTwt8dY9djyExqqbk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Leon Romanovsky , Sasha Levin Subject: [PATCH 6.18 0625/1518] RDMA/mlx5: Send cong param changes to the resolved port mdev Date: Sat, 12 Sep 2026 08:46:34 +0200 Message-ID: <20260912065637.571870269@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065623.398859879@linuxfoundation.org> References: <20260912065623.398859879@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-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