Received: by 10.213.65.68 with SMTP id h4csp2216285imn; Thu, 29 Mar 2018 21:18:11 -0700 (PDT) X-Google-Smtp-Source: AIpwx48Xfw3nW6qewrvzmwz52TQkrivPbwt/cv5Y7VK2smUbVC+xfjCK32AeHQoRGsZMksFdCLj6 X-Received: by 2002:a17:902:8604:: with SMTP id f4-v6mr10715149plo.228.1522383491351; Thu, 29 Mar 2018 21:18:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522383491; cv=none; d=google.com; s=arc-20160816; b=dIasc77dd1yQePVCPDnMNzhOHwrKFXtw4eG/f+ZQCtNd3/6lI7IdjVI53P2enBtMn2 ugx8iYt6KcOxGregi0m+GWEaMsiRyQ1+Ygtr3CVWbEUO1/A6ww8aaNLPzoGSztpYGVxj AxRgrHuQcLZGJjd/bl8o8+Bbgq+TzC4HKg2TRSdZ9O5oT/UTCeeeEpowazwJNX+k+m5k frVt08JaZ+4rir+bokxly3wYddDQ5kNBg3NSazsq+eainiQt/kEQ1/zpC9qYZS0EKmXR 0MKIlO1MfVN5WeGH6CVG6PXkQzGDV/CyNhV/sLHCJ7VDaQlHduU1Hij5HtTwLgRx6U7z Sf4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:autocrypt :openpgp:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=DxiIzP2HTSP7+om6hx6xDyJDe67MLHvW9QnwPBASMmg=; b=r91cfvTavLGDjiTPrn2tLh7oYUVn4lfpCPYr9Jvn4rPoPL+vW2wzdAy3aDcBHqeqYs QmO2RKEJrZNiPtyIn5lLqflp7ZmUCeW6yXD4WNO0rdk3zHHMMqBJLu1r6RlwDtMhI0Rp S/S/LkGY3XKLYeDL+Prrx0ScfZVZoLpA99QN1PzE1dbW+G2xMVylcLL1oIiyYF0Ld82T awHrKqJmvpqArGE9oBP2pYHyaRVDKCy+QD0Tv3LB4P69VNeyEG/+Ctg8hCQvGDga8T53 A1AX5FAR6Cjzjb96GGC7d+A4Hfaa/0OW+nEwGnhQk9o8dOFl5xQJ73spfMjEYtZC9KXf 6sFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=5d37YfUU; 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 e32-v6si7576521plb.135.2018.03.29.21.17.55; Thu, 29 Mar 2018 21:18:11 -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=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=5d37YfUU; 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 S1750831AbeC3EQq (ORCPT + 99 others); Fri, 30 Mar 2018 00:16:46 -0400 Received: from mail-by2nam01on0057.outbound.protection.outlook.com ([104.47.34.57]:19914 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750738AbeC3EQo (ORCPT ); Fri, 30 Mar 2018 00:16:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=DxiIzP2HTSP7+om6hx6xDyJDe67MLHvW9QnwPBASMmg=; b=5d37YfUUdQ7/2MecbBqxOjZfv9RjTdzM7tTlt4florURIndgbQq+uTMPUQF7g79b/NOXQKNQf+oYQxGOudD7VmrIR5ItPgyx1SCuwekFM4auwd9/MoEy0QZbDpxhFev/mqbNgF+lA/hcp+QgKMK0THoB9O9FMCbWfdRHN3Kezog= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Received: from [10.236.65.235] (165.204.78.1) by CY1PR12MB0168.namprd12.prod.outlook.com (2a01:111:e400:50f6::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.609.10; Fri, 30 Mar 2018 04:16:40 +0000 Subject: Re: [PATCH 2/2] iommu/amd: Add basic debugfs infrastructure for AMD IOMMU To: Gary R Hook , iommu@lists.linux-foundation.org Cc: joro@8bytes.org, jacob.jun.pan@linux.intel.com, linux-kernel@vger.kernel.org References: <152236384612.3266.1451709369164076985.stgit@taos> <152236409481.3266.6464716993249076762.stgit@taos> From: Tom Lendacky Openpgp: preference=signencrypt Autocrypt: addr=thomas.lendacky@amd.com; keydata= xsFNBFaNZYkBEADxg5OW/ajpUG7zgnUQPsMqWPjeAxtu4YH3lCUjWWcbUgc2qDGAijsLTFv1 kEbaJdblwYs28z3chM7QkfCGMSM29JWR1fSwPH18WyAA84YtxfPD8bfb1Exwo0CRw1RLRScn 6aJhsZJFLKyVeaPO1eequEsFQurRhLyAfgaH9iazmOVZZmxsGiNRJkQv4YnM2rZYi+4vWnxN 1ebHf4S1puN0xzQsULhG3rUyV2uIsqBFtlxZ8/r9MwOJ2mvyTXHzHdJBViOalZAUo7VFt3Fb aNkR5OR65eTL0ViQiRgFfPDBgkFCSlaxZvc7qSOcrhol160bK87qn0SbYLfplwiXZY/b/+ez 0zBtIt+uhZJ38HnOLWdda/8kuLX3qhGL5aNz1AeqcE5TW4D8v9ndYeAXFhQI7kbOhr0ruUpA udREH98EmVJsADuq0RBcIEkojnme4wVDoFt1EG93YOnqMuif76YGEl3iv9tYcESEeLNruDN6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basrRMY7urJm8 4VM6MeG2mfa92FfrMeL0pnD5ONg1FIuleGlvvKdQdFnE4AlwGcKid5GUD+vNNj/pbZyUpe4r zBFsc21/8jXSlR6zJS4mgkNDIIBGiPny3tvKINMZ8VK00mR6INpd+NErd2LxwZ/DQ5ejVyVL 080CbiD55mxxhqkbd5fHSfdhvvXIIYN+nM/RFLwaQGW9g62iFWlqeNRXezkERDV5ahFqZMP4 YDdodn0nRVZYu2kaXfOclKPcH58HlrRb8pKTE3t/TNKGY3SmKoznH0QtM27TWeZ9R9RgTYiV zSNqP+QUNp6BotWI Message-ID: Date: Thu, 29 Mar 2018 23:16:35 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <152236409481.3266.6464716993249076762.stgit@taos> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: MWHPR22CA0053.namprd22.prod.outlook.com (2603:10b6:300:12a::15) To CY1PR12MB0168.namprd12.prod.outlook.com (2a01:111:e400:50f6::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6a717159-40da-4893-c012-08d595f50a18 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:CY1PR12MB0168; X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0168;3:kRAiHxIzct+p/zBuqDB+zBbHjena8h1N7Roje9OGmMIUeWlIfOQQRTSyH+oDgACxtMqs8GAsgOjny5KzZsGoCdegRLhdHpDifFRU+cAPKb89N7yLdtPzrWdkM9AP5j8yAr+4riajRUKZfBYS84fC+kN2UocKLejvzHfcxzSlr5i1GsEtTSoXQQufQkxzYwKhKlVekgWB2e4vuRIQrc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bR1BTpv+ucStPQJhA1zw06+QKRXaFPwn0v3L3p72eiGSy+x+7ngV7oK/6df8BoH5/4yZp1rkvxGLUenxAgjWOMcpBkipD/aBicHUZ/Zf83cqmOOkr9Bmpt;4:ryTIXd0aIAeXCg99fS0ncVUQ2OvrLPVyE6qUdqiz5c+vWoYogU9wBEsaQvoOyFZ5u2jhTwIY3q314yTU1nbt4EUz0ziRSBAIkeGUUmYlFLKwIlQIAemoR9aXDQyTqgG1TmTUV0FLSlzxXYVo1h65sU9XQbfg4EFmSqXKxnLFadQ+yTNU/wDhhRW6MqcQU1uEC+OlrlzTDwGbW+kOEHKMgxlfdxwRBCEQWVNxqzAoiKWFxUgefpp4EArkU//+Y/zFTD45nG/pdtxz+vPqXEgSNsI+v8dTyzuzMIKGxcW2OJyM8kmEAf4+klxhMFh9LCFS X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(20161123555045)(201703061421075)(6072148)(201708071742011);SRVR:CY1PR12MB0168;BCL:0;PCL:0;RULEID:;SRVR:CY1PR12MB0168; X-Forefront-PRVS: 06274D1C43 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(346002)(376002)(39380400002)(366004)(189003)(199004)(5660300001)(16526019)(186003)(77096007)(26005)(105586002)(575784001)(3846002)(4326008)(86362001)(6486002)(53936002)(8936002)(58126008)(446003)(6116002)(3260700006)(7736002)(81156014)(25786009)(8676002)(305945005)(81166006)(65826007)(31696002)(2906002)(68736007)(64126003)(65806001)(66066001)(50466002)(47776003)(2486003)(76176011)(97736004)(31686004)(16576012)(36756003)(106356001)(6246003)(486005)(59450400001)(486005)(476003)(2616005)(956004)(11346002)(52116002)(23676004)(229853002)(230700001)(386003)(72206003)(6666003)(53546011)(508600001)(52146003)(65956001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR12MB0168;H:[10.236.65.235];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjEyTUIwMTY4OzIzOkM0NW1TRHdWZFVOU1N2dHdjNnNCYmxOaXJY?= =?utf-8?B?K3lWbzlnbFhyYU81Rlo2RWk3eDB2NnkzRDhiQWpNMWJUNW5HbkVUV0ZiYTNy?= =?utf-8?B?eWxIMk1EeEFTYkpLVGpYVzQ1dTBtUGk4MDBwdUNLNE9kVHVkbTNsRnl6Umxp?= =?utf-8?B?QU5tOVZvMk5VWlU3Mmlpb2R0SjNIZm1qSW9pbmFSb2FwYlovb3laK2dyd0VZ?= =?utf-8?B?UDQ5MzhHa0U0N21FNzRQUDcxZGMzQXJhQ2NtZldNTjViZk5iQWxPRkpMNkZR?= =?utf-8?B?Q1phWWE2a3pYYUs4MmkySlo5TG9TNjlIb24rUlYwa0xkdUFsZ21KbUtOUmY1?= =?utf-8?B?QzJLVGx4QjBUQklkUXAvdXZGakpiMmRXTTVZQmlKV2NXR3RhOHFPT2drbStu?= =?utf-8?B?VzFvZlJGNG9Lcm50MWMwNXdia09pMHBrM3R2OEd5WWUrVTVjWVNaUld4M3g4?= =?utf-8?B?RUMvRngvR0xQWXRGZCt5RlpaUXcwYi8zYnBPMW5yN0FaaWxJVkN4c29PYTZs?= =?utf-8?B?cnRaaHpxVFlDd1ljbml6Tm9VSFp5ZW9qemFVNFhLSmRkS2hXOVlSek5zNnMx?= =?utf-8?B?VVNCaWw4c2RReWRuZHVwYU12dU1DNHcvVE5hZ1c2SGZKK1NhYkhLcnNtUEY2?= =?utf-8?B?M1hIQkpIQ2VIY2NBc2JialNOS3BydU9RblBlbVNLNTRrREU0clpnQUxzMnds?= =?utf-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ZgxkrGel6RnYVIFc75fnsV27vm6/7X6pZ5lrwC1VsHmdDQ==;5:CGZcnT+2ihQ0Z2otuDtm79VUOa96W52l/OXnVSRiHxcdvGfB9/RP/d8vuinL1q7bWv5FJqIHALWa2PdL4J202J9N96gly95HqsjsbEU90iW189uI2b8gFZOP2N6coqImibaki3HZnlSZ007KUT6/pGHkNejOEHe27IZit53dxto=;24:BDc46kntcoJZ+sAYJLCIcmEi5EEKAoNA7ihROmYkflqqI/GTqKJotny9TPRjFBl9MkUVRsPzs8c1r/b4dPjlQlbelw4cwZ480w1gFMHs8A8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY1PR12MB0168;7:XNs98weSqUFSKQrP+0yaJM1cHqvuS7lwlQF+1gz2Mml10D+Pxp2K6CLn3JQFVNOvKHy7EtQ++7dH4FuVt7/F05m0nqP2RVRyKndErq5U+Msa5j9uqDfvXacPaFvWqAuQ9T5xplaxutnkDBNj9P7Nm0GorPentfnTGGfAcGfq0N/5j+OAL5UlAGmVLYlLeWkhRlSm1mquF5o/70iZnU3Dh82SiTKjmoK/XvzuHZPefHZFVZwghoOZGFi81PnaSoDW;20:pYHkLS504XI4Kit7GMZAMoYzQ0c0fEuRqCAJoPK77TCUmpztVF5Qzme9GmtQarvYxd1YWVszVvw76fekryaFmxze2SlUaHuPqY33zoP3wOqKoXdIaa1aIEn+WG0DIhqaqvTLx4wNMzySMK8k8BHaOJCKfXN23XQk6BXgJV4o4XrsW6voYVy9kb29VaPvj0D2dsozkt89lBfgGW18wxlneE7tKaKUl5nA/LwAA30j8BnVQpKwzGkQ2YCsCyd+ZDgv X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2018 04:16:40.4994 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6a717159-40da-4893-c012-08d595f50a18 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB0168 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/29/2018 5:54 PM, Gary R Hook wrote: > Implement a skeleton framework for debugfs support in the > AMD IOMMU. > > > Signed-off-by: Gary R Hook > --- > drivers/iommu/Kconfig | 6 ++--- > drivers/iommu/Makefile | 2 +- > drivers/iommu/amd_iommu_debugfs.c | 47 +++++++++++++++++++++++++++++++++++++ > drivers/iommu/amd_iommu_init.c | 9 ++++--- > drivers/iommu/amd_iommu_proto.h | 6 +++++ > drivers/iommu/amd_iommu_types.h | 3 ++ > include/linux/iommu.h | 8 +++--- > 7 files changed, 69 insertions(+), 12 deletions(-) > create mode 100644 drivers/iommu/amd_iommu_debugfs.c > > diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig > index d40248446214..8d50151d5bf4 100644 > --- a/drivers/iommu/Kconfig > +++ b/drivers/iommu/Kconfig > @@ -65,9 +65,9 @@ config IOMMU_DEBUG > depends on DEBUG_FS > default n > help > - Base enablement for access to any IOMMU device. Allows individual > - drivers to populate debugfs for access to IOMMU registers and > - data structures. > + Enable exposure of IOMMU device internals. Allow devices to > + populate debugfs for access to IOMMU registers and data > + structures. This help text shouldn't change just because a driver is making use of the interface that was created in the previous patch. > > config IOMMU_IOVA > tristate > diff --git a/drivers/iommu/Makefile b/drivers/iommu/Makefile > index 5e5c3339681d..0ca250f626d9 100644 > --- a/drivers/iommu/Makefile > +++ b/drivers/iommu/Makefile > @@ -11,7 +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_AMD_IOMMU_DEBUG) += amd_iommu_debugfs.o > +obj-$(CONFIG_IOMMU_DEBUG) += amd_iommu_debugfs.o > 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 > diff --git a/drivers/iommu/amd_iommu_debugfs.c b/drivers/iommu/amd_iommu_debugfs.c > new file mode 100644 > index 000000000000..3547ad3339c1 > --- /dev/null > +++ b/drivers/iommu/amd_iommu_debugfs.c > @@ -0,0 +1,47 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * AMD IOMMU driver > + * > + * Copyright (C) 2018 Advanced Micro Devices, Inc. > + * > + * Author: Gary R Hook > + */ > + > +#ifdef CONFIG_IOMMU_DEBUG Since the module won't be built unless this is defined, you don't need this. > + > +#include > +#include > +#include > +#include "amd_iommu_proto.h" > +#include "amd_iommu_types.h" > + > +static struct dentry *iommu_debugfs_dir; > +static DEFINE_RWLOCK(iommu_debugfs_lock); Use amd_iommu_... Also, didn't you run into an issue with the CCP and debugfs creation during probe using a RWLOCK? Should probably make this a mutex. > + > +#define MAX_NAME_LEN 20 > + > +void amd_iommu_debugfs_setup(struct amd_iommu *iommu) > +{ > + char name[MAX_NAME_LEN + 1]; > + struct dentry *d_top; > + unsigned long flags; > + > + if (!debugfs_initialized()) > + return; > + > + write_lock_irqsave(&iommu_debugfs_lock, flags); > + if (!iommu_debugfs_dir && (d_top = iommu_debugfs_setup())) > + iommu_debugfs_dir = debugfs_create_dir("amd", d_top); > + write_unlock_irqrestore(&iommu_debugfs_lock, flags); > + if (iommu_debugfs_dir) { > + snprintf(name, MAX_NAME_LEN, "iommu%02d", iommu->index); > + iommu->debugfs_instance = debugfs_create_dir(name, > + iommu_debugfs_dir); > + if (!iommu->debugfs_instance) > + debugfs_remove_recursive(iommu_debugfs_dir); So this might cause an error. You remove it, but don't set the variable to NULL, so the next IOMMU that is probed could try to use it. But why are you deleting it anyway? > + } > + > + return; > +} > + > +#endif > diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c > index 99d48c42a12f..43856c7f4ea1 100644 > --- a/drivers/iommu/amd_iommu_init.c > +++ b/drivers/iommu/amd_iommu_init.c > @@ -89,6 +89,7 @@ > #define ACPI_DEVFLAG_ATSDIS 0x10000000 > > #define LOOP_TIMEOUT 100000 > + Spurious newline. > /* > * ACPI table definitions > * > @@ -2720,6 +2721,7 @@ int __init amd_iommu_enable_faulting(void) > */ > static int __init amd_iommu_init(void) > { > + struct amd_iommu *iommu; > int ret; > > ret = iommu_go_to_state(IOMMU_INITIALIZED); > @@ -2729,14 +2731,15 @@ static int __init amd_iommu_init(void) > disable_iommus(); > free_iommu_resources(); > } else { > - struct amd_iommu *iommu; > - > uninit_device_table_dma(); > for_each_iommu(iommu) > iommu_flush_all_caches(iommu); > } > } > > + for_each_iommu(iommu) > + amd_iommu_debugfs_setup(iommu); > + > return ret; > } > > @@ -2783,8 +2786,6 @@ int __init amd_iommu_detect(void) > iommu_detected = 1; > x86_init.iommu.iommu_init = amd_iommu_init; > > -dump_stack(); > - > return 1; > } > > diff --git a/drivers/iommu/amd_iommu_proto.h b/drivers/iommu/amd_iommu_proto.h > index 640c286a0ab9..e19cebc5c740 100644 > --- a/drivers/iommu/amd_iommu_proto.h > +++ b/drivers/iommu/amd_iommu_proto.h > @@ -33,6 +33,12 @@ extern void amd_iommu_uninit_devices(void); > extern void amd_iommu_init_notifier(void); > extern int amd_iommu_init_api(void); > > +#ifdef CONFIG_IOMMU_DEBUG Use space instead of tab. > +extern void amd_iommu_debugfs_setup(struct amd_iommu *iommu); > +#else > +static inline void amd_iommu_debugfs_setup(struct amd_iommu *iommu) {} > +#endif > + > /* Needed for interrupt remapping */ > extern int amd_iommu_prepare(void); > extern int amd_iommu_enable(void); > diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h > index f6b24c7d8b70..6dca9fe38518 100644 > --- a/drivers/iommu/amd_iommu_types.h > +++ b/drivers/iommu/amd_iommu_types.h > @@ -591,6 +591,9 @@ struct amd_iommu { > > u32 flags; > volatile u64 __aligned(8) cmd_sem; > + > + /* DebugFS Info */ > + struct dentry *debugfs_instance; > }; > > static inline struct amd_iommu *dev_to_amd_iommu(struct device *dev) > diff --git a/include/linux/iommu.h b/include/linux/iommu.h > index 98527f9b473b..dbfff811aa25 100644 > --- a/include/linux/iommu.h > +++ b/include/linux/iommu.h > @@ -412,6 +412,10 @@ void iommu_fwspec_free(struct device *dev); > int iommu_fwspec_add_ids(struct device *dev, u32 *ids, int num_ids); > const struct iommu_ops *iommu_ops_from_fwnode(struct fwnode_handle *fwnode); > > +#ifdef CONFIG_IOMMU_DEBUG > +extern struct dentry *iommu_debugfs_setup(void); > +#endif > + Any reason why this moved? If it was not in the right place in the first patch, that's where it should be fixed. Thanks, Tom > #else /* CONFIG_IOMMU_API */ > > struct iommu_ops {}; > @@ -696,10 +700,6 @@ const struct iommu_ops *iommu_ops_from_fwnode(struct fwnode_handle *fwnode) > return NULL; > } > > -#ifdef CONFIG_IOMMU_DEBUG > -extern struct dentry *iommu_debugfs_setup(void); > -#endif > - > #endif /* CONFIG_IOMMU_API */ > > #endif /* __LINUX_IOMMU_H */ >