DMA Engine development
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: Vinicius Costa Gomes <vinicius.gomes@intel.com>,
	Vinod Koul <vkoul@kernel.org>,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: kristen.c.accardi@intel.com, kernel test robot <oliver.sang@intel.com>
Subject: Re: [PATCH v1] dmaengine: dmatest: Fix dmatest waiting less when interrupted
Date: Wed, 5 Mar 2025 16:14:15 -0700	[thread overview]
Message-ID: <3dc1c3cb-b19a-4fa5-86b9-0862a96418d1@intel.com> (raw)
In-Reply-To: <20250305230007.590178-1-vinicius.gomes@intel.com>



On 3/5/25 4:00 PM, Vinicius Costa Gomes wrote:
> 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>

Reviewed-by: Dave Jiang <dave.jiang@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);


  reply	other threads:[~2025-03-05 23:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3dc1c3cb-b19a-4fa5-86b9-0862a96418d1@intel.com \
    --to=dave.jiang@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=kristen.c.accardi@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oliver.sang@intel.com \
    --cc=vinicius.gomes@intel.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox