Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1494268ybl; Thu, 30 Jan 2020 00:33:02 -0800 (PST) X-Google-Smtp-Source: APXvYqztM1/bpekILdLMBMEgDLRzrWN8uCZJtYWGvT7qrqXZ5t6fuYXKnDKdFcSNWPvdhIz4gqEE X-Received: by 2002:aca:8d5:: with SMTP id 204mr2041470oii.141.1580373182691; Thu, 30 Jan 2020 00:33:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580373182; cv=none; d=google.com; s=arc-20160816; b=cKqVCUpfhyI9KoEpDtKYmfpqndub0dR2oE02yrJwmybkQWOaO9UcTjGU+pTy2DySwe adaZbIrbHBuuiVI8MxvEuO/riSzcpIgFflLVOJic2eXQ9RcVg0QABBVn6XzcA9gmEDrd 6bbuHn8D4y0Ydo+oOW5nqV9OQXDWtxn8fEFL49tMX5TYo09GzrRz47pmBnE7ZlEMzJKC yTsd4dj8IEAXxifaOAW1C56VWGIHi+D1h21g0Jxkl5zeg0+Rr4JdoLleES90t4BTPdCb JklzL3T9kukp61tupsr7XRqW9rxY0F6VMEUYFMOWM1qDcZTVwuqFkuP3Euim88ULn7JU mmBQ== 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=l27GRZDYspPJzhpLwdOEp7BxqAEeeuHVjXg8dVgGy34=; b=kBNuA3tnUvVCokmCgOCJsTgzWupoXz5Uwq01Cp/qo5UEBZdp92PM9HV8rDeXiHRYrk ANERem1j8snxlN2OHPEEC2Je4JnxhoVX4gDZJvZe8kbasgrUpOREemevY+i6nEI2Q6Nz ueyhXd60+lv1D+uvWb7JSDNI7KMGCdc/6lhuNzCSRQhaRNJmdPvGnrWwN0TckcRtaiIs 21FSS/OMn1NcPPm4AKCpIwB779TJoVnqEm9sLmWd4OWq+tNWBqfAvLqGOCWcWN8Md9cs RfnhvWLqojKVVprWBU9t7lEPsf+OmWRQp3a7DwvtmMwbCzUkzup4wNBUejkDIONhAcP7 CNkw== 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 l5si2721486otn.35.2020.01.30.00.32.51; Thu, 30 Jan 2020 00:33:02 -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 S1727181AbgA3Iay convert rfc822-to-8bit (ORCPT + 99 others); Thu, 30 Jan 2020 03:30:54 -0500 Received: from mail-oi1-f194.google.com ([209.85.167.194]:40323 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727142AbgA3Iaw (ORCPT ); Thu, 30 Jan 2020 03:30:52 -0500 Received: by mail-oi1-f194.google.com with SMTP id a142so2696378oii.7; Thu, 30 Jan 2020 00:30:52 -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=HFTK0wLPJ+srAEMsmW9EKJT73bxP4s92jNe0BbzHj1g=; b=CR93tJ3WcpSPgIxergpCOlxP5AIPboPtJy4YA1T/L+bQZ7kd4Tl2KheszhxN2aN05K iUkRHFiq/QW0HOh/oOZEN5wSVIllPTQDUY6iZmxf5vM7YSZ7WszMKFTkpos30mBdlsib Q0BtuVATIFvr6NkUSurPUn5VPBTMmbs/jG9U0DQDmbmZ+qTyIYlB70HOYNLSwGpOVXtg FQ6hWlKM0Vi/FHjGkkUSAjOfgnxEbEYEXeRkhzyWHX3zDcGz7ojiqba9NnJqOMbjt8ST l21i73rsPYJXF10CIO+raLyR28FsX7fFRq1VXHqgLcNZHAlh4Vac+9TGapzX2KfjUL6d 6J+A== X-Gm-Message-State: APjAAAXacx5q0kYcrNP3nSV94HtGtUpVry4gL/XSxc+DZYmSKZW7soUZ bZlcF4Hr44MKojv5KKHPC12LfYGjMpPaGEiqa84= X-Received: by 2002:aca:5905:: with SMTP id n5mr2177710oib.54.1580373051929; Thu, 30 Jan 2020 00:30:51 -0800 (PST) MIME-Version: 1.0 References: <20200117153056.31363-1-geert+renesas@glider.be> In-Reply-To: From: Geert Uytterhoeven Date: Thu, 30 Jan 2020 09:30:38 +0100 Message-ID: Subject: Re: [PATCH v2] dmaengine: Create symlinks between DMA channels and slaves To: Marek Szyprowski 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 Marek, On Wed, Jan 29, 2020 at 6:47 PM Marek Szyprowski wrote: > On 17.01.2020 16:30, 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, > > 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 > > Tested-by: Niklas Söderlund > > This patch breaks booting on almost all Exynos based boards: > > https://lore.kernel.org/linux-samsung-soc/20200129161113.GE3928@sirena.org.uk/T/#u Sorry for the breakage. > I've already sent a fix: > > https://lkml.org/lkml/2020/1/29/498 Thanks a lot! > BTW, this patch reminds me some of my earlier work: > > https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1329778.html > > I had similar need to keep a client's struct device pointer for every > requested channel, but it turned out to be much more complicated than > I've initially thought. I've abandoned that, due to lack of time, but > maybe some of that discussion and concerns are still valid (I hope that > links to earlier versions are still working)... Oh right, Runtime PM for DMA channels. As several DMA calls can be made from atomic context, probably the API should be split in a non-atomic and an atomic part, cfr. the difference between clk_prepare() and clk_enable(). Still, DMA slave drivers would need to be modified, to call the "prepare" to make use of this... 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