summaryrefslogtreecommitdiff
path: root/net/strparser
diff options
context:
space:
mode:
authorAlex Vesker <valex@mellanox.com>2018-06-12 16:14:31 +0300
committerSaeed Mahameed <saeedm@mellanox.com>2018-06-27 01:26:34 +0300
commitd412c31dae053bf30a1bc15582a9990df297a660 (patch)
tree28b83ac76b043ee63c6f725894cd235a674b189e /net/strparser
parent603b7bcff824740500ddfa001d7a7168b0b38542 (diff)
downloadlinux-d412c31dae053bf30a1bc15582a9990df297a660.tar.xz
net/mlx5: Fix command interface race in polling mode
The command interface can work in two modes: Events and Polling. In the general case, each time we invoke a command, a work is queued to handle it. When working in events, the interrupt handler completes the command execution. On the other hand, when working in polling mode, the work itself completes it. Due to a bug in the work handler, a command could have been completed by the interrupt handler, while the work handler hasn't finished yet, causing the it to complete once again if the command interface mode was changed from Events to polling after the interrupt handler was called. mlx5_unload_one() mlx5_stop_eqs() // Destroy the EQ before cmd EQ ...cmd_work_handler() write_doorbell() --> EVENT_TYPE_CMD mlx5_cmd_comp_handler() // First free free_ent(cmd, ent->idx) complete(&ent->done) <-- mlx5_stop_eqs //cmd was complete // move to polling before destroying the last cmd EQ mlx5_cmd_use_polling() cmd->mode = POLL; --> cmd_work_handler (continues) if (cmd->mode == POLL) mlx5_cmd_comp_handler() // Double free The solution is to store the cmd->mode before writing the doorbell. Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") Signed-off-by: Alex Vesker <valex@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'net/strparser')
0 files changed, 0 insertions, 0 deletions