Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp514406ybf; Fri, 28 Feb 2020 02:26:58 -0800 (PST) X-Google-Smtp-Source: APXvYqxhiaxCyhRZx3CjwUEoAGkKu3St0RRgl2qHj55unqFONMVdMBx/k8OHbBqteb90AlhVLA2O X-Received: by 2002:a9d:7d87:: with SMTP id j7mr2561748otn.159.1582885618347; Fri, 28 Feb 2020 02:26:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582885618; cv=none; d=google.com; s=arc-20160816; b=iAh2mhWQHuKYJf7B5CNtCjbSL947Db3PQxPMy7dxtROZcIbTBam6Z8UMD3HOKExJp2 xxTqQikmvG/Owh5emOGLRv09uV43ybt8pua3cLvoTeyLLL9prYcntNsJj46tOn0iAQqS zVDGpNjR3rmmHHsesBXBynMSrEzaSbDpBNv6gRNAT0GTRsmWYWRioCu6TJxnFCPBZ8lB Cz3AKiR9pFBmghZHQwQt6VkihsSZPfmZG9JobX4Dvsp6yIX/MVxypVJiCCgdhjQ9/zKM qEpQ61u1KZnIwGgtmF++6nmckVUM/wuVJN6bQSuh8zB34wsyaffuCSQ8JgtC0uiT1gpC kLYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=lC7T12PqdFXQAg+u8tkuiGs9Fy9Rs3KhaT24jtMmyJs=; b=kton4XLogkJ6ay/PUwYKEyzpatFBfluEcqQ6LvakTzMMLR+ljJ7O5rNS0zSyVwS405 w5YUhV4rELLBwQeqC9xi1oaRC+yrRxitH5d4W8J+Fokm7aBtyk2zfvolTQ4XOqxv0AuK NDXcTZGBRBfngQa/NQTZJOzFQrOuqklqSTDDBBU7MexZyN9+um9G24suNe32CkA13cgM STSsW0aU+58job77BB2NOGkx7vxQpsNuvuHkk6SjaKEcvTCAxt+cBivpUFgNLwi1Xyrg X2XgFSmo8jwuQPKBAwSQrCJkNhHu4hjEN7NN85cyCdsvH22VcGQmCp2UYmunzQV2sM/U t6wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bJzvhfmy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m12si1493725oim.195.2020.02.28.02.26.46; Fri, 28 Feb 2020 02:26:58 -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; dkim=pass header.i=@kernel.org header.s=default header.b=bJzvhfmy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726860AbgB1K0h (ORCPT + 99 others); Fri, 28 Feb 2020 05:26:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:41352 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726440AbgB1K0g (ORCPT ); Fri, 28 Feb 2020 05:26:36 -0500 Received: from localhost (unknown [122.182.215.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4F7062469F; Fri, 28 Feb 2020 10:26:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582885596; bh=a6pS6AMZKTCJMUm/J9xeeK8dJhS9wNmw3vRFuEYcLyM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bJzvhfmyo02SFTzd/qHMaf+XN8630v2AC5zdK5Zinu/QCT5b1SKfRd8Ajn5MuuqD9 k4b9yHklC3WUsKK8LgmgO1rwFAD/EkF2s4anZabTvR9ApRZ7FGpu3Yra6WfVMlDToi iDcF43qj32b58ckdoY8InIJtoujNvvrBfu6UuJNk= Date: Fri, 28 Feb 2020 15:56:30 +0530 From: Vinod Koul To: Peter Ujfalusi Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, dan.j.williams@intel.com, geert@linux-m68k.org Subject: Re: [PATCH v3] dmaengine: Add basic debugfs support Message-ID: <20200228102630.GB4148@vkoul-mobl> References: <20200205111557.24125-1-peter.ujfalusi@ti.com> <20200224163707.GA2618@vkoul-mobl> <71231b0e-a9a2-4795-da71-b484f4992278@ti.com> <20200228044704.GC2618@vkoul-mobl> <970899d9-1491-78e8-1e7a-14e40915d061@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <970899d9-1491-78e8-1e7a-14e40915d061@ti.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28-02-20, 12:01, Peter Ujfalusi wrote: > Hi Vinod, > > On 28/02/2020 6.47, Vinod Koul wrote: > > Hi Peter, > > > > On 26-02-20, 14:10, Peter Ujfalusi wrote: > > > >>> do we really want a custom dbg_show()..? Drivers can add their own > >>> files... > >> > >> They could do that already ;) > >> > >> With the custom dbg_show() DMA drivers can save on the surrounding > >> code and just fill in the information regarding to their HW. > >> Again, on am654 the default information is: > >> # cat /sys/kernel/debug/dmaengine > >> dma0 (285c0000.dma-controller): number of channels: 96 > >> > >> dma1 (31150000.dma-controller): number of channels: 267 > >> dma1chan0 | 2b00000.mcasp:tx > >> dma1chan1 | 2b00000.mcasp:rx > >> dma1chan2 | in-use > >> dma1chan3 | in-use > >> dma1chan4 | in-use > >> dma1chan5 | in-use > >> > >> With my current .dbg_show implementation for k3-udma: > >> # cat /sys/kernel/debug/dmaengine > >> dma0 (285c0000.dma-controller): number of channels: 96 > >> > >> dma1 (31150000.dma-controller): number of channels: 267 > >> dma1chan0 | 2b00000.mcasp:tx (MEM_TO_DEV, tchan8 [0x1008 -> 0xc400], PDMA, TR mode) > >> dma1chan1 | 2b00000.mcasp:rx (DEV_TO_MEM, rchan8 [0x4400 -> 0x9008], PDMA, TR mode) > >> dma1chan2 | in-use (MEM_TO_MEM, chan2 pair [0x1002 -> 0x9002], PSI-L Native, TR mode) > >> dma1chan3 | in-use (MEM_TO_MEM, chan3 pair [0x1003 -> 0x9003], PSI-L Native, TR mode) > >> dma1chan4 | in-use (MEM_TO_MEM, chan4 pair [0x1004 -> 0x9004], PSI-L Native, TR mode) > >> dma1chan5 | in-use (MEM_TO_MEM, chan5 pair [0x1005 -> 0x9005], PSI-L Native, TR mode) > >> > >> For me this makes a huge difference. > > > > Ok > > > >>>> +DEFINE_SHOW_ATTRIBUTE(dmaengine_debugfs); > >>>> + > >>>> +static int __init dmaengine_debugfs_init(void) > >>>> +{ > >>>> + /* /sys/kernel/debug/dmaengine */ > >>>> + debugfs_create_file("dmaengine", 0444, NULL, NULL, > >>>> + &dmaengine_debugfs_fops); > >>> > >>> Should we add a directory? That way we can keep adding stuff into that > >>> one > >> > >> and have this file as 'summary' underneath? > > > > Correct > > /sys/kernel/debug/dmaengine/summary, right? Yup! > > >> I like the fact hat I can get all the information via one file. > >> Saves a lot of time (and explaining to users) on finding the correct > >> one to cat... > > > > But am sure we can come with more data to show, so having a directory > > helps :) > > OK, so we need to store the dbgfs rootdir and add an API so DMA drivers > can get the dentry of it, so they can implement their custom > files/directories underneath. Correct -- ~Vinod