From patchwork Mon May 23 11:01:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 9131561 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B390360459 for ; Mon, 23 May 2016 11:04:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6EE32822E for ; Mon, 23 May 2016 11:04:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A64728233; Mon, 23 May 2016 11:04:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3B6672822E for ; Mon, 23 May 2016 11:04:04 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b4ndC-0004MO-2D; Mon, 23 May 2016 11:02:42 +0000 Received: from mailout4.w1.samsung.com ([210.118.77.14]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b4nd9-0004Ie-Qb for linux-arm-kernel@lists.infradead.org; Mon, 23 May 2016 11:02:40 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O7M00HIPMNSOM60@mailout4.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 23 May 2016 12:02:16 +0100 (BST) X-AuditID: cbfec7f4-f796c6d000001486-47-5742e338a0cf Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 3F.A4.05254.833E2475; Mon, 23 May 2016 12:02:16 +0100 (BST) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O7M00I8EMNPTS70@eusync2.samsung.com>; Mon, 23 May 2016 12:02:16 +0100 (BST) From: Marek Szyprowski To: iommu@lists.linux-foundation.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 4/3] iommu/exynos: Prepare for deferred probe support Date: Mon, 23 May 2016 13:01:27 +0200 Message-id: <1464001287-12748-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1463995809-26862-1-git-send-email-m.szyprowski@samsung.com> References: <1463995809-26862-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrALMWRmVeSWpSXmKPExsVy+t/xK7oWj53CDZY9lLbYOGM9q8Wk+xNY LBbst7bonL2B3eL1C0OL/sevmS02Pb7GajHj/D4mi7VH7rI7cHo8OTiPyWPTqk42j81L6j0m 31jO6NG3ZRWjx+dNcgFsUVw2Kak5mWWpRfp2CVwZx6YuYixYw12xsWcJawPjDs4uRk4OCQET iVkfW5kgbDGJC/fWs4HYQgJLGSU2/tfsYuQCspuYJC53TGEFSbAJGEp0ve0CKxIRyJd4sfcv C0gRs8AvRolzne1gk4QFXCX+dO8Ga2ARUJXo/vQILM4r4CHxeN45VohtchL/X64Ai3MKeEo8 XHYXarOHxPwLU5gmMPIuYGRYxSiaWppcUJyUnmuoV5yYW1yal66XnJ+7iRESbl92MC4+ZnWI UYCDUYmHdwOjU7gQa2JZcWXuIUYJDmYlEV7jR0Ah3pTEyqrUovz4otKc1OJDjNIcLErivHN3 vQ8REkhPLEnNTk0tSC2CyTJxcEo1MDL9ipQ37bx63Se4/MkGjr1s2/Ys2Fdid4R15fmVP/28 WxQVts4VY347f3HNHLVtOr8bfhY37tzU2O4ieXnNvLyTJgzJjXUNK0+dnPN/e97HrksK90+x cC1YX1AePNP/QW/mvLi4Mwxtmk/azQtC2ByfbTJKCS0KvvbF7kBf+7SqSLVdNvm+zUosxRmJ hlrMRcWJALUZ0qUzAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160523_040240_035011_7D1C9C91 X-CRM114-Status: GOOD ( 16.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Joerg Roedel , Inki Dae , Kukjin Kim , Marek Szyprowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Register iommu_ops at the end of successful probe instead of doing that unconditionally. This makes Exynos IOMMU driver ready for deferred probe caused by not-yet-available clocks. Signed-off-by: Marek Szyprowski --- I'm sorry for the confussing patch number. This patch got lost while rebasing, but it should belong to the "Exynos IOMMU: improve clock management" patchset. Best regards Marek Szyprowski Samsung R&D Institute Poland --- drivers/iommu/exynos-iommu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index e0b834375f17..633e6d023c0d 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -581,6 +581,8 @@ static void sysmmu_tlb_invalidate_entry(struct sysmmu_drvdata *data, spin_unlock_irqrestore(&data->lock, flags); } +static struct iommu_ops exynos_iommu_ops; + static int __init exynos_sysmmu_probe(struct platform_device *pdev) { int irq, ret; @@ -654,6 +656,8 @@ static int __init exynos_sysmmu_probe(struct platform_device *pdev) pm_runtime_enable(dev); + of_iommu_set_ops(dev->of_node, &exynos_iommu_ops); + return 0; } @@ -1347,7 +1351,6 @@ static int __init exynos_iommu_of_setup(struct device_node *np) if (!dma_dev) dma_dev = &pdev->dev; - of_iommu_set_ops(np, &exynos_iommu_ops); return 0; }