|
Takashi Iwai |
e31400 |
From e970dcc4bd8e0a1376e794fc81d41d0fc98262dd Mon Sep 17 00:00:00 2001
|
|
Takashi Iwai |
e31400 |
From: Gustavo Pimentel <Gustavo.Pimentel@synopsys.com>
|
|
Takashi Iwai |
e31400 |
Date: Thu, 18 Feb 2021 20:04:06 +0100
|
|
Takashi Iwai |
e31400 |
Subject: [PATCH] dmaengine: dw-edma: Fix crash on loading/unloading driver
|
|
Takashi Iwai |
e31400 |
Git-commit: e970dcc4bd8e0a1376e794fc81d41d0fc98262dd
|
|
Takashi Iwai |
e31400 |
Patch-mainline: v5.13-rc1
|
|
Takashi Iwai |
e31400 |
References: git-fixes
|
|
Takashi Iwai |
e31400 |
|
|
Takashi Iwai |
e31400 |
When the driver is compiled as a module and loaded if we try to unload
|
|
Takashi Iwai |
e31400 |
it, the Kernel shows a crash log. This Kernel crash is due to the
|
|
Takashi Iwai |
e31400 |
dma_async_device_unregister() call done after deleting the channels,
|
|
Takashi Iwai |
e31400 |
this patch fixes this issue.
|
|
Takashi Iwai |
e31400 |
|
|
Takashi Iwai |
e31400 |
Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
|
|
Takashi Iwai |
e31400 |
Link: https://lore.kernel.org/r/4aa850c035cf7ee488f1d3fb6dee0e37be0dce0a.1613674948.git.gustavo.pimentel@synopsys.com
|
|
Takashi Iwai |
e31400 |
Signed-off-by: Vinod Koul <vkoul@kernel.org>
|
|
Takashi Iwai |
e31400 |
Acked-by: Takashi Iwai <tiwai@suse.de>
|
|
Takashi Iwai |
e31400 |
|
|
Takashi Iwai |
e31400 |
---
|
|
Takashi Iwai |
e31400 |
drivers/dma/dw-edma/dw-edma-core.c | 11 +++++------
|
|
Takashi Iwai |
e31400 |
1 file changed, 5 insertions(+), 6 deletions(-)
|
|
Takashi Iwai |
e31400 |
|
|
Takashi Iwai |
e31400 |
--- a/drivers/dma/dw-edma/dw-edma-core.c
|
|
Takashi Iwai |
e31400 |
+++ b/drivers/dma/dw-edma/dw-edma-core.c
|
|
Takashi Iwai |
e31400 |
@@ -910,22 +910,21 @@ int dw_edma_remove(struct dw_edma_chip *
|
|
Takashi Iwai |
e31400 |
/* Power management */
|
|
Takashi Iwai |
e31400 |
pm_runtime_disable(dev);
|
|
Takashi Iwai |
e31400 |
|
|
Takashi Iwai |
e31400 |
+ /* Deregister eDMA device */
|
|
Takashi Iwai |
e31400 |
+ dma_async_device_unregister(&dw->wr_edma);
|
|
Takashi Iwai |
e31400 |
list_for_each_entry_safe(chan, _chan, &dw->wr_edma.channels,
|
|
Takashi Iwai |
e31400 |
vc.chan.device_node) {
|
|
Takashi Iwai |
e31400 |
- list_del(&chan->vc.chan.device_node);
|
|
Takashi Iwai |
e31400 |
tasklet_kill(&chan->vc.task);
|
|
Takashi Iwai |
e31400 |
+ list_del(&chan->vc.chan.device_node);
|
|
Takashi Iwai |
e31400 |
}
|
|
Takashi Iwai |
e31400 |
|
|
Takashi Iwai |
e31400 |
+ dma_async_device_unregister(&dw->rd_edma);
|
|
Takashi Iwai |
e31400 |
list_for_each_entry_safe(chan, _chan, &dw->rd_edma.channels,
|
|
Takashi Iwai |
e31400 |
vc.chan.device_node) {
|
|
Takashi Iwai |
e31400 |
- list_del(&chan->vc.chan.device_node);
|
|
Takashi Iwai |
e31400 |
tasklet_kill(&chan->vc.task);
|
|
Takashi Iwai |
e31400 |
+ list_del(&chan->vc.chan.device_node);
|
|
Takashi Iwai |
e31400 |
}
|
|
Takashi Iwai |
e31400 |
|
|
Takashi Iwai |
e31400 |
- /* Deregister eDMA device */
|
|
Takashi Iwai |
e31400 |
- dma_async_device_unregister(&dw->wr_edma);
|
|
Takashi Iwai |
e31400 |
- dma_async_device_unregister(&dw->rd_edma);
|
|
Takashi Iwai |
e31400 |
-
|
|
Takashi Iwai |
e31400 |
/* Turn debugfs off */
|
|
Takashi Iwai |
e31400 |
dw_edma_v0_core_debugfs_off();
|
|
Takashi Iwai |
e31400 |
|