public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] dmaengine: dmatest: Fix dmatest waiting less when interrupted
@ 2025-03-05 23:00 Vinicius Costa Gomes
  2025-03-05 23:14 ` Dave Jiang
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Vinicius Costa Gomes @ 2025-03-05 23:00 UTC (permalink / raw)
  To: Vinod Koul, dmaengine, linux-kernel
  Cc: dave.jiang, kristen.c.accardi, Vinicius Costa Gomes,
	kernel test robot

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 <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202502171134.8c403348-lkp@intel.com
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
---
 drivers/dma/dmatest.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index 91b2fbc0b864..d891dfca358e 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -841,9 +841,9 @@ static int dmatest_func(void *data)
 		} else {
 			dma_async_issue_pending(chan);
 
-			wait_event_freezable_timeout(thread->done_wait,
-					done->done,
-					msecs_to_jiffies(params->timeout));
+			wait_event_timeout(thread->done_wait,
+					   done->done,
+					   msecs_to_jiffies(params->timeout));
 
 			status = dma_async_is_tx_complete(chan, cookie, NULL,
 							  NULL);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-04-03 16:24 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-05 23:00 [PATCH v1] dmaengine: dmatest: Fix dmatest waiting less when interrupted Vinicius Costa Gomes
2025-03-05 23:14 ` Dave Jiang
2025-03-10 21:06 ` Vinod Koul
2025-03-12 18:58 ` Nathan Lynch
2025-03-12 22:13   ` Vinicius Costa Gomes
2025-03-13 14:10     ` Nathan Lynch
2025-03-13 16:36       ` Vinicius Costa Gomes
2025-03-13 21:21         ` Nathan Lynch
2025-03-13 23:29           ` Vinicius Costa Gomes
2025-03-14 21:35             ` Nathan Lynch
2025-03-14 22:24               ` Vinicius Costa Gomes
2025-04-02 13:45                 ` Nathan Lynch
2025-04-03  3:44                   ` Vinicius Costa Gomes
2025-04-03 16:24                     ` Nathan Lynch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox