OSDN Git Service

dmaengine: virt-dma: Do not call desc_free() under a spin_lock
authorSascha Hauer <s.hauer@pengutronix.de>
Mon, 16 Dec 2019 10:53:23 +0000 (11:53 +0100)
committerVinod Koul <vkoul@kernel.org>
Thu, 26 Dec 2019 04:34:18 +0000 (10:04 +0530)
commitf882101122aa110ef8e64be04472e5a47030300e
tree0efa92d461b35e0146ff7436646cfd99662b83ff
parentdf660a2b6dfcf26001af6cd2441268c29416dd64
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 <s.hauer@pengutronix.de>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Link: https://lore.kernel.org/r/20191216105328.15198-5-s.hauer@pengutronix.de
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/virt-dma.c
drivers/dma/virt-dma.h