From f882101122aa110ef8e64be04472e5a47030300e Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Mon, 16 Dec 2019 11:53:23 +0100 Subject: dmaengine: virt-dma: Do not call desc_free() under a spin_lock vchan_vdesc_fini() shouldn't be called under a spin_lock. This is done in two places, once in vchan_terminate_vdesc() and once in vchan_synchronize(). Instead of freeing the vdesc right away, collect the aborted vdescs on a separate list and free them along with the other vdescs. The terminated descs are also freed in vchan_synchronize as done before this patch. Signed-off-by: Sascha Hauer Reviewed-by: Peter Ujfalusi Tested-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20191216105328.15198-5-s.hauer@pengutronix.de Signed-off-by: Vinod Koul --- drivers/dma/virt-dma.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/dma/virt-dma.c') diff --git a/drivers/dma/virt-dma.c b/drivers/dma/virt-dma.c index 7ba712888ac7..26e08c7a7465 100644 --- a/drivers/dma/virt-dma.c +++ b/drivers/dma/virt-dma.c @@ -138,6 +138,7 @@ void vchan_init(struct virt_dma_chan *vc, struct dma_device *dmadev) INIT_LIST_HEAD(&vc->desc_submitted); INIT_LIST_HEAD(&vc->desc_issued); INIT_LIST_HEAD(&vc->desc_completed); + INIT_LIST_HEAD(&vc->desc_terminated); tasklet_init(&vc->task, vchan_complete, (unsigned long)vc); -- cgit v1.2.3