[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7d0e1612-40ce-3091-733f-b553b6c325fe@arm.com>
Date: Tue, 17 Apr 2018 19:05:48 +0100
From: Robin Murphy <robin.murphy@....com>
To: "Hook, Gary" <ghook@....com>,
"Mehta, Sohil" <sohil.mehta@...el.com>,
"gary.hook@....com" <gary.hook@....com>
Cc: "iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 2/2] iommu/amd: Add basic debugfs infrastructure for
AMD IOMMU
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@...ts.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/iommu
Powered by blists - more mailing lists