summaryrefslogtreecommitdiff
path: root/drivers/memory/tegra
diff options
context:
space:
mode:
authorAshish Mhetre <amhetre@nvidia.com>2023-12-05 09:00:45 +0300
committerKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>2023-12-06 13:22:24 +0300
commit4a23d0f9814c38308dc82b6dbc466666a400b27d (patch)
treef2110d6c88adf6cf7623e7d7502233e71930229c /drivers/memory/tegra
parent0d6c918011ce4764ed277de4726a468b7ffe5fed (diff)
downloadlinux-4a23d0f9814c38308dc82b6dbc466666a400b27d.tar.xz
memory: tegra: Protect SID override call under CONFIG_IOMMU_API
tegra186_mc_client_sid_override() is protected under CONFIG_IOMMU_API. Call to this function is being made from tegra186_mc_resume() without any protection which is leading to build failure when CONFIG_IOMMU_API is not set. Fix this by protecting SID override function call from tegra186_mc_resume() under CONFIG_IOMMU_API. Fixes: fe3b082a6eb8 ("memory: tegra: Add SID override programming for MC clients") Signed-off-by: Ashish Mhetre <amhetre@nvidia.com> Reported-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Randy Dunlap <rdunlap@infradead.org> Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested Link: https://lore.kernel.org/r/20231205060045.7985-1-amhetre@nvidia.com Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Diffstat (limited to 'drivers/memory/tegra')
-rw-r--r--drivers/memory/tegra/tegra186.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/memory/tegra/tegra186.c b/drivers/memory/tegra/tegra186.c
index d1f1dfb42716..0ff014a9d3cd 100644
--- a/drivers/memory/tegra/tegra186.c
+++ b/drivers/memory/tegra/tegra186.c
@@ -141,6 +141,7 @@ static int tegra186_mc_probe_device(struct tegra_mc *mc, struct device *dev)
static int tegra186_mc_resume(struct tegra_mc *mc)
{
+#if IS_ENABLED(CONFIG_IOMMU_API)
unsigned int i;
for (i = 0; i < mc->soc->num_clients; i++) {
@@ -148,6 +149,7 @@ static int tegra186_mc_resume(struct tegra_mc *mc)
tegra186_mc_client_sid_override(mc, client, client->sid);
}
+#endif
return 0;
}