Skip to content

Commit 568ece5

Browse files
digetxjoergroedel
authored andcommitted
memory: tegra: Do not try to probe SMMU on Tegra20
Tegra20 doesn't have SMMU. Move out checking of the SMMU presence from the SMMU driver into the Memory Controller driver. This change makes code consistent in regards to how GART/SMMU presence checking is performed. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent ce2785a commit 568ece5

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

drivers/iommu/tegra-smmu.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -982,10 +982,6 @@ struct tegra_smmu *tegra_smmu_probe(struct device *dev,
982982
u32 value;
983983
int err;
984984

985-
/* This can happen on Tegra20 which doesn't have an SMMU */
986-
if (!soc)
987-
return NULL;
988-
989985
smmu = devm_kzalloc(dev, sizeof(*smmu), GFP_KERNEL);
990986
if (!smmu)
991987
return ERR_PTR(-ENOMEM);

drivers/memory/tegra/mc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,11 +695,13 @@ static int tegra_mc_probe(struct platform_device *pdev)
695695
dev_err(&pdev->dev, "failed to register reset controller: %d\n",
696696
err);
697697

698-
if (IS_ENABLED(CONFIG_TEGRA_IOMMU_SMMU)) {
698+
if (IS_ENABLED(CONFIG_TEGRA_IOMMU_SMMU) && mc->soc->smmu) {
699699
mc->smmu = tegra_smmu_probe(&pdev->dev, mc->soc->smmu, mc);
700-
if (IS_ERR(mc->smmu))
700+
if (IS_ERR(mc->smmu)) {
701701
dev_err(&pdev->dev, "failed to probe SMMU: %ld\n",
702702
PTR_ERR(mc->smmu));
703+
mc->smmu = NULL;
704+
}
703705
}
704706

705707
if (IS_ENABLED(CONFIG_TEGRA_IOMMU_GART) && !mc->soc->smmu) {

0 commit comments

Comments
 (0)