Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp536915imu; Mon, 26 Nov 2018 14:37:04 -0800 (PST) X-Google-Smtp-Source: AFSGD/WHQoiMFBQl4E/7DGMUGSqMItbWVojwgLmAg1QOBcVjIaeqKrBOnpJtBsbb7IoKLlKSICLk X-Received: by 2002:a63:f444:: with SMTP id p4mr26503913pgk.124.1543271824560; Mon, 26 Nov 2018 14:37:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543271824; cv=none; d=google.com; s=arc-20160816; b=CIpF2B3XWnz90edx1AZosvftH/MvNjpYXF1zab+BA0NjHFcXL6twbDQj2gLd8AZwOl YnWF8HOwemYXiH2X3cOamwGo4klrBjAf+aCb7NbtqmnnQFED2/boSIdiL+dUMvE+ZBzJ a2MYBsKj0bsBYcwQZzN7hZBkZRMDvQfdsHD932p4zQ+PCjDfPwY5CZHHizRMs6tqxcsC oLi3fOTDho89kcFjOfpHUZX1eR+75K/vEMwsgYUAb7WM1NZkeyMQH9PzMfJFHc7UkOnZ HezKrM8k+xcGARFCMUcTo4hqNW1pmoWCgf2Vx6H3c02F9gD5YJ5ib9p+0uJ5RnPt1cyK Pkhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=qHYf08YlZZHQOxZ8Q9ImQK1LHzCXV2R+SVWwj7bzfy0=; b=gmI+pVlrkUmpFvCWVJ70nV9i73m1L5YklhY+yCjqNn5T6g9iskhRMEouS41/kZDVzn CH4ocl1mgswqK01JsOOPrQCNINu1fZbjm30VN5lDEksENt7UjkNv35qttR+1QIYqv7YX uumI0s72k/2/+qrvJ6qDqs4OdyHG3MXPH0TIML+q9ueO84XDM73Tio5ZwAk9jY3bAdVy pUarxGykg22V7j5xtKP55Fu5flyPTpy5fRWngr220HkSnNeTiASYEvMRx7QgmU7+lOZV 5/U2K7kr8hLuyOKJv16GmhryamB3MyShX1NFsmwG2vAKZkHyaFpnidhWkB7xkhqycoio Ca8A== 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 d17si1744988pfm.40.2018.11.26.14.36.49; Mon, 26 Nov 2018 14:37:04 -0800 (PST) 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 S1727551AbeK0Jau (ORCPT + 99 others); Tue, 27 Nov 2018 04:30:50 -0500 Received: from mail1.windriver.com ([147.11.146.13]:44289 "EHLO mail1.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727279AbeK0Jau (ORCPT ); Tue, 27 Nov 2018 04:30:50 -0500 Received: from ALA-HCA.corp.ad.wrs.com ([147.11.189.40]) by mail1.windriver.com (8.15.2/8.15.1) with ESMTPS id wAQMYUI7015339 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Mon, 26 Nov 2018 14:34:30 -0800 (PST) Received: from yow-cube1.wrs.com (128.224.56.98) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server id 14.3.408.0; Mon, 26 Nov 2018 14:34:30 -0800 From: Paul Gortmaker To: Joerg Roedel CC: , , Paul Gortmaker , Will Deacon , Robin Murphy , Nate Watterson , Subject: [PATCH 9/9] iommu: arm-smmu-v3: make it explicitly non-modular Date: Mon, 26 Nov 2018 17:31:38 -0500 Message-ID: <1543271498-28966-10-git-send-email-paul.gortmaker@windriver.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1543271498-28966-1-git-send-email-paul.gortmaker@windriver.com> References: <1543271498-28966-1-git-send-email-paul.gortmaker@windriver.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Kconfig currently controlling compilation of this code is: drivers/iommu/Kconfig:config ARM_SMMU_V3 drivers/iommu/Kconfig: bool "ARM Ltd. System MMU Version 3 (SMMUv3) Support" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. Since module_platform_driver() uses the same init level priority as builtin_platform_driver() the init ordering remains unchanged with this commit. We explicitly disallow a driver unbind, since that doesn't have a sensible use case anyway, but unlike most drivers, we can't delete the function tied to the ".remove" field. This is because as of commit 7aa8619a66ae ("iommu/arm-smmu-v3: Implement shutdown method") the .remove function was given a one line wrapper and re-used to provide a .shutdown service. So we delete the wrapper and re-name the function from remove to shutdown. We add a moduleparam.h include since the file does actually declare some module parameters, and leaving them as such is the easiest way currently to remain backwards compatible with existing use cases. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Cc: Will Deacon Cc: Joerg Roedel Cc: Robin Murphy Cc: Nate Watterson Cc: linux-arm-kernel@lists.infradead.org Cc: iommu@lists.linux-foundation.org Signed-off-by: Paul Gortmaker --- drivers/iommu/arm-smmu-v3.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index 6947ccf26512..1189c06079d4 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -20,7 +20,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -356,6 +357,10 @@ #define MSI_IOVA_BASE 0x8000000 #define MSI_IOVA_LENGTH 0x100000 +/* + * not really modular, but the easiest way to keep compat with existing + * bootargs behaviour is to continue using module_param_named here. + */ static bool disable_bypass = 1; module_param_named(disable_bypass, disable_bypass, bool, S_IRUGO); MODULE_PARM_DESC(disable_bypass, @@ -2928,37 +2933,25 @@ static int arm_smmu_device_probe(struct platform_device *pdev) return 0; } -static int arm_smmu_device_remove(struct platform_device *pdev) +static void arm_smmu_device_shutdown(struct platform_device *pdev) { struct arm_smmu_device *smmu = platform_get_drvdata(pdev); arm_smmu_device_disable(smmu); - - return 0; -} - -static void arm_smmu_device_shutdown(struct platform_device *pdev) -{ - arm_smmu_device_remove(pdev); } static const struct of_device_id arm_smmu_of_match[] = { { .compatible = "arm,smmu-v3", }, { }, }; -MODULE_DEVICE_TABLE(of, arm_smmu_of_match); static struct platform_driver arm_smmu_driver = { .driver = { .name = "arm-smmu-v3", .of_match_table = of_match_ptr(arm_smmu_of_match), + .suppress_bind_attrs = true, }, .probe = arm_smmu_device_probe, - .remove = arm_smmu_device_remove, .shutdown = arm_smmu_device_shutdown, }; -module_platform_driver(arm_smmu_driver); - -MODULE_DESCRIPTION("IOMMU API for ARM architected SMMUv3 implementations"); -MODULE_AUTHOR("Will Deacon "); -MODULE_LICENSE("GPL v2"); +builtin_platform_driver(arm_smmu_driver); -- 2.7.4