From: Lee Jones <lee@kernel.org>
To: Basavaraj Natikar <bnatikar@amd.com>
Cc: Basavaraj Natikar <Basavaraj.Natikar@amd.com>,
Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>,
Gary R Hook <gary.hook@amd.com>,
Philipp Stanner <pstanner@redhat.com>,
dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH 02/10] dmaengine: ae4dma: Unregister DMA engine in ae4_pci_remove()
Date: Tue, 17 Nov 2026 10:38:07 +0000 [thread overview]
Message-ID: <20261117103807.GA64850@joneslee-macbookpro.roam.internal> (raw)
In-Reply-To: <82163263-ac33-42e9-86d6-9b1cebd287af@amd.com>
On Tue, 17 Nov 2026, Basavaraj Natikar wrote:
> Hi,
>
>
> On 11/12/2026 3:22 AM, Lee Jones wrote:
> > [You don't often get email from lee@kernel.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> >
> > ae4_core_init() registers the DMA device and creates the descriptor slab
> > cache via pt_dmaengine_register(), but ae4_pci_remove() never calls
> > pt_dmaengine_unregister(), leaking the descriptor cache and leaving a
> > dangling DMA device registered after device removal.
> >
> > Export pt_dmaengine_unregister() and call it from ae4_pci_remove().
> >
> > Fixes: 98f5a4432622 ("dmaengine: ae4dma: Register AE4DMA using pt_dmaengine_register")
> > Closes: https://sashiko.dev/#/bug/linux-10d41112-e133-4bc5-8e53-b3e96592c70d
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Lee Jones <lee@kernel.org>
> > ---
> > drivers/dma/amd/ae4dma/ae4dma-pci.c | 1 +
> > drivers/dma/amd/ptdma/ptdma-dmaengine.c | 1 +
> > 2 files changed, 2 insertions(+)
> >
> > diff --git a/drivers/dma/amd/ae4dma/ae4dma-pci.c b/drivers/dma/amd/ae4dma/ae4dma-pci.c
> > index 2c63907db228..8712f4f65e28 100644
> > --- a/drivers/dma/amd/ae4dma/ae4dma-pci.c
> > +++ b/drivers/dma/amd/ae4dma/ae4dma-pci.c
> > @@ -132,6 +132,7 @@ static void ae4_pci_remove(struct pci_dev *pdev)
> > {
> > struct ae4_device *ae4 = dev_get_drvdata(&pdev->dev);
> >
> > + pt_dmaengine_unregister(&ae4->pt);
>
> The cache must remain valid until completion processing is quiesced.
> pt_dmaengine_unregister() currently destroys it before ae4_destroy_work().
>
> However, merely reversing these calls is insufficient: the existing worker
> loops indefinitely, so cancel_delayed_work_sync() can hang. We need a
> teardown sequence that safely stops DMA/completion activity before
> destroying the descriptor cache.
I'll look into that. Thank you.
--
Lee Jones
next prev parent reply other threads:[~2026-11-17 10:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 21:52 [PATCH 00/10] dmaengine: Fix teardown races, resource leaks, and error handling Lee Jones
2026-11-11 21:52 ` [PATCH 01/10] dmaengine: pl08x: Defer OF DMA controller registration until slave setup Lee Jones
2026-11-11 21:52 ` [PATCH 02/10] dmaengine: ae4dma: Unregister DMA engine in ae4_pci_remove() Lee Jones
2026-11-17 7:34 ` Basavaraj Natikar
2026-11-17 10:38 ` Lee Jones [this message]
2026-11-11 21:52 ` [PATCH 03/10] dmaengine: ptdma: Unmap descriptor in pt_do_cleanup() Lee Jones
2026-11-11 21:52 ` [PATCH 04/10] dmaengine: ptdma: Remove completed descriptor under vc.lock in pt_cmd_callback_work() Lee Jones
2026-11-11 21:52 ` [PATCH 05/10] dmaengine: amlogic: Destroy free_wq after devres DMA device unregistration Lee Jones
2026-11-11 21:52 ` [PATCH 06/10] dmaengine: arm-dma350: Query dma_cookie_status() under vc.lock in d350_tx_status() Lee Jones
2026-11-11 21:52 ` [PATCH 07/10] dmaengine: bestcomm: Defer publishing bcom_eng until initialisation completes Lee Jones
2026-11-11 21:52 ` [PATCH 08/10] dmaengine: bestcomm: Check rh_create() return value in bcom_sram_init() Lee Jones
2026-11-11 21:52 ` [PATCH 09/10] dmaengine: jz4780: Fix descriptor cleanup on hwdesc setup failure Lee Jones
2026-11-11 21:52 ` [PATCH 10/10] dmaengine: dmatest: Avoid unsigned underflow in min_odd() Lee Jones
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=20261117103807.GA64850@joneslee-macbookpro.roam.internal \
--to=lee@kernel.org \
--cc=Basavaraj.Natikar@amd.com \
--cc=Frank.Li@kernel.org \
--cc=bnatikar@amd.com \
--cc=dmaengine@vger.kernel.org \
--cc=gary.hook@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pstanner@redhat.com \
--cc=stable@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
all inboxes | Powered by JetHome®