WSL2-Linux-Kernel/drivers/dma/idxd
Dave Jiang a5fe76328e dmaengine: idxd: force wq context cleanup on device disable path
commit 44c4237cf3 upstream.

Testing shown that when a wq mode is setup to be dedicated and then torn
down and reconfigured to shared, the wq configured end up being dedicated
anyays. The root cause is when idxd_device_wqs_clear_state() gets called
during idxd_driver removal, idxd_wq_disable_cleanup() does not get called
vs when the wq driver is removed first. The check of wq state being
"enabled" causes the cleanup to be bypassed. However, idxd_driver->remove()
releases all wq drivers. So the wqs goes to "disabled" state and will never
be "enabled". By that point, the driver has no idea if the wq was
previously configured or clean. So force call idxd_wq_disable_cleanup() on
all wqs always to make sure everything gets cleaned up.

Reported-by: Tony Zhu <tony.zhu@intel.com>
Tested-by: Tony Zhu <tony.zhu@intel.com>
Fixes: 0dcfe41e9a ("dmanegine: idxd: cleanup all device related bits after disabling device")
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Co-developed-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Link: https://lore.kernel.org/r/20220628230056.2527816-1-fenghua.yu@intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-12 16:35:19 +02:00
..
Makefile dmaengine: idxd: move dsa_drv support to compatible mode 2021-07-21 10:09:16 +05:30
bus.c Bus: Make remove callback return void tag 2021-07-27 19:12:14 +05:30
cdev.c dmaengine: idxd: Fix the error handling path in idxd_cdev_register() 2022-06-09 10:23:14 +02:00
compat.c dmaengine: idxd: Fix a possible NULL pointer dereference 2021-08-02 12:35:10 +05:30
device.c dmaengine: idxd: force wq context cleanup on device disable path 2022-07-12 16:35:19 +02:00
dma.c dmaengine: idxd: add missing callback function to support DMA_INTERRUPT 2022-06-14 18:36:28 +02:00
idxd.h dmaengine: idxd: change bandwidth token to read buffers 2022-04-08 14:23:45 +02:00
init.c dmaengine: idxd: change bandwidth token to read buffers 2022-04-08 14:23:45 +02:00
irq.c dmaengine: idxd: fix calling wq quiesce inside spinlock 2021-12-22 09:32:38 +01:00
perfmon.c
perfmon.h
registers.h dmaengine: idxd: change bandwidth token to read buffers 2022-04-08 14:23:45 +02:00
submit.c dmaengine: idxd: fix missed completion on abort path 2021-12-22 09:32:41 +01:00
sysfs.c dmaengine: idxd: add RO check for wq max_transfer_size write 2022-04-27 14:38:54 +02:00