]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: Fix forced completion access non initialized command entry
authorMoshe Shemesh <moshe@mellanox.com>
Sun, 21 Jul 2019 05:40:13 +0000 (08:40 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 30 Apr 2020 16:20:32 +0000 (09:20 -0700)
commit14afa5460313b732723e1968e51417c64e093f60
tree899fdb73f0881b6ed89808b3043b40df85b230e6
parent51501c18316d3b533db06453464c747af55aac47
net/mlx5: Fix forced completion access non initialized command entry

mlx5_cmd_flush() will trigger forced completions to all valid command
entries. Triggered by an asynch event such as fast teardown it can
happen at any stage of the command, including command initialization.
It will trigger forced completion and that can lead to completion on an
uninitialized command entry.

Setting MLX5_CMD_ENT_STATE_PENDING_COMP only after command entry is
initialized will ensure force completion is treated only if command
entry is initialized.

Fixes: b030b9ffaff2 ("net/mlx5: Avoid using pending command interface slots")
Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/cmd.c