mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
6744a030d8
On driver unload any pending descriptors are flushed and pending
DMA descriptors are explicitly completed:
idxd_dmaengine_drv_remove() ->
drv_disable_wq() ->
idxd_wq_free_irq() ->
idxd_flush_pending_descs() ->
idxd_dma_complete_txd()
With this done during driver unload any remaining descriptor is
likely stuck and can be dropped. Even so, the descriptor may still
have a callback set that could no longer be accessible. An
example of such a problem is when the dmatest fails and the dmatest
module is unloaded. The failure of dmatest leaves descriptors with
dma_async_tx_descriptor::callback pointing to code that no longer
exist. This causes a page fault as below at the time the IDXD driver
is unloaded when it attempts to run the callback:
BUG: unable to handle page fault for address: ffffffffc0665190
#PF: supervisor instruction fetch in kernel mode
#PF: error_code(0x0010) - not-present page
Fix this by clearing the callback pointers on the transmit
descriptors only when workqueue is disabled.
Fixes:
|
||
---|---|---|
.. | ||
bus.c | ||
cdev.c | ||
compat.c | ||
device.c | ||
dma.c | ||
idxd.h | ||
init.c | ||
irq.c | ||
Makefile | ||
perfmon.c | ||
perfmon.h | ||
registers.h | ||
submit.c | ||
sysfs.c |