dmaengine: idxd: fix retry value to be constant for duration of function call
authorDave Jiang <dave.jiang@intel.com>
Mon, 18 Apr 2022 21:33:21 +0000 (14:33 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Apr 2022 12:41:03 +0000 (14:41 +0200)
commit18dd60b7a45da4c6e0d40d084a154fb0f1aedf2e
tree9126ba914b3f998e78df20364340ed6cadb6205e
parent12b5ce51a12563e6b7ff23d0f1fc5f58185a6190
dmaengine: idxd: fix retry value to be constant for duration of function call

[ Upstream commit bc3452cdfc468a65965d0ac397c940acb787ea4d ]

When retries is compared to wq->enqcmds_retries each loop of idxd_enqcmds(),
wq->enqcmds_retries can potentially changed by user. Assign the value
of retries to wq->enqcmds_retries during initialization so it is the
original value set when entering the function.

Fixes: 7930d8553575 ("dmaengine: idxd: add knob for enqcmds retries")
Suggested-by: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/165031760154.3658664.1983547716619266558.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