commit da9de5f8527f4b9efc82f967d29a583318c034c7 upstream.
The call to sdma_progress() is called outside the wait lock.
In this case, there is a race condition where sdma_progress() can return
false and the sdma_engine can idle. If that happens, there will be no
more sdma interrupts to cause the wakeup and the user_sdma xmit will hang.
Fix by moving the lock to enclose the sdma_progress() call.
Also, delete busycount. The need for this was removed by:
commit bcad2913 ("IB/hfi1: Serve the most starved iowait entry first")
Ported to linux-4.14.y.
Fixes: 77241056 ("IB/hfi1: add driver files")
Reviewed-by: Gary Leshner <Gary.S.Leshner@intel.com>
Signed-off-by: Mike Marciniszyn <firstname.lastname@example.org>
Signed-off-by: Dennis Dalessandro <email@example.com>
Signed-off-by: Jason Gunthorpe <firstname.lastname@example.org>
Signed-off-by: Sasha Levin <email@example.com>