lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87qzxotcq2.fsf@intel.com>
Date: Wed, 06 Aug 2025 13:30:13 -0700
From: Vinicius Costa Gomes <vinicius.gomes@...el.com>
To: Dave Jiang <dave.jiang@...el.com>, Vinod Koul <vkoul@...nel.org>, Dan
 Williams <dan.j.williams@...el.com>, Fenghua Yu <fenghuay@...dia.com>
Cc: dmaengine@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/9] dmaengine: idxd: Allow DMA clients to empty the
 pending queue

Dave Jiang <dave.jiang@...el.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@...el.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ