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>
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND v2 04/10] dmaengine: idxd: Flush kernel workqueues on Function Level Reset
Date: Fri, 16 Jan 2026 17:18:10 -0800 [thread overview]
Message-ID: <87v7h16nql.fsf@intel.com> (raw)
In-Reply-To: <8cded3aa-c152-4db2-859d-4835155a0a6a@intel.com>
Dave Jiang <dave.jiang@intel.com> writes:
> On 1/15/26 3:47 PM, Vinicius Costa Gomes wrote:
>> When a Function Level Reset (FLR) happens, terminate the pending
>> descriptors that were issued by in-kernel users and disable the
>> interrupts associated with those. They will be re-enabled after FLR
>> finishes.
>>
>> idxd_wq_flush_desc() is declared on idxd.h because it's going to be
>> used in by the DMA backend in a future patch.
>>
>> Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
>> ---
>> drivers/dma/idxd/device.c | 20 ++++++++++++++++++++
>> drivers/dma/idxd/idxd.h | 1 +
>> drivers/dma/idxd/irq.c | 16 ++++++++++++++++
>> 3 files changed, 37 insertions(+)
>>
>> diff --git a/drivers/dma/idxd/device.c b/drivers/dma/idxd/device.c
>> index 5265925f3076..b8422dc7d2ca 100644
>> --- a/drivers/dma/idxd/device.c
>> +++ b/drivers/dma/idxd/device.c
>> @@ -1339,6 +1339,11 @@ void idxd_wq_free_irq(struct idxd_wq *wq)
>>
>> free_irq(ie->vector, ie);
>> idxd_flush_pending_descs(ie);
>> +
>> + /* The interrupt might have been already released by FLR */
>> + if (ie->int_handle == INVALID_INT_HANDLE)
>> + return;
>> +
>> if (idxd->request_int_handles)
>> idxd_device_release_int_handle(idxd, ie->int_handle, IDXD_IRQ_MSIX);
>> idxd_device_clear_perm_entry(idxd, ie);
>> @@ -1347,6 +1352,21 @@ void idxd_wq_free_irq(struct idxd_wq *wq)
>> ie->pasid = IOMMU_PASID_INVALID;
>> }
>>
>> +void idxd_wq_flush_descs(struct idxd_wq *wq)
>> +{
>> + struct idxd_irq_entry *ie = &wq->ie;
>> + struct idxd_device *idxd = wq->idxd;
>> +
> Should it take a wq lock for this function?
>
Good catch. Will take a another look and see if I am missing any locks
elsewhere.
Cheers,
--
Vinicius
next prev parent reply other threads:[~2026-01-17 1:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-15 22:47 [PATCH RESEND v2 00/10] dmaengine: idxd: Memory leak and FLR fixes Vinicius Costa Gomes
2026-01-15 22:47 ` [PATCH RESEND v2 01/10] dmaengine: idxd: Fix lockdep warnings when calling idxd_device_config() Vinicius Costa Gomes
2026-01-16 20:08 ` Dave Jiang
2026-01-15 22:47 ` [PATCH RESEND v2 02/10] dmaengine: idxd: Fix crash when the event log is disabled Vinicius Costa Gomes
2026-01-15 22:47 ` [PATCH RESEND v2 03/10] dmaengine: idxd: Fix possible invalid memory access after FLR Vinicius Costa Gomes
2026-01-15 22:47 ` [PATCH RESEND v2 04/10] dmaengine: idxd: Flush kernel workqueues on Function Level Reset Vinicius Costa Gomes
2026-01-16 20:16 ` Dave Jiang
2026-01-17 1:18 ` Vinicius Costa Gomes [this message]
2026-01-15 22:47 ` [PATCH RESEND v2 05/10] dmaengine: idxd: Flush all pending descriptors Vinicius Costa Gomes
2026-01-16 20:22 ` Dave Jiang
2026-01-15 22:47 ` [PATCH RESEND v2 06/10] dmaengine: idxd: Wait for submitted operations on .device_synchronize() Vinicius Costa Gomes
2026-01-16 20:27 ` Dave Jiang
2026-01-15 22:47 ` [PATCH RESEND v2 07/10] dmaengine: idxd: Fix not releasing workqueue on .release() Vinicius Costa Gomes
2026-01-15 22:47 ` [PATCH RESEND v2 08/10] dmaengine: idxd: Fix memory leak when a wq is reset Vinicius Costa Gomes
2026-01-15 22:47 ` [PATCH RESEND v2 09/10] dmaengine: idxd: Fix freeing the allocated ida too late Vinicius Costa Gomes
2026-01-15 22:47 ` [PATCH RESEND v2 10/10] dmaengine: idxd: Fix leaking event log memory Vinicius Costa Gomes
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=87v7h16nql.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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox