]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: Allow async trigger completion execution on single CPU systems
authorRoy Novich <royno@nvidia.com>
Thu, 3 Nov 2022 06:55:38 +0000 (23:55 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Nov 2022 16:42:06 +0000 (17:42 +0100)
commite3d6850a252050eb6f64c3ef8c3aab58882b7f47
treeb95931525fed3e435239a280adfce402f18093f2
parent240de0040062e554db8c4ec63cf1cf20458006e8
net/mlx5: Allow async trigger completion execution on single CPU systems

[ Upstream commit f39bcf141b58b712230f482a75642a894126f80d ]

For a single CPU system, the kernel thread executing mlx5_cmd_flush()
never releases the CPU but calls down_trylock(&cmd→sem) in a busy loop.
On a single processor system, this leads to a deadlock as the kernel
thread which executes mlx5_cmd_invoke() never gets scheduled. Fix this,
by adding the cond_resched() call to the loop, allow the command
completion kernel thread to execute.

Fixes: 381bd440dd77 ("net/mlx5: Set command entry semaphore up once got index free")
Signed-off-by: Alexander Schmidt <alexschm@de.ibm.com>
Signed-off-by: Roy Novich <royno@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/cmd.c