dmaengine: idxd: fix wq slot allocation index check
authorDave Jiang <dave.jiang@intel.com>
Thu, 22 Jul 2021 17:54:10 +0000 (10:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 26 Sep 2021 12:08:58 +0000 (14:08 +0200)
commit48271d10bf4cbdd4693ad4f94fb14c2aa7fcc4c5
treeb9865de0c320635bba753d7c623dd9b724aebda5
parent777344da345a374eb74f2a743b5399e6e60d566b
dmaengine: idxd: fix wq slot allocation index check

[ Upstream commit 673d812d30be67942762bb9e8548abb26a3ba4a7 ]

The sbitmap wait and allocate routine checks the index that is returned
from sbitmap_queue_get(). It should be idxd >= 0 as 0 is also a valid
index. This fixes issue where submission path hangs when WQ size is 1.

Fixes: 0705107fcc80 ("dmaengine: idxd: move submission to sbitmap_queue")
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/162697645067.3478714.506720687816951762.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/dma/idxd/submit.c