dmaengine: idxd: fix cdev locking for open and release
authorNikhil Rao <nikhil.rao@intel.com>
Mon, 22 Jun 2020 20:38:34 +0000 (13:38 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jul 2020 07:34:06 +0000 (09:34 +0200)
commit5f296630f1ba5fcbc7ab1b0f7f4a901c7eb7574b
tree3f2d544cf5948a39b4196b581c7e85779bb085b4
parentd2c452814bce34cc70edc4b97f29e9771b78ea94
dmaengine: idxd: fix cdev locking for open and release

[ Upstream commit 66983bc18fad17d10766650b3685045f6f092d73 ]

add the wq lock in cdev open and release call. This fixes
race conditions observed in the open and close routines.

Fixes: 42d279f9137a ("dmaengine: idxd: add char driver to expose submission portal to userland")
Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/159285824892.64944.2905413694915141834.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/cdev.c