From: "Mehta, Sohil" <sohil.mehta-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: "shunyong.yang-PT9Dzx9SjPiXmMXjJBpWqg@public.gmane.org"
<shunyong.yang-PT9Dzx9SjPiXmMXjJBpWqg@public.gmane.org>,
"gary.hook-5C7GfCeVMHo@public.gmane.org"
<gary.hook-5C7GfCeVMHo@public.gmane.org>,
"iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org"
<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>,
"ghook-5C7GfCeVMHo@public.gmane.org"
<ghook-5C7GfCeVMHo@public.gmane.org>
Cc: "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v3 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU
Date: Wed, 18 Apr 2018 07:27:28 +0000 [thread overview]
Message-ID: <1524036520.2747.31.camel@intel.com> (raw)
In-Reply-To: <1524031122.4031.5.camel-PT9Dzx9SjPiXmMXjJBpWqg@public.gmane.org>
On Wed, 2018-04-18 at 05:58 +0000, Yang, Shunyong wrote:
> Hi, Gary and Sohil,
>
> On Tue, 2018-04-17 at 13:38 -0400, Hook, Gary wrote:
> > 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.
>
> When will this check is needed?
> IMO, this function is to check debugfs ready status before we want to
> use debugfs. I just want to understand when we should use
> debugfs_initialized();
>
You are right debugfs_initialized() can be used to check if debugfs is
ready. However in this case we can also rely on debugfs_create_dir()
which is called in iommu_debufs_setup().
debugfs_create_dir() says:
* If debugfs is not enabled in the kernel, the value -%ENODEV will be
* returned.
Sohil
> Thanks.
> Shunyong.
>
> >
> > >
> > >
> > > >
> > > > + 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);
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
WARNING: multiple messages have this Message-ID (diff)
From: "Mehta, Sohil" <sohil.mehta@intel.com>
To: "shunyong.yang@hxt-semitech.com" <shunyong.yang@hxt-semitech.com>,
"gary.hook@amd.com" <gary.hook@amd.com>,
"iommu@lists.linux-foundation.org"
<iommu@lists.linux-foundation.org>,
"ghook@amd.com" <ghook@amd.com>
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: Wed, 18 Apr 2018 07:27:28 +0000 [thread overview]
Message-ID: <1524036520.2747.31.camel@intel.com> (raw)
In-Reply-To: <1524031122.4031.5.camel@hxt-semitech.com>
On Wed, 2018-04-18 at 05:58 +0000, Yang, Shunyong wrote:
> Hi, Gary and Sohil,
>
> On Tue, 2018-04-17 at 13:38 -0400, Hook, Gary wrote:
> > 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.
>
> When will this check is needed?
> IMO, this function is to check debugfs ready status before we want to
> use debugfs. I just want to understand when we should use
> debugfs_initialized();
>
You are right debugfs_initialized() can be used to check if debugfs is
ready. However in this case we can also rely on debugfs_create_dir()
which is called in iommu_debufs_setup().
debugfs_create_dir() says:
* If debugfs is not enabled in the kernel, the value -%ENODEV will be
* returned.
Sohil
> Thanks.
> Shunyong.
>
> >
> > >
> > >
> > > >
> > > > + 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);
next prev parent reply other threads:[~2018-04-18 7:27 UTC|newest]
Thread overview: 36+ 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 ` Gary R Hook
[not found] ` <152302042701.47565.17954813724758433858.stgit-tq90VzyE+wXkLsZ8J5Uweg@public.gmane.org>
2018-04-06 13:17 ` [PATCH v3 1/2] iommu - Enable debugfs exposure of the IOMMU Gary R Hook
2018-04-06 13:17 ` Gary R Hook
[not found] ` <152302066417.47565.4017200105445420643.stgit-tq90VzyE+wXkLsZ8J5Uweg@public.gmane.org>
2018-04-13 23:55 ` Mehta, Sohil
2018-04-13 23:55 ` Mehta, Sohil
[not found] ` <1523663790.2747.4.camel-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2018-04-17 17:36 ` Hook, Gary
2018-04-17 17:36 ` Hook, Gary
[not found] ` <10e422dd-a3ca-8ecb-50fa-e7f131a55a12-5C7GfCeVMHo@public.gmane.org>
2018-04-17 17:55 ` Robin Murphy
2018-04-17 17:55 ` Robin Murphy
2018-04-17 18:06 ` Hook, Gary
2018-04-17 17:46 ` Hook, Gary
2018-04-17 17:46 ` Hook, Gary
[not found] ` <9123cd44-e01f-bff6-8441-792acbde10bc-5C7GfCeVMHo@public.gmane.org>
2018-04-17 18:13 ` Robin Murphy
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-06 13:17 ` Gary R Hook
[not found] ` <152302067362.47565.628887796165116844.stgit-tq90VzyE+wXkLsZ8J5Uweg@public.gmane.org>
2018-04-14 0:08 ` Mehta, Sohil
2018-04-14 0:08 ` Mehta, Sohil
2018-04-17 17:38 ` Hook, Gary
[not found] ` <efa2b7a3-04a7-20b1-3651-89ebafa85c27-5C7GfCeVMHo@public.gmane.org>
2018-04-18 5:58 ` Yang, Shunyong
2018-04-18 5:58 ` Yang, Shunyong
[not found] ` <1524031122.4031.5.camel-PT9Dzx9SjPiXmMXjJBpWqg@public.gmane.org>
2018-04-18 7:27 ` Mehta, Sohil [this message]
2018-04-18 7:27 ` Mehta, Sohil
2018-04-18 8:31 ` Yang, Shunyong
2018-04-18 20:16 ` Mehta, Sohil
[not found] ` <1524082659.2747.37.camel-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2018-04-18 20:51 ` Hook, Gary
2018-04-18 20:51 ` Hook, Gary
2018-04-19 1:52 ` Yang, Shunyong
2018-04-30 19:57 ` Gary R Hook
2018-04-30 19:57 ` Gary R Hook
2018-04-17 0:52 ` Mehta, Sohil
2018-04-17 0:52 ` Mehta, Sohil
[not found] ` <1523926423.2747.19.camel-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2018-04-17 17:42 ` Hook, Gary
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=1524036520.2747.31.camel@intel.com \
--to=sohil.mehta-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=gary.hook-5C7GfCeVMHo@public.gmane.org \
--cc=ghook-5C7GfCeVMHo@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=shunyong.yang-PT9Dzx9SjPiXmMXjJBpWqg@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.