dmaengine: idxd: fix descriptor flushing locking
authorDave Jiang <dave.jiang@intel.com>
Mon, 13 Dec 2021 18:51:29 +0000 (11:51 -0700)
committerVinod Koul <vkoul@kernel.org>
Wed, 5 Jan 2022 07:41:22 +0000 (13:11 +0530)
commit23a50c8035655c5a1d9b52c878b3ebf7b6b83eea
tree1c7afe044a650d1d3045390a414f6f7773cd79b1
parentec0d64231615e50539d83516b974e7947d45fbce
dmaengine: idxd: fix descriptor flushing locking

The descriptor flushing for shutdown is not holding the irq_entry list
lock. If there's ongoing interrupt completion handling, this can corrupt
the list. Add locking to protect list walking. Also refactor the code so
it's more compact.

Fixes: 8f47d1a5e545 ("dmaengine: idxd: connect idxd to dmaengine subsystem")
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/163942148935.2412839.18282664745572777280.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/idxd/init.c