OSDN Git Service

IB/hfi1: Close VNIC sdma_progress sleep window
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Wed, 28 Nov 2018 18:32:48 +0000 (10:32 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Dec 2019 07:52:31 +0000 (08:52 +0100)
commit647ded863b5a3733679e402e3d17bc149bb16f3e
treefb8c1b7d7932cee295daee984167ed66580246c2
parent46824288a5fc7b7e5166be2b6c303d98a41bd631
IB/hfi1: Close VNIC sdma_progress sleep window

[ Upstream commit 18912c4524385dd6532c682cb9d4f6aa39ba8d47 ]

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 vnic_sdma xmit will hang.

Fix by moving the lock to enclose the sdma_progress() call.

Also, delete the tx_retry. The need for this was removed by:
commit bcad29137a97 ("IB/hfi1: Serve the most starved iowait entry first")

Fixes: 64551ede6cd1 ("IB/hfi1: VNIC SDMA support")
Reviewed-by: Gary Leshner <Gary.S.Leshner@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/hfi1/vnic_sdma.c