From patchwork Fri Aug 4 10:28:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 109394 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp1957320qge; Fri, 4 Aug 2017 03:28:48 -0700 (PDT) X-Received: by 10.84.216.76 with SMTP id f12mr2134890plj.219.1501842528762; Fri, 04 Aug 2017 03:28:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501842528; cv=none; d=google.com; s=arc-20160816; b=Ndhxo7e1/2st52JgoJepy5JgM5HpL966vJq7ISe3IuVRWSjpf67vPuNPlBCXAVdFxK sIMrcaOh+s3sZq0UWByD4+oJ0KjWA/kk2dnAsB2vTXPI4MOECp2HKCB2njJcWxR8B0LM q3FH8a8CR5D0Bj6TT4KOFDYO+AzClEu1uELWKXUcohLwWmhbT7j+3Q9W7nGiO6MwBuPM gZ5bchDZ754Kfn7S2Fro5Hw55INNazoQ7+nGVdRFtOkom0wpwutWQUTmesZnvrhrFvwf PPQQdxmrePhZ5Izi0h2tejdhJ/jCgZKTp0pTV62PEpW7tB+zdoonT24+2EY3ufEKOT4b gS7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:message-id:date :subject:cc:to:from:arc-authentication-results; bh=P1azGmGBAa874f64UrUniQqRUnvN0T7w5XngprZKSUE=; b=cFDbH/6j9fzB0eKchw/Vy7ih8GwXhVC5KtvWCjvVyjQsY66RYIb2gV3+dn75Sg+kSj +x2P7l2Ug2vDcUJHY9n7YvEVdTr/TPYumBry2V0byZVpaFggkOAUyX27njB8vowzIIN3 JTAfcKxPSTF/X7e8ZOiuqZCGJP0staMbquJerAa/1+G7W70s9e0pYd3v522MGn+JqYBs wfWQ4ktXgNe3Pf2LHzqthSY+/FZJZ1JhGmbKlXycYPWB/UD1n7xqHnGkTYYmywnjKjv2 GvG3ncMb/BlIxQ2sz4B2HktuSeVZSKJZSaxT41Y1YCKQoCDPYG8blTKEUFOsd+1cun9/ tqoA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b72si801882pfj.433.2017.08.04.03.28.48; Fri, 04 Aug 2017 03:28:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-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-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751931AbdHDK2s (ORCPT + 4 others); Fri, 4 Aug 2017 06:28:48 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:20351 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751291AbdHDK2q (ORCPT ); Fri, 4 Aug 2017 06:28:46 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OU500FGWP3WSA70@mailout3.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Fri, 04 Aug 2017 11:28:44 +0100 (BST) Received: from eusmges3.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170804102844eucas1p223cda7c8d1955321c4b51ea81b41d931~XndGWmLZR1283712837eucas1p2r; Fri, 4 Aug 2017 10:28:44 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3.samsung.com (EUCPMTA) with SMTP id DB.E9.17464.B5C44895; Fri, 4 Aug 2017 11:28:43 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170804102843eucas1p1fb17da4f86044a8ad78cc1684aa6e321~XndFpspWc1890418904eucas1p1g; Fri, 4 Aug 2017 10:28:43 +0000 (GMT) X-AuditID: cbfec7f2-f797e6d000004438-6d-59844c5bd13f Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id C7.E5.17452.B5C44895; Fri, 4 Aug 2017 11:28:43 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OU500M7SP3RRR10@eusync1.samsung.com>; Fri, 04 Aug 2017 11:28:43 +0100 (BST) From: Marek Szyprowski To: iommu@lists.linux-foundation.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Joerg Roedel , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH] iommu/exynos: Remove custom platform device registration code Date: Fri, 04 Aug 2017 12:28:33 +0200 Message-id: <1501842513-23180-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGIsWRmVeSWpSXmKPExsWy7djP87rRPi2RBjMn2lhsnLGe1WLBfmuL ztkb2C3OnwcSM87vY7JYe+QuuwObx5OD85g8Nq3qZPOYfGM5o0ffllWMHp83yQWwRnHZpKTm ZJalFunbJXBlXPj4gKVgjVBF37YulgbGCfxdjJwcEgImEttm72WEsMUkLtxbzwZiCwksZZRo 767sYuQCsj8zSjy98p8dpmHPry+MEIlljBLPlk9jg3AamCSmd24Ga2cTMJToets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xZW5hxglOJiVRHhbvVsihXhTEiurUovy44tK c1KLDzGaAi2fyCwlmpwPjJe8knhDE0NzS0MjYwsLcyMjJXFe9ctNkUIC6YklqdmpqQWpRTB9 TBycUg2Mc93/Rjtenrh753+RptjgDx8mH27e5/ucw+DazImLF+1f/8jt9RuLy1UBARE+1jtn fYrbv9vw7UWf2iuJDQpfPZZubGa5qbPk+KuKsp4DexhaP+xvqQuP3G94yL/1xcFtT/8Wf1sl 8893A9PsK9sFfgt9VwgKP84wYac/s7b2jLW11fOS/ReVpiqxFGckGmoxFxUnAgDp71iaXwIA AA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170804102843eucas1p1fb17da4f86044a8ad78cc1684aa6e321 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170804102843eucas1p1fb17da4f86044a8ad78cc1684aa6e321 X-RootMTR: 20170804102843eucas1p1fb17da4f86044a8ad78cc1684aa6e321 References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Commit 09515ef5ddad ("of/acpi: Configure dma operations at probe time for platform/amba/pci bus devices") postponed the moment of attaching IOMMU controller to its device, so there is no need to register IOMMU controllers very early, before all other devices in the system. This change gives us an opportunity to use standard platform device registration method also for Exynos SYSMMU controllers. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 2395478dde75..76436d4ff4d1 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -659,6 +659,13 @@ static int __init exynos_sysmmu_probe(struct platform_device *pdev) } } + /* + * use the first registered sysmmu device for performing + * dma mapping operations on iommu page tables (cpu cache flush) + */ + if (!dma_dev) + dma_dev = &pdev->dev; + pm_runtime_enable(dev); return 0; @@ -1339,8 +1346,6 @@ static int exynos_iommu_of_xlate(struct device *dev, .of_xlate = exynos_iommu_of_xlate, }; -static bool init_done; - static int __init exynos_iommu_init(void) { int ret; @@ -1373,8 +1378,6 @@ static int __init exynos_iommu_init(void) goto err_set_iommu; } - init_done = true; - return 0; err_set_iommu: kmem_cache_free(lv2table_kmem_cache, zero_lv2_table); @@ -1384,27 +1387,6 @@ static int __init exynos_iommu_init(void) kmem_cache_destroy(lv2table_kmem_cache); return ret; } +core_initcall(exynos_iommu_init); -static int __init exynos_iommu_of_setup(struct device_node *np) -{ - struct platform_device *pdev; - - if (!init_done) - exynos_iommu_init(); - - pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root); - if (!pdev) - return -ENODEV; - - /* - * use the first registered sysmmu device for performing - * dma mapping operations on iommu page tables (cpu cache flush) - */ - if (!dma_dev) - dma_dev = &pdev->dev; - - return 0; -} - -IOMMU_OF_DECLARE(exynos_iommu_of, "samsung,exynos-sysmmu", - exynos_iommu_of_setup); +IOMMU_OF_DECLARE(exynos_iommu_of, "samsung,exynos-sysmmu", NULL);