Skip to contentSkip to conversation

Patch "net/mlx5: Fix command completion after timeout access invalid structure" has been added to the 4.12-stable tree

PATCH [email protected] 1 participant 1 message Aug 8, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

net/mlx5: Fix command completion after timeout access invalid structure

to the 4.12-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-fix-command-completion-after-timeout-access-invalid-structure.patch
and it can be found in the queue-4.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Tue Aug 8 16:27:29 PDT 2017

From: Moshe Shemesh <[email protected]>
Date: Thu, 6 Jul 2017 15:48:40 +0300
Subject: net/mlx5: Fix command completion after timeout access invalid structure

From: Moshe Shemesh <[email protected]>

[ Upstream commit 061870800efb4e3d1ad4082a2569363629bdfcfc ]

Completion on timeout should not free the driver command entry structure as it will need to access it again once real completion event from FW will occur.

Fixes 73dd3a4839c1 ('net/mlx5: Avoid using pending command interface slots')
---
 drivers/net/ethernet/mellanox/mlx5/core/cmd.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/cmd.c +4 -2
@@ -955,7 +955,7 @@ static int mlx5_cmd_invoke(struct mlx5_c
 
 	err = wait_func(dev, ent);
 	if (err == -ETIMEDOUT)
-		goto out_free;
+		goto out;
 
 	ds = ent->ts2 - ent->ts1;
 	op = MLX5_GET(mbox_in, in->first.data, opcode);
@@ -1419,6 +1419,7 @@ void mlx5_cmd_comp_handler(struct mlx5_c
 					mlx5_core_err(dev, "Command completion arrived after timeout (entry idx = %d).\n",
 						      ent->idx);
 					free_ent(cmd, ent->idx);
+					free_cmd(ent);
 				}
 				continue;
 			}
@@ -1477,7 +1478,8 @@ void mlx5_cmd_comp_handler(struct mlx5_c
 				free_msg(dev, ent->in);
 
 				err = err ? err : ent->status;
-				free_cmd(ent);
+				if (!forced)
+					free_cmd(ent);
 				callback(err, context);
 			} else {
 				complete(&ent->done);

Patches currently in stable-queue which might be from [email protected] are

queue-4.12/net-mlx5-fix-command-bad-flow-on-command-entry-allocation-failure.patch queue-4.12/net-mlx5-fix-command-completion-after-timeout-access-invalid-structure.patch