Skip to content

Commit 17502e7

Browse files
ysunvinodkoul
authored andcommitted
dmaengine: idxd: Check availability of workqueue allocated by idxd wq driver before using
Running IDXD workloads in a container with the /dev directory mounted can trigger a call trace or even a kernel panic when the parent process of the container is terminated. This issue occurs because, under certain configurations, Docker does not properly propagate the mount replica back to the original mount point. In this case, when the user driver detaches, the WQ is destroyed but it still calls destroy_workqueue() attempting to completes all pending work. It's necessary to check wq->wq and skip the drain if it no longer exists. Signed-off-by: Yi Sun <[email protected]> Reviewed-by: Dave Jiang <[email protected]> Reviewed-by: Anil S Keshavamurthy <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 7e01511 commit 17502e7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/dma/idxd/cdev.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,9 @@ static void idxd_cdev_evl_drain_pasid(struct idxd_wq *wq, u32 pasid)
349349
set_bit(h, evl->bmap);
350350
h = (h + 1) % size;
351351
}
352-
drain_workqueue(wq->wq);
352+
if (wq->wq)
353+
drain_workqueue(wq->wq);
354+
353355
mutex_unlock(&evl->lock);
354356
}
355357

0 commit comments

Comments
 (0)