From patchwork Mon Aug 15 15:23:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Pieralisi X-Patchwork-Id: 9281425 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 D3C756086A for ; Mon, 15 Aug 2016 15:31:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C3F1E28D26 for ; Mon, 15 Aug 2016 15:31:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B891828D2C; Mon, 15 Aug 2016 15:31:36 +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 49F3328D29 for ; Mon, 15 Aug 2016 15:31:36 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bZJpy-0002Xk-58; Mon, 15 Aug 2016 15:30:02 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bZJkj-0005YG-DU for linux-arm-kernel@lists.infradead.org; Mon, 15 Aug 2016 15:24:39 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 97A2CBB4; Mon, 15 Aug 2016 08:25:49 -0700 (PDT) Received: from red-moon.cambridge.arm.com (red-moon.cambridge.arm.com [10.1.206.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EF6643F32C; Mon, 15 Aug 2016 08:24:14 -0700 (PDT) From: Lorenzo Pieralisi To: iommu@lists.linux-foundation.org Subject: [PATCH v4 11/15] drivers: iommu: arm-smmu-v3: enable ACPI driver initialization Date: Mon, 15 Aug 2016 16:23:36 +0100 Message-Id: <1471274620-20754-12-git-send-email-lorenzo.pieralisi@arm.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1471274620-20754-1-git-send-email-lorenzo.pieralisi@arm.com> References: <1471274620-20754-1-git-send-email-lorenzo.pieralisi@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160815_082437_694310_EEA6E0FA X-CRM114-Status: GOOD ( 13.10 ) 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: linux-arm-kernel@lists.infradead.org, Lorenzo Pieralisi , Marc Zyngier , "Rafael J. Wysocki" , Joerg Roedel , Will Deacon , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Sinan Kaya , linux-acpi@vger.kernel.org, Dennis Chen , Hanjun Guo , Tomasz Nowicki , Nate Watterson , Robin Murphy , Jon Masters 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 On systems booting with ACPI that enable the ARM SMMU components in the kernel config options, the ARM SMMU v3 init function (ie arm_smmu_init(), that registers the driver and sets-up bus iommu operations) does not run only because the device tree interface (of_find_matching_node()) fails to find the respective device tree nodes for ARM SMMU devices. This works as long as there are no ARM SMMU devices to be probed with ACPI. If ARM SMMU v3 components are part of the IORT tables, for them to be instantiated and probed the function registering the ARM SMMU v3 driver must be able to register the driver and initialize the bus IOMMU operations accordingly. This patch changes the logic in arm-smmu-v3 init call to allow for it to be probed in ACPI systems. Signed-off-by: Lorenzo Pieralisi Acked-by: Will Deacon Cc: Will Deacon Cc: Robin Murphy Cc: Joerg Roedel --- drivers/iommu/arm-smmu-v3.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index 91a7600..75b78f9 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -2689,11 +2689,16 @@ static int __init arm_smmu_init(void) if (registered) return 0; - np = of_find_matching_node(NULL, arm_smmu_of_match); - if (!np) - return 0; + if (acpi_disabled) { + np = of_find_matching_node(NULL, arm_smmu_of_match); + if (!np) + return 0; - of_node_put(np); + of_node_put(np); + } else { + if (!iort_node_match(ACPI_IORT_NODE_SMMU_V3)) + return 0; + } ret = platform_driver_register(&arm_smmu_driver); if (ret)