]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
dmaengine: Create symlinks between DMA channels and slaves
authorGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 17 Jan 2020 15:30:56 +0000 (16:30 +0100)
committerVinod Koul <vkoul@kernel.org>
Fri, 24 Jan 2020 06:11:32 +0000 (11:41 +0530)
commit71723a96b8b1367fefc18f60025dae792477d602
tree3b1f3f47cfa643fbbcac9d3c15fbac210f808382
parente9f08b65250d73ab70e79e194813f52b8d306784
dmaengine: Create symlinks between DMA channels and slaves

Currently it is not easy to find out which DMA channels are in use, and
which slave devices are using which channels.

Fix this by creating two symlinks between the DMA channel and the actual
slave device when a channel is requested:
  1. A "slave" symlink from DMA channel to slave device,
  2. A "dma:<name>" symlink slave device to DMA channel.
When the channel is released, the symlinks are removed again.
The latter requires keeping track of the slave device and the channel
name in the dma_chan structure.

Note that this is limited to channel request functions for requesting an
exclusive slave channel that take a device pointer (dma_request_chan()
and dma_request_slave_channel*()).

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Link: https://lore.kernel.org/r/20200117153056.31363-1-geert+renesas@glider.be
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/dmaengine.c
include/linux/dmaengine.h