Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5075003pxj; Wed, 9 Jun 2021 08:35:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJws2uz8JsdjVcMclAb4Hab6/+NGMGloGzwldPvSoQ6GECP7U//70P0PM56LGFN89HAryxuE X-Received: by 2002:a17:906:1d11:: with SMTP id n17mr447608ejh.215.1623252926900; Wed, 09 Jun 2021 08:35:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623252926; cv=none; d=google.com; s=arc-20160816; b=LRnnhqaL4bevH6EheZkNJpHSp7EQHm5vz7gELIoZ9QJM//bAHANRsqnE7yVWB5Xp0d 7Z6M8oP8BnN6fGcVdq2Eb7JthgATUl3pxgp0947vAcPmoFhRXl4eWv136uMGLmqEBA9l AJGtf4LVIBPbCgPdKW9VHF2PeMm7uDr43zYajGfi0q5JEGxgl7eI/GLubwQ+x75NkRBn TH6HGozFmcFTbeaepHv75ez4Nvxu2EzhJxnhOB/X3lBl6pJWk+QuZvMYOlmpQcFSmZdO oIix+TCxT63tbChHE9MuQ6oF16aGNrPSLYrFSHkdPCgN6AE5Ed7R0R7FtXsterMa3s3w xANw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7zZ596eJSScSZGiwx5CE3Tnj+dIzWzdB/XgvFzXnquM=; b=APB8o3D/eoNxpMtJzPSP14xGu6ETug0ZaFPokkp2DU9I578GVgZb8g5inzsofSM+29 ZBXffaBf+5Lp0bdCB4J1PfUKCwt5nM3VfQEZHZCOk+BsIIpk06TU4jOd/yTV6M2vDxec BoB44X/Z1R6C45rcwWT0TmM/7ayte75JGHdXS7RpyzKy6Xx8hU1u44KhMEIbPxD3podr N9+VxoUXK0ysM3KvfPi5kS5JC2V+58ZmVCh3tSq3mmGV7CPxtGUl+74xavYPTp2EEuNk eaioMznSd3GIs3w7VRIUXLB8pBwBR1KtRbwa3uRAeJtVS01/8r7x67XBfwdkHOFdJgSm 9VDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=X8cuFTUd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id mb15si130780ejb.279.2021.06.09.08.35.02; Wed, 09 Jun 2021 08:35:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=X8cuFTUd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S233114AbhFIOMG (ORCPT + 99 others); Wed, 9 Jun 2021 10:12:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:38216 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232474AbhFIOMF (ORCPT ); Wed, 9 Jun 2021 10:12:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A37D261285; Wed, 9 Jun 2021 14:10:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623247810; bh=XVSIs8gLCt9INCVjowedsNE35bHNbRG2HRz7YC4IGEA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=X8cuFTUdMUT+9okGGDOIiJCiOdAc0FC8MUql48zi2Vdl7aeyAYG1bLOni2EhLTTzR 0uEXQS6LGkOINcBB8l9n0dI6BZmuflz38/XmUvjbVTS22G2s++0XD+rQuegn/ul5eV guyjQCGc7wY+U4V6nqMEysAdOwM+XM5biJdRNPB/QPcenqaM9y3STSK261rgGQJ7Cy h1nu1nwmiKwWwq1uxlbyIX5t7nYH+hx6ZY2SKIE8ukjC7aFfdk25oeVGX0I134wBYX xiPIMw7TKbq20Nnl8/Z4/DdwYC01EZ4PasoKqhG1au5oUEqueHVMixaDYI8Leo4m5D MIWg5e6UvVfvg== Date: Wed, 9 Jun 2021 19:40:06 +0530 From: Vinod Koul To: Sanjay R Mehta Cc: gregkh@linuxfoundation.org, dan.j.williams@intel.com, Thomas.Lendacky@amd.com, Shyam-sundar.S-k@amd.com, Nehal-bakulchandra.Shah@amd.com, robh@kernel.org, mchehab+samsung@kernel.org, davem@davemloft.net, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org Subject: Re: [PATCH v9 3/3] dmaengine: ptdma: Add debugfs entries for PTDMA Message-ID: References: <1622654551-9204-1-git-send-email-Sanju.Mehta@amd.com> <1622654551-9204-4-git-send-email-Sanju.Mehta@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1622654551-9204-4-git-send-email-Sanju.Mehta@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02-06-21, 12:22, Sanjay R Mehta wrote: > +/* DebugFS helpers */ > +#define MAX_NAME_LEN 20 > +#define RI_VERSION_NUM 0x0000003F > + > +#define RI_NUM_VQM 0x00078000 > +#define RI_NVQM_SHIFT 15 > + > +static DEFINE_MUTEX(pt_debugfs_lock); unused? > + > +static int pt_debugfs_info_show(struct seq_file *s, void *p) > +{ > + struct pt_device *pt = s->private; > + unsigned int regval; > + > + if (!pt) > + return 0; better return an error code? > + > + seq_printf(s, "Device name: %s\n", pt->name); > + seq_printf(s, " # Queues: %d\n", 1); > + seq_printf(s, " # Cmds: %d\n", pt->cmd_count); > + > + regval = ioread32(pt->io_regs + CMD_PT_VERSION); how do you ensure your device is not sleeping or you can access iomem safely? > +void ptdma_debugfs_setup(struct pt_device *pt) > +{ > + struct pt_cmd_queue *cmd_q; > + char name[MAX_NAME_LEN + 1]; > + struct dentry *debugfs_q_instance; > + > + if (!debugfs_initialized()) > + return; > + > + debugfs_create_file("info", 0400, pt->dma_dev.dbg_dev_root, pt, > + &pt_debugfs_info_fops); > + > + debugfs_create_file("stats", 0600, pt->dma_dev.dbg_dev_root, pt, why 600 here? -- ~Vinod