Received: by 10.192.165.156 with SMTP id m28csp347031imm; Tue, 17 Apr 2018 11:07:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx48UZztCIIW4esCMMACFD1HSqM2h4zSgXB0fD8gNQtSZO8ikIuMPDf/2yvDmCg3DjzAV2eC9 X-Received: by 10.99.97.8 with SMTP id v8mr2568134pgb.245.1523988435897; Tue, 17 Apr 2018 11:07:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523988435; cv=none; d=google.com; s=arc-20160816; b=Up7voufB9eRpUU5egHiPaPPcki684kgl3zLGz9KxSSQo2oVxYXUvNrzwUEy/zR8q8g adX4vejxTdd6EpZk2I3QbY83rNIzdbIyJbRP8ac/iI2t5WgYkZXfTfMN90BRl9I3jwRL 06zpsn/vnL5wbehHgpXbVIPyj6XH3P8xHGt2aa0JMLgLGLeMu+Pu8Qd3Ht1jmsbHWI1c 2GhlHzrwM+qQC0ER1isnNwilAfZGICsWkKy+P6TwacZxbdWqUsmV75yTfiNlWZIfTXZN SBTuXufj5s5dQS1nDrtu+fgOE3A/22WJhUAmCT8zindacK9ANxhhojPgRpUMR2OuergF JCfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=III0qzKK6w9HKnsUt/+xjxogzrzeeRM9M9WDs6lGkOY=; b=m+772fGlFdXkjgsKLi7Q5dkhY8hgEB3uWGT1LRW6HHsTc9d6GV89FMLC4ij5NqbV4A 1NLQdVzysZxA5TSE1HvmQaEl41CLvhF8CvyGR8h5RY3IKRbJF4zEfY4YO3K5CuGVHKMY WjMMawXUQ6k6N0WbaIunofPqE1sVRpBvqAXK7QGJPJ+Jk+FNQ8zxexYhVqbG/Fpwf9Ml k7d187pGRzHMOUsixYNSrltpfNi4uw4+o/OBD+fEej/z5HgR9qA4FRRoBqqTFf7xrveP p1MbHFmjqFM0ch4OweQFRd1HpAX0VN3LE4X9w0ZFBHvcTkqFkWA3GZBeHMxCzM3lWGpU apTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f28-v6si3158577plj.255.2018.04.17.11.07.01; Tue, 17 Apr 2018 11:07:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752617AbeDQSFv (ORCPT + 99 others); Tue, 17 Apr 2018 14:05:51 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:46554 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751884AbeDQSFv (ORCPT ); Tue, 17 Apr 2018 14:05:51 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BFA4C1435; Tue, 17 Apr 2018 11:05:50 -0700 (PDT) Received: from [10.1.210.88] (e110467-lin.cambridge.arm.com [10.1.210.88]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D22063F587; Tue, 17 Apr 2018 11:05:49 -0700 (PDT) Subject: Re: [PATCH v3 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU To: "Hook, Gary" , "Mehta, Sohil" , "gary.hook@amd.com" Cc: "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" References: <152302042701.47565.17954813724758433858.stgit@sosxen2.amd.com> <152302067362.47565.628887796165116844.stgit@sosxen2.amd.com> <1523926423.2747.19.camel@intel.com> <823c10d2-e9ab-0f17-22c7-c2eea312bef8@amd.com> From: Robin Murphy Message-ID: <7d0e1612-40ce-3091-733f-b553b6c325fe@arm.com> Date: Tue, 17 Apr 2018 19:05:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <823c10d2-e9ab-0f17-22c7-c2eea312bef8@amd.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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