dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/9] dmaengine: virt-dma related fixes
@ 2019-12-16 10:53 Sascha Hauer
  2019-12-16 10:53 ` [PATCH 1/9] dmaengine: bcm2835: do not call vchan_vdesc_fini() with lock held Sascha Hauer
                   ` (10 more replies)
  0 siblings, 11 replies; 13+ messages in thread
From: Sascha Hauer @ 2019-12-16 10:53 UTC (permalink / raw)
  To: dmaengine
  Cc: Vinod Koul, Peter Ujfalusi, Florian Fainelli, Maxime Ripard,
	Green Wan, Kukjin Kim, Krzysztof Kozlowski, Andreas Färber,
	Sean Wang, Eugeniy Paltsev, Pengutronix Kernel Team,
	NXP Linux Team, Robert Jarzmik, Sascha Hauer

Several drivers call vchan_dma_desc_free_list() or vchan_vdesc_fini() under
&vc->lock. This is not allowed and the first two patches fix this up. If you
are a DMA driver maintainer, the first two patches are the reason you are on
Cc.

The remaining patches are the original purpose of this series:
The i.MX SDMA driver leaks memory when a currently running descriptor is
aborted. Calling vchan_terminate_vdesc() on it to fix this revealed that
the virt-dma support calls the desc_free with the spin_lock held. This
doesn't work for the SDMA driver because it calls dma_free_coherent in
its desc_free hook. This series aims to fix that up.

Changes since v2:
- change drivers to not call vchan_dma_desc_free_list() under spin_lock
- remove debug message from vchan_dma_desc_free_list()

Changes since v1:
- rebase on v5.5-rc1
- Swap patches 1 and 2 for bisectablity
- Rename desc_aborted to desc_terminated
- Free up terminated descriptors immediately instead of letting them accumulate

Sascha Hauer (9):
  dmaengine: bcm2835: do not call vchan_vdesc_fini() with lock held
  dmaengine: virt-dma: Add missing locking
  dmaengine: virt-dma: remove debug message
  dmaengine: virt-dma: Do not call desc_free() under a spin_lock
  dmaengine: virt-dma: Add missing locking around list operations
  dmaengine: virt-dma: use vchan_vdesc_fini() to free descriptors
  dmaengine: imx-sdma: rename function
  dmaengine: imx-sdma: find desc first in sdma_tx_status
  dmaengine: imx-sdma: Fix memory leak

 drivers/dma/bcm2835-dma.c                     |  5 +--
 .../dma/dw-axi-dmac/dw-axi-dmac-platform.c    |  8 +---
 drivers/dma/imx-sdma.c                        | 37 +++++++++++--------
 drivers/dma/mediatek/mtk-uart-apdma.c         |  3 +-
 drivers/dma/owl-dma.c                         |  3 +-
 drivers/dma/s3c24xx-dma.c                     | 22 +++++------
 drivers/dma/sf-pdma/sf-pdma.c                 |  4 +-
 drivers/dma/sun4i-dma.c                       |  3 +-
 drivers/dma/virt-dma.c                        | 10 ++---
 drivers/dma/virt-dma.h                        | 27 ++++++++------
 10 files changed, 63 insertions(+), 59 deletions(-)

-- 
2.24.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-12-24  6:25 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-16 10:53 [PATCH v3 0/9] dmaengine: virt-dma related fixes Sascha Hauer
2019-12-16 10:53 ` [PATCH 1/9] dmaengine: bcm2835: do not call vchan_vdesc_fini() with lock held Sascha Hauer
2019-12-16 10:53 ` [PATCH 2/9] dmaengine: virt-dma: Add missing locking Sascha Hauer
2019-12-16 10:53 ` [PATCH 3/9] dmaengine: virt-dma: remove debug message Sascha Hauer
2019-12-16 10:53 ` [PATCH 4/9] dmaengine: virt-dma: Do not call desc_free() under a spin_lock Sascha Hauer
2019-12-16 10:53 ` [PATCH 5/9] dmaengine: virt-dma: Add missing locking around list operations Sascha Hauer
2019-12-16 10:53 ` [PATCH 6/9] dmaengine: virt-dma: use vchan_vdesc_fini() to free descriptors Sascha Hauer
2019-12-16 10:53 ` [PATCH 7/9] dmaengine: imx-sdma: rename function Sascha Hauer
2019-12-16 10:53 ` [PATCH 8/9] dmaengine: imx-sdma: find desc first in sdma_tx_status Sascha Hauer
2019-12-16 10:53 ` [PATCH 9/9] dmaengine: imx-sdma: Fix memory leak Sascha Hauer
2019-12-18 10:09   ` Robin Gong
2019-12-16 11:49 ` [PATCH v3 0/9] dmaengine: virt-dma related fixes Peter Ujfalusi
2019-12-24  6:25 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).