[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <280220fd-9780-e2b4-7a5a-26f3a0119c43@amd.com>
Date: Tue, 26 May 2020 11:40:08 +0530
From: Sanjay R Mehta <sanmehta@....com>
To: Vinod Koul <vkoul@...nel.org>, Sanjay R Mehta <Sanju.Mehta@....com>
Cc: gregkh@...uxfoundation.org, dan.j.williams@...el.com,
Thomas.Lendacky@....com, Shyam-sundar.S-k@....com,
Nehal-bakulchandra.Shah@....com, robh@...nel.org,
mchehab+samsung@...nel.org, davem@...emloft.net,
linux-kernel@...r.kernel.org, dmaengine@...r.kernel.org
Subject: Re: [PATCH v4 3/3] dmaengine: ptdma: Add debugfs entries for PTDMA
information
>> +static const struct file_operations pt_debugfs_info_ops = {
>> + .owner = THIS_MODULE,
>> + .open = simple_open,
>> + .read = ptdma_debugfs_info_read,
>> + .write = NULL,
>> +};
>> +
>> +static const struct file_operations pt_debugfs_queue_ops = {
>> + .owner = THIS_MODULE,
>> + .open = simple_open,
>> + .read = ptdma_debugfs_queue_read,
>> + .write = ptdma_debugfs_queue_write,
>> +};
>> +
>> +static const struct file_operations pt_debugfs_stats_ops = {
>> + .owner = THIS_MODULE,
>> + .open = simple_open,
>> + .read = ptdma_debugfs_stats_read,
>> + .write = ptdma_debugfs_stats_write,
>> +};
>
> pls convert to use DEFINE_SHOW_ATTRIBUTE()
>
Sure, will incorporate the changes in next version of patch.
>> +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;
>> +
>> + mutex_lock(&pt_debugfs_lock);
>> + if (!pt_debugfs_dir)
>> + pt_debugfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL);
>> + mutex_unlock(&pt_debugfs_lock);
>> +
>> + pt->debugfs_instance = debugfs_create_dir(pt->name, pt_debugfs_dir);
>> +
>> + debugfs_create_file("info", 0400, pt->debugfs_instance, pt,
>> + &pt_debugfs_info_ops);
>> +
>> + debugfs_create_file("stats", 0600, pt->debugfs_instance, pt,
>> + &pt_debugfs_stats_ops);
>> +
>> + cmd_q = &pt->cmd_q;
>> +
>> + snprintf(name, MAX_NAME_LEN - 1, "q");
>> +
>> + debugfs_q_instance =
>> + debugfs_create_dir(name, pt->debugfs_instance);
>> +
>> + debugfs_create_file("stats", 0600, debugfs_q_instance, cmd_q,
>> + &pt_debugfs_queue_ops);
>
> Pls use dbg_dev_root in struct dma_device as root for your own debugfs
>
Sure, will incorporate the changes in next version of patch.
> Thanks
> --
> ~Vinod
>
Powered by blists - more mailing lists