Skip to content

Commit 45a81df

Browse files
digetxthierryreding
authored andcommitted
memory: tegra: Register SMMU after MC driver became ready
Memory Controller driver invokes SMMU driver registration and MC's registers mapping is shared with SMMU. This mapping goes away if MC driver probing fails after SMMU registration. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
1 parent 273d760 commit 45a81df

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

  • drivers/memory/tegra

‎drivers/memory/tegra/mc.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -672,15 +672,6 @@ static int tegra_mc_probe(struct platform_device *pdev)
672672
return err;
673673
}
674674

675-
if (IS_ENABLED(CONFIG_TEGRA_IOMMU_SMMU)) {
676-
mc->smmu = tegra_smmu_probe(&pdev->dev, mc->soc->smmu, mc);
677-
if (IS_ERR(mc->smmu)) {
678-
dev_err(&pdev->dev, "failed to probe SMMU: %ld\n",
679-
PTR_ERR(mc->smmu));
680-
return PTR_ERR(mc->smmu);
681-
}
682-
}
683-
684675
err = tegra_mc_reset_setup(mc);
685676
if (err < 0) {
686677
dev_err(&pdev->dev, "failed to register reset controller: %d\n",
@@ -706,6 +697,15 @@ static int tegra_mc_probe(struct platform_device *pdev)
706697
return err;
707698
}
708699

700+
if (IS_ENABLED(CONFIG_TEGRA_IOMMU_SMMU)) {
701+
mc->smmu = tegra_smmu_probe(&pdev->dev, mc->soc->smmu, mc);
702+
if (IS_ERR(mc->smmu)) {
703+
dev_err(&pdev->dev, "failed to probe SMMU: %ld\n",
704+
PTR_ERR(mc->smmu));
705+
return PTR_ERR(mc->smmu);
706+
}
707+
}
708+
709709
return 0;
710710
}
711711

0 commit comments

Comments
 (0)