summaryrefslogtreecommitdiff
path: root/drivers/iommu/fsl_pamu.c
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2017-08-23 16:28:09 +0200
committerJoerg Roedel <jroedel@suse.de>2017-08-23 16:28:09 +0200
commit3ff2dcc058946c48afd3f2c8cd9e3a880b466c5b (patch)
treec22d36b858dde810a04ad9a1153dca04741185b4 /drivers/iommu/fsl_pamu.c
parent68a17f0be6feb8de1f5e26b93f49791031374c4c (diff)
iommu/pamu: Fix PAMU boot crash
Commit 68a17f0be6fe introduced an initialization order problem, where devices are linked against an iommu which is not yet initialized. Fix it by initializing the iommu-device before the iommu-ops are registered against the bus. Reported-by: Michael Ellerman <mpe@ellerman.id.au> Fixes: 68a17f0be6fe ('iommu/pamu: Add support for generic iommu-device') Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/fsl_pamu.c')
-rw-r--r--drivers/iommu/fsl_pamu.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index 9238a85de53e..9ee8e9e161f5 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -44,8 +44,6 @@ static struct paace *spaact;
static bool probed; /* Has PAMU been probed? */
-struct iommu_device pamu_iommu; /* IOMMU core code handle */
-
/*
* Table for matching compatible strings, for device tree
* guts node, for QorIQ SOCs.
@@ -1156,18 +1154,6 @@ static int fsl_pamu_probe(struct platform_device *pdev)
if (ret)
goto error_genpool;
- ret = iommu_device_sysfs_add(&pamu_iommu, dev, NULL, "iommu0");
- if (ret)
- goto error_genpool;
-
- iommu_device_set_ops(&pamu_iommu, &fsl_pamu_ops);
-
- ret = iommu_device_register(&pamu_iommu);
- if (ret) {
- dev_err(dev, "Can't register iommu device\n");
- goto error_sysfs;
- }
-
pamubypenr = in_be32(&guts_regs->pamubypenr);
for (pamu_reg_off = 0, pamu_counter = 0x80000000; pamu_reg_off < size;
@@ -1195,9 +1181,6 @@ static int fsl_pamu_probe(struct platform_device *pdev)
return 0;
-error_sysfs:
- iommu_device_sysfs_remove(&pamu_iommu);
-
error_genpool:
gen_pool_destroy(spaace_pool);