Skip to content

Commit e87ca16

Browse files
vcgomesvinodkoul
authored andcommitted
dmaengine: dmatest: Fix dmatest waiting less when interrupted
Change the "wait for operation finish" logic to take interrupts into account. When using dmatest with idxd DMA engine, it's possible that during longer tests, the interrupt notifying the finish of an operation happens during wait_event_freezable_timeout(), which causes dmatest to cleanup all the resources, some of which might still be in use. This fix ensures that the wait logic correctly handles interrupts, preventing premature cleanup of resources. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-lkp/[email protected] Signed-off-by: Vinicius Costa Gomes <[email protected]> Reviewed-by: Dave Jiang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 1fe283e commit e87ca16

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/dma/dmatest.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -841,9 +841,9 @@ static int dmatest_func(void *data)
841841
} else {
842842
dma_async_issue_pending(chan);
843843

844-
wait_event_freezable_timeout(thread->done_wait,
845-
done->done,
846-
msecs_to_jiffies(params->timeout));
844+
wait_event_timeout(thread->done_wait,
845+
done->done,
846+
msecs_to_jiffies(params->timeout));
847847

848848
status = dma_async_is_tx_complete(chan, cookie, NULL,
849849
NULL);

0 commit comments

Comments
 (0)