LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: "Hook, Gary" <ghook@amd.com>,
	"Mehta, Sohil" <sohil.mehta@intel.com>,
	"gary.hook@amd.com" <gary.hook@amd.com>
Cc: "iommu@lists.linux-foundation.org"
	<iommu@lists.linux-foundation.org>,
	"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 19:05:48 +0100	[thread overview]
Message-ID: <7d0e1612-40ce-3091-733f-b553b6c325fe@arm.com> (raw)
In-Reply-To: <823c10d2-e9ab-0f17-22c7-c2eea312bef8@amd.com>

On 17/04/18 18:42, Hook, Gary wrote:
> On 4/16/2018 8:52 PM, Mehta, Sohil wrote:
>> On Fri, 2018-04-06 at 08:17 -0500, Gary R Hook wrote:
>>>
>>> diff --git a/drivers/iommu/Makefile b/drivers/iommu/Makefile
>>> index 5eb1121d54b9..0ca250f626d9 100644
>>> --- a/drivers/iommu/Makefile
>>> +++ b/drivers/iommu/Makefile
>>> @@ -11,6 +11,7 @@ obj-$(CONFIG_IOMMU_IOVA) += iova.o
>>>   obj-$(CONFIG_OF_IOMMU) += of_iommu.o
>>>   obj-$(CONFIG_MSM_IOMMU) += msm_iommu.o
>>>   obj-$(CONFIG_AMD_IOMMU) += amd_iommu.o amd_iommu_init.o
>>> +obj-$(CONFIG_IOMMU_DEBUG) += amd_iommu_debugfs.o
>>
>> Compiling amd_iommu_debugfs.c seems to depend only
>> on CONFIG_IOMMU_DEBUG. Can we prevent the code within
>> amd_iommu_debugfs.c from getting compiled when either CONFIG_AMD_IOMMU
>> or CONFIG_IOMMU_DEBUG is disabled?
> 
> That's a good point. My intention was that only one switch was required 
> to incorporate any DebugFS support, but I see now that I didn't consider 
> all of the cases.
> 
> It appears that a per-device switch is also necessary. Unless someone 
> has a better idea.

Well, you could do a makefile-level dependency i.e.:

ifeq ($(CONFIG_IOMMU_DEBUG), y)
obj-$(CONFIG_AMD_IOMMU) += amd_iommu_debugfs.o
obj-$(CONFIG_BLAH_IOMMU) += blah_iommu_debugfs.o
...
endif

Or alternatively have an intermediate silent Kconfig option:

config AMD_IOMMU_DEBUG
	def_bool y
	depends on AMD_IOMMU && IOMMU_DEBUG

The makefile option is arguably ugly, but does at least scale better ;)

Robin.

>>>   obj-$(CONFIG_AMD_IOMMU_V2) += amd_iommu_v2.o
>>>   obj-$(CONFIG_ARM_SMMU) += arm-smmu.o
>>>   obj-$(CONFIG_ARM_SMMU_V3) += arm-smmu-v3.o
> 
> _______________________________________________
> iommu mailing list
> iommu@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/iommu

      reply	other threads:[~2018-04-17 18:05 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
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 [this message]

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=7d0e1612-40ce-3091-733f-b553b6c325fe@arm.com \
    --to=robin.murphy@arm.com \
    --cc=gary.hook@amd.com \
    --cc=ghook@amd.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sohil.mehta@intel.com \
    --subject='Re: [PATCH v3 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).