Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
Revert "perf/smmuv3: Allow sharing MMIO registers with the SMMU driver"
Browse files Browse the repository at this point in the history
This reverts commit 779bed7.

see: #152
  • Loading branch information
adamliyi committed Mar 18, 2022
1 parent 80d0545 commit d20bee2
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions drivers/perf/arm_smmuv3_pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,32 +758,19 @@ static int smmu_pmu_probe(struct platform_device *pdev)
.capabilities = PERF_PMU_CAP_NO_EXCLUDE,
};

/*
* If the PMCG registers are embedded into the SMMU regions, the
* resources have to be shared with the SMMU driver. Use ioremap()
* rather than ioremap_resource() to avoid conflicts.
*/
res_0 = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res_0)
return -ENXIO;

smmu_pmu->reg_base = devm_ioremap(dev, res_0->start,
resource_size(res_0));
if (!smmu_pmu->reg_base)
return -ENOMEM;
smmu_pmu->reg_base = devm_ioremap_resource(dev, res_0);
if (IS_ERR(smmu_pmu->reg_base))
return PTR_ERR(smmu_pmu->reg_base);

cfgr = readl_relaxed(smmu_pmu->reg_base + SMMU_PMCG_CFGR);

/* Determine if page 1 is present */
if (cfgr & SMMU_PMCG_CFGR_RELOC_CTRS) {
res_1 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (!res_1)
return -ENXIO;

smmu_pmu->reloc_base = devm_ioremap(dev, res_1->start,
resource_size(res_1));
if (!smmu_pmu->reloc_base)
return -ENOMEM;
smmu_pmu->reloc_base = devm_ioremap_resource(dev, res_1);
if (IS_ERR(smmu_pmu->reloc_base))
return PTR_ERR(smmu_pmu->reloc_base);
} else {
smmu_pmu->reloc_base = smmu_pmu->reg_base;
}
Expand Down

0 comments on commit d20bee2

Please sign in to comment.