All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
To: Dave Jiang <dave.jiang@intel.com>, Vinod Koul <vkoul@kernel.org>,
	Dan Williams <dan.j.williams@intel.com>,
	Fenghua Yu <fenghuay@nvidia.com>
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/9] dmaengine: idxd: Allow DMA clients to empty the pending queue
Date: Wed, 06 Aug 2025 13:30:13 -0700	[thread overview]
Message-ID: <87qzxotcq2.fsf@intel.com> (raw)
In-Reply-To: <006d3386-36ef-4c14-9373-7f6594a800f1@intel.com>

Dave Jiang <dave.jiang@intel.com> writes:

> On 8/4/25 6:27 PM, Vinicius Costa Gomes wrote:
>> Send a request to drain all pending commands from the hardware queue
>> when the DMA clients request.
>> 
>> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
>> ---
>>  drivers/dma/idxd/dma.c | 10 ++++++++++
>>  1 file changed, 10 insertions(+)
>> 
>> diff --git a/drivers/dma/idxd/dma.c b/drivers/dma/idxd/dma.c
>> index dbecd699237e3ac5a73b49ed2097a897abc9a043..10356a00cbdfc2ddfeea629aa749c40e7eec0a56 100644
>> --- a/drivers/dma/idxd/dma.c
>> +++ b/drivers/dma/idxd/dma.c
>> @@ -194,6 +194,15 @@ static void idxd_dma_release(struct dma_device *device)
>>  	kfree(idxd_dma);
>>  }
>>  
>> +static int idxd_dma_terminate_all(struct dma_chan *c)
>> +{
>> +	struct idxd_wq *wq = to_idxd_wq(c);
>> +
>> +	idxd_wq_drain(wq);
>
> Definition in include/linux/dmaengine.h is "Aborts all transfers on a
> channel." So instead of drain, I think we need to abort and clean up
> all the pending descriptors on the irq list as well. Perhaps drain may
> be only for ->device_synchronize()?

I was considering more the documentation in dmaengine_terminate_async().
But will check again for the expectations of the "core" dmaengine, I
could be missing something. Thanks for checking this.

>
> DJ
>
>> +
>> +	return 0;
>> +}
>> +
>>  int idxd_register_dma_device(struct idxd_device *idxd)
>>  {
>>  	struct idxd_dma_dev *idxd_dma;
>> @@ -224,6 +233,7 @@ int idxd_register_dma_device(struct idxd_device *idxd)
>>  	dma->device_issue_pending = idxd_dma_issue_pending;
>>  	dma->device_alloc_chan_resources = idxd_dma_alloc_chan_resources;
>>  	dma->device_free_chan_resources = idxd_dma_free_chan_resources;
>> +	dma->device_terminate_all = idxd_dma_terminate_all;
>>  
>>  	rc = dma_async_device_register(dma);
>>  	if (rc < 0) {
>> 
>

Cheers,
-- 
Vinicius

  reply	other threads:[~2025-08-06 20:30 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-05  1:27 [PATCH 0/9] dmaengine: idxd: Memory leak and FLR fixes Vinicius Costa Gomes
2025-08-05  1:27 ` [PATCH 1/9] dmaengine: idxd: Fix lockdep warnings when calling idxd_device_config() Vinicius Costa Gomes
2025-08-06 17:02   ` Dave Jiang
2025-08-06 20:25     ` Vinicius Costa Gomes
2025-08-05  1:27 ` [PATCH 2/9] dmaengine: idxd: Fix crash when the event log is disabled Vinicius Costa Gomes
2025-08-06 17:07   ` Dave Jiang
2025-08-05  1:27 ` [PATCH 3/9] dmaengine: idxd: Fix possible invalid memory access after FLR Vinicius Costa Gomes
2025-08-06 17:09   ` Dave Jiang
2025-08-15 19:26   ` Nathan Lynch
2025-08-15 22:45     ` Vinicius Costa Gomes
2025-08-05  1:27 ` [PATCH 4/9] dmaengine: idxd: Flush kernel workqueues on Field Level Reset Vinicius Costa Gomes
2025-08-06 17:12   ` Dave Jiang
2025-08-05  1:27 ` [PATCH 5/9] dmaengine: idxd: Allow DMA clients to empty the pending queue Vinicius Costa Gomes
2025-08-06 17:17   ` Dave Jiang
2025-08-06 20:30     ` Vinicius Costa Gomes [this message]
2025-08-05  1:27 ` [PATCH 6/9] dmaengine: idxd: Fix not releasing workqueue on .release() Vinicius Costa Gomes
2025-08-06 17:24   ` Dave Jiang
2025-08-05  1:27 ` [PATCH 7/9] dmaengine: idxd: Fix memory leak when a wq is reset Vinicius Costa Gomes
2025-08-06 17:25   ` Dave Jiang
2025-08-05  1:27 ` [PATCH 8/9] dmaengine: idxd: Fix freeing the allocated ida too late Vinicius Costa Gomes
2025-08-06 17:27   ` Dave Jiang
2025-08-05  1:28 ` [PATCH 9/9] dmaengine: idxd: Fix leaking event log memory Vinicius Costa Gomes
2025-08-06 17:29   ` Dave Jiang

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=87qzxotcq2.fsf@intel.com \
    --to=vinicius.gomes@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=fenghuay@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.