Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4738625imm; Fri, 18 May 2018 09:50:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq0qir/IarxepVyUg6oma5vhmQG40hcnLVTUNaSgf2dGRS/hicqFWxSXrXjlZmLNBCtYjmA X-Received: by 2002:a17:902:52ed:: with SMTP id a100-v6mr10303539pli.131.1526662234424; Fri, 18 May 2018 09:50:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526662234; cv=none; d=google.com; s=arc-20160816; b=LlMFZEqvsRi/cIYwR1lzUS9uwgYpwPRB6Tf+cdZcv4Qhpfx34/SUp3Fg9zWf1+mozz Ok81ztuPujrUTmMNFKxczSWYGppeJnelmX4R8N6ohuAl3WKmzg0YWn9kyI8RmuZyV3u2 Q3y29VuUCGWf7HJcEqbhGxFTY8tlj9DYQD8EEejiWBydX79LK16c3zs4dRp2MUA2EQlS GaBmsRLx/wztsNeTqqcbuAOG2vVPekphH2GalkeHF3N9b1SEo6cZ4zj/l16UZ8UBUvfi y2r1aq2VSZzYSDzNrkDMchuL43fjKw4C5ge+RiF92m7M0jLJYkqE5KTnIqOEoH9cfRBG TXLg== 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:dkim-signature :arc-authentication-results; bh=QU9BOeMP59CIQvZ+8eKupnzSo/98Q7W9D7dZByEzn8s=; b=Kibrl84FBBe/HBZL/e8QL0dYGBj2zuM+9EwE5UWRHPeRBc5LI9wzA254VolmFF3Hur wPyW4EbKDZEZnzdjm74orH5vDg7RDQQJEGdj3TtWw8XucceurRPbiyRARLJIX5y1kV/B M0KpzCHRCPWCg2LUDUyfD0uZA4GZgkJy3VTXkESCP4DUYsRSCokTBaDvYeC5aIxhNQe2 TsjN7rkqLItR7ZCM9/fJvwPV5gpXtyBeI+r0Fc2RbsAVkCQ9c5U+x2dFCCFgDF1Y6FuY txYDHeutGB23hHUhzV6smCrht2aIk1NI/aXU9hefFaPuC3SNuMzvFGLuzaSnryfDEKtI GoPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@infradead.org header.s=bombadil.20170209 header.b=hNz04B4x; 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 p1-v6si7824386pls.4.2018.05.18.09.50.18; Fri, 18 May 2018 09:50:34 -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; dkim=neutral (body hash did not verify) header.i=@infradead.org header.s=bombadil.20170209 header.b=hNz04B4x; 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 S1752428AbeERQtp (ORCPT + 99 others); Fri, 18 May 2018 12:49:45 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:49946 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751395AbeERQtQ (ORCPT ); Fri, 18 May 2018 12:49:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=IeQ8ulhOfcgFY9v5jgFysnDNxOZhzEO+HbGtC7RV21I=; b=hNz04B4x4dwgSooQhXwScS1Gs mGhNL8tGFjibjNxwAfZ9g6KVt8VrGzHro6QafNXZUeuk9zXgXw3UefJvUdSBlx/QIKObDp4dWDSbv v2hYY/gySkew1/yftg/buYbWwxXaXB9YjjjiRPM98lLK6OdFeMJPpnSCmfqIsm844CwvvuY2w8+81 JeCxC+8jYuxlDQcRGptqecZGvmF0tLtyH1Cwu99Rq7uiwECR9RG7sqsJ8ctEUxuh3Bv73hN5RFE4O gkOCwPdJr9zsV299iBGhJs4ua4kSs7Nz838neo0xkqqshjAJOgnjhXDHCn4JDI5zv2bMEfI/tDSO0 7vf2Gc8Og==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJiZ8-0006Yy-SS; Fri, 18 May 2018 16:49:14 +0000 Subject: Re: [PATCH v7 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU To: Gary R Hook , Joerg Roedel Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org References: <152631818082.18929.13970142119193316487.stgit@sosxen2.amd.com> <152631842907.18929.8819955271544326298.stgit@sosxen2.amd.com> <5e45f38e-cb45-d4a1-f351-30543f787290@amd.com> <20180515134603.GD18595@8bytes.org> <4041cb33-19a2-5542-4211-1dce51de5e40@amd.com> From: Randy Dunlap Message-ID: <89a0e3af-8970-cd80-418d-630841795807@infradead.org> Date: Fri, 18 May 2018 09:49:12 -0700 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: <4041cb33-19a2-5542-4211-1dce51de5e40@amd.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/18/2018 08:20 AM, Gary R Hook wrote: > On 05/15/2018 08:46 AM, Joerg Roedel wrote: >> On Mon, May 14, 2018 at 03:00:50PM -0500, Gary R Hook wrote: >>> This was brought up a few weeks ago in, I believe, version 3 of this patch. >>> That question was discussed (because that's what I did the first time out), >>> and _someone_ _else_ asked about why I didn't just do it the way I've done >>> it here. >> >> You don't have this problem if you put the code in amd_iommu.c in an >> IOMMU_DEBUGFS ifdef. > > Of course. My preference, however, is a separate file to avoid size creep. That's why I've done it this way. > > To whit: there have been threads discussing the advisability/acceptability of using #ifdefs for debug code. My take-away was to avoid them. Perhaps I misunderstood. > > So: I don't understand your comment. Is this an observation, or is it an imperative statement? I'd like for a maintainer to clearly indicate what is acceptable, and I'll do it. > > Hi, I looked back at Robin Murphy's comments on April 17: 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 ;) I think the Kconfig option would have been the correct choice. -- ~Randy