From: "Hook, Gary" <ghook@amd.com>
To: "Mehta, Sohil" <sohil.mehta@intel.com>,
"gary.hook@amd.com" <gary.hook@amd.com>,
"iommu@lists.linux-foundation.org"
<iommu@lists.linux-foundation.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU
Date: Tue, 17 Apr 2018 13:38:04 -0400 [thread overview]
Message-ID: <efa2b7a3-04a7-20b1-3651-89ebafa85c27@amd.com> (raw)
In-Reply-To: <1523664612.2747.13.camel@intel.com>
On 4/13/2018 8:08 PM, Mehta, Sohil wrote:
> On Fri, 2018-04-06 at 08:17 -0500, Gary R Hook wrote:
>>
>> +
>> +void amd_iommu_debugfs_setup(struct amd_iommu *iommu)
>> +{
>> + char name[MAX_NAME_LEN + 1];
>> + struct dentry *d_top;
>> +
>> + if (!debugfs_initialized())
>
> Probably not needed.
Right.
>
>> + return;
>> +
>> + mutex_lock(&amd_iommu_debugfs_lock);
>> + if (!amd_iommu_debugfs) {
>> + d_top = iommu_debugfs_setup();
>> + if (d_top)
>> + amd_iommu_debugfs =
>> debugfs_create_dir("amd", d_top);
>> + }
>> + mutex_unlock(&amd_iommu_debugfs_lock);
>
>
> You can do the above only once if you iterate over the IOMMUs here
> instead of doing it in amd_iommu_init.
I'm not sure it matters, given the finite number of IOMMUs in a system,
and the fact that this work is done exactly once. However, removal of a
lock is fine thing, so I'll move this around.
>
>> + if (amd_iommu_debugfs) {
>> + snprintf(name, MAX_NAME_LEN, "iommu%02d", iommu-
>>> index);
>> + iommu->debugfs = debugfs_create_dir(name,
>> + amd_iommu_debugf
>> s);
>> + if (!iommu->debugfs) {
>> + debugfs_remove_recursive(amd_iommu_debugfs);
>> + amd_iommu_debugfs = NULL;
>> + }
>> + }
>> +}
>
> -Sohil
>
next prev parent reply other threads:[~2018-04-17 17:38 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-06 13:17 [PATCH v3 0/2] Base enablement of IOMMU debugfs support Gary R Hook
2018-04-06 13:17 ` [PATCH v3 1/2] iommu - Enable debugfs exposure of the IOMMU Gary R Hook
2018-04-13 23:55 ` Mehta, Sohil
2018-04-17 17:36 ` Hook, Gary
2018-04-17 17:55 ` Robin Murphy
2018-04-17 18:06 ` Hook, Gary
2018-04-17 17:46 ` Hook, Gary
2018-04-17 18:13 ` Robin Murphy
2018-04-06 13:17 ` [PATCH v3 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU Gary R Hook
2018-04-14 0:08 ` Mehta, Sohil
2018-04-17 17:38 ` Hook, Gary [this message]
2018-04-18 5:58 ` Yang, Shunyong
2018-04-18 7:27 ` Mehta, Sohil
2018-04-18 8:31 ` Yang, Shunyong
2018-04-18 20:16 ` Mehta, Sohil
2018-04-18 20:51 ` Hook, Gary
2018-04-19 1:52 ` Yang, Shunyong
2018-04-30 19:57 ` Gary R Hook
2018-04-17 0:52 ` Mehta, Sohil
2018-04-17 17:42 ` Hook, Gary
2018-04-17 18:05 ` Robin Murphy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=efa2b7a3-04a7-20b1-3651-89ebafa85c27@amd.com \
--to=ghook@amd.com \
--cc=gary.hook@amd.com \
--cc=iommu@lists.linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sohil.mehta@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®