Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1447175

[RFC PATCH v3 10/13] drivers: iommu: arm-smmu-v3: enable ACPI driver initialization

From Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Newsgroups linux.kernel
Subject [RFC PATCH v3 10/13] drivers: iommu: arm-smmu-v3: enable ACPI driver initialization
Date 2016-07-20 13:30 +0200
Message-ID <rWXRo-M3-25@gated-at.bofh.it> (permalink)
References <rWXRn-M3-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <lorenzo.pieralisi@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Joerg Roedel <joro@8bytes.org>
---
 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 15e74da..1a4e9ce 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)
 	struct device_node *np;
 	int ret;
 
-	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)
-- 
2.6.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH v3 00/13] ACPI IORT ARM SMMU v3 support Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2016-07-20 13:30 +0200
  [RFC PATCH v3 06/13] drivers: acpi: implement acpi_dma_configure Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2016-07-20 13:30 +0200
  [RFC PATCH v3 04/13] drivers: platform: add fwnode base platform devices retrieval Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2016-07-20 13:30 +0200
  [RFC PATCH v3 07/13] drivers: acpi: iort: add node match function Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2016-07-20 13:30 +0200
  [RFC PATCH v3 10/13] drivers: iommu: arm-smmu-v3: enable ACPI driver initialization Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2016-07-20 13:30 +0200
  [RFC PATCH v3 02/13] drivers: acpi: iort: introduce linker section for IORT entries probing Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2016-07-20 13:30 +0200
  [RFC PATCH v3 01/13] drivers: iommu: add FWNODE_IOMMU fwnode type Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2016-07-20 13:30 +0200
  [RFC PATCH v3 13/13] drivers: acpi: iort: introduce iort_iommu_configure Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2016-07-20 13:30 +0200
  [RFC PATCH v3 09/13] drivers: iommu: arm-smmu-v3: split probe functions into DT/generic portions Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2016-07-20 13:30 +0200
  [RFC PATCH v3 11/13] drivers: iommu: arm-smmu-v3: add IORT platform device creation Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2016-07-20 13:30 +0200
  [RFC PATCH v3 05/13] drivers: iommu: make iommu_fwspec OF agnostic Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2016-07-20 13:30 +0200
    Re: [RFC PATCH v3 05/13] drivers: iommu: make iommu_fwspec OF  agnostic Robin Murphy <robin.murphy@arm.com> - 2016-07-25 17:20 +0200
      Re: [RFC PATCH v3 05/13] drivers: iommu: make iommu_fwspec OF agnostic Rob Herring <robh@kernel.org> - 2016-07-25 17:30 +0200
        Re: [RFC PATCH v3 05/13] drivers: iommu: make iommu_fwspec OF  agnostic Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2016-07-25 18:00 +0200
      Re: [RFC PATCH v3 05/13] drivers: iommu: make iommu_fwspec OF  agnostic Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2016-07-25 17:50 +0200
        Re: [RFC PATCH v3 05/13] drivers: iommu: make iommu_fwspec OF  agnostic Robin Murphy <robin.murphy@arm.com> - 2016-07-25 18:00 +0200
          Re: [RFC PATCH v3 05/13] drivers: iommu: make iommu_fwspec OF  agnostic Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2016-07-25 18:20 +0200
  Re: [RFC PATCH v3 00/13] ACPI IORT ARM SMMU v3 support Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2016-07-25 10:40 +0200

csiph-web