Skip to content

Commit aa72f1d

Browse files
andy-shevvinodkoul
authored andcommitted
dmaengine: dmatest: Fix process hang when reading 'wait' parameter
If we do % echo 1 > /sys/module/dmatest/parameters/run [ 115.851124] dmatest: Could not start test, no channels configured % echo dma8chan7 > /sys/module/dmatest/parameters/channel [ 127.563872] dmatest: Added 1 threads using dma8chan7 % cat /sys/module/dmatest/parameters/wait ... !!! HANG !!! ... The culprit is the commit 6138f96 ("dmaengine: dmatest: Use fixed point div to calculate iops") which makes threads not to run, but pending and being kicked off by writing to the 'run' node. However, it forgot to consider 'wait' routine to avoid above mentioned case. In order to fix this, check for really running threads, i.e. with pending and done flags unset. It's pity the culprit commit hadn't updated documentation and tested all possible scenarios. Fixes: 6138f96 ("dmaengine: dmatest: Use fixed point div to calculate iops") Cc: Seraj Alijan <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent b9f9602 commit aa72f1d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/dma/dmatest.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ static bool is_threaded_test_run(struct dmatest_info *info)
240240
struct dmatest_thread *thread;
241241

242242
list_for_each_entry(thread, &dtc->threads, node) {
243-
if (!thread->done)
243+
if (!thread->done && !thread->pending)
244244
return true;
245245
}
246246
}

0 commit comments

Comments
 (0)