From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:50360 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752585AbdHHX3R (ORCPT ); Tue, 8 Aug 2017 19:29:17 -0400 Subject: Patch "net/mlx5: Fix command completion after timeout access invalid structure" has been added to the 4.12-stable tree To: moshe@mellanox.com, gregkh@linuxfoundation.org, saeedm@mellanox.com Cc: , From: Date: Tue, 08 Aug 2017 16:29:14 -0700 Message-ID: <1502234954117124@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: 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 know about it. >>From foo@baz Tue Aug 8 16:27:29 PDT 2017 From: Moshe Shemesh Date: Thu, 6 Jul 2017 15:48:40 +0300 Subject: net/mlx5: Fix command completion after timeout access invalid structure From: Moshe Shemesh [ 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') Signed-off-by: Moshe Shemesh Cc: kernel-team@fb.com Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c @@ -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 moshe@mellanox.com 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