提交 38068122 编写于 作者: G Gustavo Pimentel 提交者: Zheng Zengkai

dmaengine: dw-edma: Fix crash on loading/unloading driver

stable inclusion
from stable-5.10.39
commit 3029ef71ab227af7c0ffb7956c2da4b1882aa23b
bugzilla: 51881
CVE: NA

--------------------------------

[ Upstream commit e970dcc4 ]

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: NGustavo Pimentel <gustavo.pimentel@synopsys.com>
Link: https://lore.kernel.org/r/4aa850c035cf7ee488f1d3fb6dee0e37be0dce0a.1613674948.git.gustavo.pimentel@synopsys.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 8bd69e75
...@@ -937,22 +937,21 @@ int dw_edma_remove(struct dw_edma_chip *chip) ...@@ -937,22 +937,21 @@ int dw_edma_remove(struct dw_edma_chip *chip)
/* Power management */ /* Power management */
pm_runtime_disable(dev); 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, list_for_each_entry_safe(chan, _chan, &dw->wr_edma.channels,
vc.chan.device_node) { vc.chan.device_node) {
list_del(&chan->vc.chan.device_node);
tasklet_kill(&chan->vc.task); 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, list_for_each_entry_safe(chan, _chan, &dw->rd_edma.channels,
vc.chan.device_node) { vc.chan.device_node) {
list_del(&chan->vc.chan.device_node);
tasklet_kill(&chan->vc.task); 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 */ /* Turn debugfs off */
dw_edma_v0_core_debugfs_off(); dw_edma_v0_core_debugfs_off();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册