Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2348980ybl; Mon, 20 Jan 2020 01:03:18 -0800 (PST) X-Google-Smtp-Source: APXvYqyzz6YBskbfkHTUepO63/cYJ5VnUMZ/nP/EpuiMuW4eXdxwUYilxbtXBbOZC7QrKdrOCJPy X-Received: by 2002:aca:ec4f:: with SMTP id k76mr11750407oih.156.1579510998068; Mon, 20 Jan 2020 01:03:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579510998; cv=none; d=google.com; s=arc-20160816; b=ZVFi3Q2Z9pg6V22Lr+Y5ay3UbdSEv8PpbhNuu+7kXS1Zc/tMpWf/fn7jL8sUamOg2Y 9qBq80KmIeEGvbL9JUzCq4S8eIBrZRkqkuWFdx8/0O1k9lg28BgJyJUtbp4cYnvxG08u ruVJS92Ul76PQhI37tTN8uAfLL8xJ4FmyptEj60n3baBZYflVrF8DmyUj67srlWF4szg WUd3GIXbJVz41npksY62nYKjHHEzDgpA0fn857ZFmFCCk4jjOq/J8Dd0DGioAAro94Ha RDDxLfMsJiFyGxOm7zpRrHIJeF5r6HTCa7T/Az1HQT/uTi8eb+4rI2hoYC2DfJHb1/Ed ylfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=7VmnKDtAktsrMuZl+6bNLdvqIey9bssHU2uyk8a9XVc=; b=XrFx6CCwzrfFk78g0PqBzubGtirSytvYbrLmrH95M7QH+Qt4Gs5obmJpHcXCUTjHbK wvShpNQUz2ykkHmBerji1/aKiQCjdknSEaZY6Jl/wPRPkSIyufItBwmyNnt+V4+k0VTO taOnc/a00meQLzHQ18E9MgOf3bZ2Zp6NYkXfFOi0J6rHO7lgtCCZC0AD9izBks2Is7c+ d0d+OvDKMjmZn0kalNjHW2k19dRBbkFnACQYkm7Rfpj7l0l2sCGa9TaPqqVviLeII5gi kMWLytx5cc85zVOis370Bwj0ro1XdKhIDOShr6aBI7IA/hnJ4bb8oG4X3usW7y8CzTsq dnCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2si17606056oic.205.2020.01.20.01.03.05; Mon, 20 Jan 2020 01:03:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726626AbgATJCO convert rfc822-to-8bit (ORCPT + 99 others); Mon, 20 Jan 2020 04:02:14 -0500 Received: from mail-oi1-f195.google.com ([209.85.167.195]:39842 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725872AbgATJCN (ORCPT ); Mon, 20 Jan 2020 04:02:13 -0500 Received: by mail-oi1-f195.google.com with SMTP id z2so3892632oih.6; Mon, 20 Jan 2020 01:02:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=EDa/ZVNGvwyY4lRA+wxSdtjDm7nJG1InbdRTQhCgYUs=; b=IwkMv58ZRHL1ohFY2z4UYBfLxjCUADjseozTDn+Rif1z1QSesm6F463J4/maGZd1/x kFzGbBNJ3Qki2iNejZRJeUzhlkLICaUpVST7mKSj6LO2T8bAukwCfMIKtJBMyvOPy19t c8jUF2+TfZu83U0IUHY8H1Jp4S8nA5pDlfLvWvtpLrGB57zOFmPwCk0epapK0kq64ud3 gs452+HseZPll6uiZjV4iCUJWRj206QLUXvePUzsTdC66u0dXc4UU1YKnsHL+S1/HEmx uRnM/Bk/J3ePN7/qPxXanz4iJADwMsD/Y+tjUY3wGEaGrhJ4WOwIwFmNhuhwnN8jZYBt NXdA== X-Gm-Message-State: APjAAAVHKvvIabGkeEbIx82yZioMstHHhJaV3pZxtOUxpeiSOVNz2xQk kL1I3V8xm0XMDXGO/oC5BP3wKFazzpHe69boqRw= X-Received: by 2002:a05:6808:292:: with SMTP id z18mr11627160oic.131.1579510933130; Mon, 20 Jan 2020 01:02:13 -0800 (PST) MIME-Version: 1.0 References: <20200117153056.31363-1-geert+renesas@glider.be> In-Reply-To: From: Geert Uytterhoeven Date: Mon, 20 Jan 2020 10:01:51 +0100 Message-ID: Subject: Re: [PATCH v2] dmaengine: Create symlinks between DMA channels and slaves To: Peter Ujfalusi Cc: Geert Uytterhoeven , Vinod Koul , Dan Williams , dmaengine@vger.kernel.org, Linux-Renesas , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, On Fri, Jan 17, 2020 at 9:08 PM Peter Ujfalusi 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: > > 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 > > 2. A "dma:" 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 > > --- > > 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 -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds