summaryrefslogtreecommitdiff
path: root/drivers/dma
diff options
context:
space:
mode:
authorGustavo Pimentel <Gustavo.Pimentel@synopsys.com>2021-02-18 20:04:06 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-22 11:38:28 +0200
commit41dd2ede953646be2fb38c9c8fb7aed802b94e97 (patch)
treeb8fe30a0b78c30b19615b5175b02558d5c4cdd77 /drivers/dma
parentb003a4923628d5b0ffbbaeda332bfa1a98776cf1 (diff)
downloadlinux-41dd2ede953646be2fb38c9c8fb7aed802b94e97.tar.gz
linux-41dd2ede953646be2fb38c9c8fb7aed802b94e97.tar.bz2
linux-41dd2ede953646be2fb38c9c8fb7aed802b94e97.zip
dmaengine: dw-edma: Fix crash on loading/unloading driver
[ Upstream commit e970dcc4bd8e0a1376e794fc81d41d0fc98262dd ] When the driver is compiled as a module and loaded if we try to unload it, the Kernel shows a crash log. This Kernel crash is due to the dma_async_device_unregister() call done after deleting the channels, this patch fixes this issue. Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com> Link: https://lore.kernel.org/r/4aa850c035cf7ee488f1d3fb6dee0e37be0dce0a.1613674948.git.gustavo.pimentel@synopsys.com Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/dw-edma/dw-edma-core.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/dma/dw-edma/dw-edma-core.c b/drivers/dma/dw-edma/dw-edma-core.c
index 31577316f80b..afbd1a459019 100644
--- a/drivers/dma/dw-edma/dw-edma-core.c
+++ b/drivers/dma/dw-edma/dw-edma-core.c
@@ -910,22 +910,21 @@ int dw_edma_remove(struct dw_edma_chip *chip)
/* Power management */
pm_runtime_disable(dev);
+ /* Deregister eDMA device */
+ dma_async_device_unregister(&dw->wr_edma);
list_for_each_entry_safe(chan, _chan, &dw->wr_edma.channels,
vc.chan.device_node) {
- list_del(&chan->vc.chan.device_node);
tasklet_kill(&chan->vc.task);
+ list_del(&chan->vc.chan.device_node);
}
+ dma_async_device_unregister(&dw->rd_edma);
list_for_each_entry_safe(chan, _chan, &dw->rd_edma.channels,
vc.chan.device_node) {
- list_del(&chan->vc.chan.device_node);
tasklet_kill(&chan->vc.task);
+ list_del(&chan->vc.chan.device_node);
}
- /* Deregister eDMA device */
- dma_async_device_unregister(&dw->wr_edma);
- dma_async_device_unregister(&dw->rd_edma);
-
/* Turn debugfs off */
dw_edma_v0_core_debugfs_off();