mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] dmaengine: dw-edma: Clear chip->dw after removal
@ 2026-11-10  8:24 Koichiro Den
  2026-11-12  3:31 ` Frank Li
  0 siblings, 1 reply; 2+ messages in thread
From: Koichiro Den @ 2026-11-10  8:24 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Vinod Koul, Frank Li, Serge Semin, Bjorn Helgaas
  Cc: dmaengine, linux-kernel

dw_edma_remove() unregisters the DMA device and releases its resources,
but leaves chip->dw set, so the pointer no longer indicates whether the
eDMA instance is still registered. Some in-tree glue drivers call
dw_pcie_ep_deinit() when dw_pcie_ep_init_registers() fails. If
initialization has already removed eDMA, deinitialization attempts to
tear down the same instance again.

Regardless of whether those error paths are reworked, clear chip->dw on
removal to match its assignment on successful probe. This also lets the
existing NULL check skip repeated teardown.

Fixes: 869bc5253406 ("PCI: dwc: ep: Fix DBI access failure for drivers requiring refclk from host")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/20261022082230.3164834-1-den@valinux.co.jp?part=2
Signed-off-by: Koichiro Den <den@valinux.co.jp>
---
 drivers/dma/dw-edma/dw-edma-core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/dma/dw-edma/dw-edma-core.c b/drivers/dma/dw-edma/dw-edma-core.c
index d682074eaa0e..daa2084485d5 100644
--- a/drivers/dma/dw-edma/dw-edma-core.c
+++ b/drivers/dma/dw-edma/dw-edma-core.c
@@ -1509,6 +1509,8 @@ int dw_edma_remove(struct dw_edma_chip *chip)
 		list_del(&chan->vc.chan.device_node);
 	}
 
+	chip->dw = NULL;
+
 	return err;
 }
 EXPORT_SYMBOL_GPL(dw_edma_remove);

base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb
-- 
2.54.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-12  3:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-10  8:24 [PATCH] dmaengine: dw-edma: Clear chip->dw after removal Koichiro Den
2026-11-12  3:31 ` Frank Li

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®