linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
	Vinod Koul <vkoul@kernel.org>,
	Dan Williams <dan.j.williams@intel.com>,
	<dmaengine@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] dmaengine: Create symlinks between DMA channels and slaves
Date: Mon, 20 Jan 2020 12:16:33 +0200	[thread overview]
Message-ID: <1cdc4f71-f365-8c9e-4634-408c59e6a3f9@ti.com> (raw)
In-Reply-To: <CAMuHMdVzQCWvH-LJ9ME5dRyafudZBHQLaJQzkSCPnughv_q2aA@mail.gmail.com>



On 20/01/2020 11.01, Geert Uytterhoeven wrote:
> Hi Peter,
> 
> On Fri, Jan 17, 2020 at 9:08 PM Peter Ujfalusi <peter.ujfalusi@ti.com> wrote:
>> On 1/17/20 5:30 PM, Geert Uytterhoeven wrote:
>>> 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,
>>
>> Have you considered similar link name as on the slave device:
>> slave:<name>
>>
>> That way it would be easier to grasp which channel is used for what
>> purpose by only looking under /sys/class/dma/ and no need to check the
>> slave device.
> 
> Would this really provide more information?
> The device name is already provided in the target of the symlink:
> 
> root@koelsch:~# readlink
> /sys/devices/platform/soc/e6720000.dma-controller/dma/dma1chan2/slave
> ../../../ee140000.sd

e6720000.dma-controller/dma/dma1chan2/slave -> ../../../ee140000.sd
e6720000.dma-controller/dma/dma1chan3/slave -> ../../../ee140000.sd

It is hard to tell which one is the tx and RX channel without looking
under the ee140000.sd:

ee140000.sd/dma:rx -> ../e6720000.dma-controller/dma/dma1chan3
ee140000.sd/dma:tx -> ../e6720000.dma-controller/dma/dma1chan2

Another option would be to not have symlinks, but a debugfs file where
this information can be extracted and would only compiled if debugfs is
enabled.

>>>   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>
>>> ---
>>> v2:
>>>   - Add DMA_SLAVE_NAME macro,
>>>   - Also handle channels from FIXME,
>>>   - Add backlinks from slave device to DMA channel,
>>>
>>> On r8a7791/koelsch, the following new symlinks are created:
>>>
>>>     /sys/devices/platform/soc/
>>>     ├── e6700000.dma-controller/dma/dma0chan0/slave -> ../../../e6e20000.spi
>>>     ├── e6700000.dma-controller/dma/dma0chan1/slave -> ../../../e6e20000.spi
>>>     ├── e6700000.dma-controller/dma/dma0chan2/slave -> ../../../ee100000.sd
>>>     ├── e6700000.dma-controller/dma/dma0chan3/slave -> ../../../ee100000.sd
>>>     ├── e6700000.dma-controller/dma/dma0chan4/slave -> ../../../ee160000.sd
>>>     ├── e6700000.dma-controller/dma/dma0chan5/slave -> ../../../ee160000.sd
>>>     ├── e6700000.dma-controller/dma/dma0chan6/slave -> ../../../e6e68000.serial
>>>     ├── e6700000.dma-controller/dma/dma0chan7/slave -> ../../../e6e68000.serial
>>>     ├── e6720000.dma-controller/dma/dma1chan0/slave -> ../../../e6b10000.spi
>>>     ├── e6720000.dma-controller/dma/dma1chan1/slave -> ../../../e6b10000.spi
>>>     ├── e6720000.dma-controller/dma/dma1chan2/slave -> ../../../ee140000.sd
>>>     ├── e6720000.dma-controller/dma/dma1chan3/slave -> ../../../ee140000.sd
>>>     ├── e6b10000.spi/dma:rx -> ../e6720000.dma-controller/dma/dma1chan1
>>>     ├── e6b10000.spi/dma:tx -> ../e6720000.dma-controller/dma/dma1chan0
>>>     ├── e6e20000.spi/dma:rx -> ../e6700000.dma-controller/dma/dma0chan1
>>>     ├── e6e20000.spi/dma:tx -> ../e6700000.dma-controller/dma/dma0chan0
>>>     ├── e6e68000.serial/dma:rx -> ../e6700000.dma-controller/dma/dma0chan7
>>>     ├── e6e68000.serial/dma:tx -> ../e6700000.dma-controller/dma/dma0chan6
>>>     ├── ee100000.sd/dma:rx -> ../e6700000.dma-controller/dma/dma0chan3
>>>     ├── ee100000.sd/dma:tx -> ../e6700000.dma-controller/dma/dma0chan2
>>>     ├── ee140000.sd/dma:rx -> ../e6720000.dma-controller/dma/dma1chan3
>>>     ├── ee140000.sd/dma:tx -> ../e6720000.dma-controller/dma/dma1chan2
>>>     ├── ee160000.sd/dma:rx -> ../e6700000.dma-controller/dma/dma0chan5
>>>     └── ee160000.sd/dma:tx -> ../e6700000.dma-controller/dma/dma0chan4
> 
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

  reply	other threads:[~2020-01-20 10:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-17 15:30 [PATCH v2] dmaengine: Create symlinks between DMA channels and slaves Geert Uytterhoeven
2020-01-17 16:26 ` Niklas Söderlund
2020-01-17 20:10 ` Peter Ujfalusi
2020-01-20  9:01   ` Geert Uytterhoeven
2020-01-20 10:16     ` Peter Ujfalusi [this message]
2020-01-20 10:51       ` Geert Uytterhoeven
2020-01-20 12:06         ` Peter Ujfalusi
2020-01-21 20:22           ` Geert Uytterhoeven
2020-01-22  9:40             ` Vinod Koul
2020-01-24  6:13               ` Vinod Koul
2020-01-24  7:31                 ` Peter Ujfalusi
2020-01-27  5:08                   ` Vinod Koul
     [not found] ` <CGME20200129174723eucas1p1fe4f76325f463fc9e3645ce18740d2eb@eucas1p1.samsung.com>
2020-01-29 17:47   ` Marek Szyprowski
2020-01-30  8:30     ` Geert Uytterhoeven
2020-01-30 10:33       ` Marek Szyprowski
2020-01-30 10:47         ` Geert Uytterhoeven
2020-01-30  9:43 ` Peter Ujfalusi
2020-01-30  9:51   ` Geert Uytterhoeven
2020-01-30 10:22     ` Peter Ujfalusi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1cdc4f71-f365-8c9e-4634-408c59e6a3f9@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).