NTB: perf: Fix race condition when run with ntb_test
authorLogan Gunthorpe <logang@deltatee.com>
Wed, 9 Jan 2019 19:22:32 +0000 (12:22 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:50:41 +0000 (17:50 +0200)
commitabf918236a79ced6e2d635b1c622a97d8108ce75
treed950363e06032daf8f0ffc15c7cffe53ecf82bfe
parent50a79b96b951833172bf0d87349f2e3a6a2fae29
NTB: perf: Fix race condition when run with ntb_test

[ Upstream commit 34d8673a01b053b6231a995a4eec9341163d63be ]

When running ntb_test, the script tries to run the ntb_perf test
immediately after probing the modules. Since adding multi-port support,
this fails seeing the new initialization procedure in ntb_perf
can not complete instantly.

To fix this we add a completion which is waited on when a test is
started. In this way, run can be written any time after the module is
loaded and it will wait for the initialization to complete instead of
sending an error.

Fixes: 5648e56d03fa ("NTB: ntb_perf: Add full multi-port NTB API support")
Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Acked-by: Allen Hubbe <allenbh@gmail.com>
Tested-by: Alexander Fomichev <fomichev.ru@gmail.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/ntb/test/ntb_perf.c