This is a note to let you know that I've just added the patch titled net/mlx5: Remove redundant cmdif revision check to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: net-mlx5-remove-redundant-cmdif-revision-check.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 4d4c58a520e05135ae8bfa53fd8cc2816960ce53 Author: Shay Drory <shayd@xxxxxxxxxx> Date: Sun Jan 29 12:08:30 2023 +0200 net/mlx5: Remove redundant cmdif revision check [ Upstream commit 0714ec9ea1f291447a925657e0808f34b8fbce2b ] mlx5 is checking the cmdif revision twice, for no reason. Remove the latter check. Signed-off-by: Shay Drory <shayd@xxxxxxxxxx> Reviewed-by: Moshe Shemesh <moshe@xxxxxxxxxx> Signed-off-by: Saeed Mahameed <saeedm@xxxxxxxxxx> Stable-dep-of: d62b14045c65 ("net/mlx5: Fix command bitmask initialization") Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c index 465d2adbf3c00..2269f5e0e3c75 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c @@ -2216,16 +2216,15 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev) int align = roundup_pow_of_two(size); struct mlx5_cmd *cmd = &dev->cmd; u32 cmd_h, cmd_l; - u16 cmd_if_rev; int err; int i; memset(cmd, 0, sizeof(*cmd)); - cmd_if_rev = cmdif_rev(dev); - if (cmd_if_rev != CMD_IF_REV) { + cmd->vars.cmdif_rev = cmdif_rev(dev); + if (cmd->vars.cmdif_rev != CMD_IF_REV) { mlx5_core_err(dev, "Driver cmdif rev(%d) differs from firmware's(%d)\n", - CMD_IF_REV, cmd_if_rev); + CMD_IF_REV, cmd->vars.cmdif_rev); return -EINVAL; } @@ -2258,14 +2257,6 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev) cmd->vars.max_reg_cmds = (1 << cmd->vars.log_sz) - 1; cmd->vars.bitmask = (1UL << cmd->vars.max_reg_cmds) - 1; - cmd->vars.cmdif_rev = ioread32be(&dev->iseg->cmdif_rev_fw_sub) >> 16; - if (cmd->vars.cmdif_rev > CMD_IF_REV) { - mlx5_core_err(dev, "driver does not support command interface version. driver %d, firmware %d\n", - CMD_IF_REV, cmd->vars.cmdif_rev); - err = -EOPNOTSUPP; - goto err_free_page; - } - spin_lock_init(&cmd->alloc_lock); spin_lock_init(&cmd->token_lock); for (i = 0; i < MLX5_CMD_OP_MAX; i++)