[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <871ptcmifk.fsf@AUSNATLYNCH.amd.com>
Date: Mon, 28 Apr 2025 10:09:35 -0500
From: Nathan Lynch <nathan.lynch@....com>
To: Vinod Koul <vkoul@...nel.org>
CC: Peter Ujfalusi <peter.ujfalusi@...il.com>, Dave Jiang
<dave.jiang@...el.com>, <dmaengine@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <wei.huang2@....com>
Subject: Re: [PATCH] dmaengine: dmatest: Don't forcibly terminate channel in
polled mode
> From: Nathan Lynch <nathan.lynch@....com>
>
> Invoking dmaengine_terminate_sync() against the channel after each
> submitted descriptor is strange. It's benign when the test is
> single-threaded, but disruptive when multiple threads are submitting
> descriptors to the channel concurrently:
>
> # cd /sys/module/dmatest/parameters/
> # echo 1 > polled
> # echo 2 > threads_per_chan
> # echo dma0chan0 > channel
> # echo 1 > run
> ...
> dmatest: Added 2 threads using dma0chan0
> dmatest: Started 2 threads using dma0chan0
> xilinx-zynqmp-dma ffa80000.dma: dma_sync_wait: timeout!
> xilinx-zynqmp-dma ffa80000.dma: dma_sync_wait: timeout!
> dmatest: dma0chan0-copy0: result #3: 'test timed out' with
> src_off=0x487 dst_off=0xf8 len=0x171b (0)
> dmatest: dma0chan0-copy1: result #6: 'test timed out' with
> src_off=0x227d dst_off=0xf99 len=0xf7a (0)
>
> Remove the call to dmaengine_terminate_sync() from the main thread
> loop.
>
> Fixes: fb9816f9d05f ("dmaengine: dmatest: Add support for completion polling")
> Signed-off-by: Nathan Lynch <nathan.lynch@....com>
Any feedback on this change? If this is a case of user error or
misunderstanding the code, just let me know.
> ---
> drivers/dma/dmatest.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
> index d891dfca358e209c9a5c2d8b49e3e539130e53e8..4e109c45fe0c5a7e8f337efe6e00e0616977f770 100644
> --- a/drivers/dma/dmatest.c
> +++ b/drivers/dma/dmatest.c
> @@ -835,7 +835,6 @@ static int dmatest_func(void *data)
>
> if (params->polled) {
> status = dma_sync_wait(chan, cookie);
> - dmaengine_terminate_sync(chan);
> if (status == DMA_COMPLETE)
> done->done = true;
> } else {
>
> ---
> base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
> change-id: 20250403-dmaengine-dmatest-poll-mode-fix-671b02dc9084
>
> Best regards,
> --
> Nathan Lynch <nathan.lynch@....com>
Powered by blists - more mailing lists