From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4776FC2D0C1 for ; Thu, 19 Dec 2019 12:04:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1D7FA222C2 for ; Thu, 19 Dec 2019 12:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576757076; bh=eMa7b4+OPANnS37OudXoT35xS7xfsQpyDDqdKA5B938=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ZNHd/RWJT0W8QcGVFFPFLNzNSfyFztVduFwUR4/qCcmO7JRnhatOX+W4vf+qL7o9B eTIWSftJRp8b5L38UOLOur+zLuDxeeTQmKWzv8GN2WHe9fFJmPjRyPICajnUrDSTOc /PfD5cQbNNZwfwdfMpfHkdcoJBNvNMFrNC8K+7Fw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727170AbfLSMEf (ORCPT ); Thu, 19 Dec 2019 07:04:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:36362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727126AbfLSME2 (ORCPT ); Thu, 19 Dec 2019 07:04:28 -0500 Received: from localhost.localdomain (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8299524684; Thu, 19 Dec 2019 12:04:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576757066; bh=eMa7b4+OPANnS37OudXoT35xS7xfsQpyDDqdKA5B938=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ObCpn9d2ygQmT24mP40Y0ptFPF6fpCPHAcT2PZzLLP9FcMMPQLLqWlaH5Hxuq5o5u vwQIyuz59KnY/43ZbqSdi5NS2r6bZ5KnXhl6hbtM/1AMI3s9rqmyH0j0q4Yz25CQ3z Zc3o5CgNjhkDyivstqHHA0NuqWLH1ijKn59ob/IY= From: Will Deacon To: linux-kernel@vger.kernel.org, iommu@lists.linuxfoundation.org Cc: kernel-team@android.com, Will Deacon , Jean-Philippe Brucker , Jordan Crouse , John Garry , Bjorn Helgaas , Saravana Kannan , Greg Kroah-Hartman , "Isaac J. Manjarres" , Robin Murphy , Lorenzo Pieralisi , Joerg Roedel , Ard Biesheuvel Subject: [PATCH v4 09/16] Revert "iommu/arm-smmu: Make arm-smmu explicitly non-modular" Date: Thu, 19 Dec 2019 12:03:45 +0000 Message-Id: <20191219120352.382-10-will@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219120352.382-1-will@kernel.org> References: <20191219120352.382-1-will@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit addb672f200f4e99368270da205320b83efe01a0. Let's get the SMMU driver building as a module, which means putting back some dead code that we used to carry. Signed-off-by: Will Deacon --- drivers/iommu/arm-smmu.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 4f1a350d9529..7c768f771001 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -27,8 +27,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -60,10 +59,6 @@ #define MSI_IOVA_LENGTH 0x100000 static int force_stage; -/* - * not really modular, but the easiest way to keep compat with existing - * bootargs behaviour is to continue using module_param() here. - */ module_param(force_stage, int, S_IRUGO); MODULE_PARM_DESC(force_stage, "Force SMMU mappings to be installed at a particular stage of translation. A value of '1' or '2' forces the corresponding stage. All other values are ignored (i.e. no stage is forced). Note that selecting a specific stage will disable support for nested translation."); @@ -1911,6 +1906,7 @@ static const struct of_device_id arm_smmu_of_match[] = { { .compatible = "qcom,smmu-v2", .data = &qcom_smmuv2 }, { }, }; +MODULE_DEVICE_TABLE(of, arm_smmu_of_match); #ifdef CONFIG_ACPI static int acpi_smmu_get_data(u32 model, struct arm_smmu_device *smmu) @@ -2196,12 +2192,12 @@ static int arm_smmu_legacy_bus_init(void) } device_initcall_sync(arm_smmu_legacy_bus_init); -static void arm_smmu_device_shutdown(struct platform_device *pdev) +static int arm_smmu_device_remove(struct platform_device *pdev) { struct arm_smmu_device *smmu = platform_get_drvdata(pdev); if (!smmu) - return; + return -ENODEV; if (!bitmap_empty(smmu->context_map, ARM_SMMU_MAX_CBS)) dev_err(&pdev->dev, "removing device with active domains!\n"); @@ -2217,6 +2213,12 @@ static void arm_smmu_device_shutdown(struct platform_device *pdev) clk_bulk_disable(smmu->num_clks, smmu->clks); clk_bulk_unprepare(smmu->num_clks, smmu->clks); + return 0; +} + +static void arm_smmu_device_shutdown(struct platform_device *pdev) +{ + arm_smmu_device_remove(pdev); } static int __maybe_unused arm_smmu_runtime_resume(struct device *dev) @@ -2266,12 +2268,16 @@ static const struct dev_pm_ops arm_smmu_pm_ops = { static struct platform_driver arm_smmu_driver = { .driver = { - .name = "arm-smmu", - .of_match_table = of_match_ptr(arm_smmu_of_match), - .pm = &arm_smmu_pm_ops, - .suppress_bind_attrs = true, + .name = "arm-smmu", + .of_match_table = of_match_ptr(arm_smmu_of_match), + .pm = &arm_smmu_pm_ops, }, .probe = arm_smmu_device_probe, + .remove = arm_smmu_device_remove, .shutdown = arm_smmu_device_shutdown, }; -builtin_platform_driver(arm_smmu_driver); +module_platform_driver(arm_smmu_driver); + +MODULE_DESCRIPTION("IOMMU API for ARM architected SMMU implementations"); +MODULE_AUTHOR("Will Deacon "); +MODULE_LICENSE("GPL v2"); -- 2.24.1.735.g03f4e72817-goog