Skip to contentSkip to conversation

memory: tegra: Protect SID override call under CONFIG_IOMMU_API

PATCH Applied Ashish Mhetre 3 participants 3 messages Dec 5, 2023 – Dec 6, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 drivers/memory/tegra/tegra186.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/memory/tegra/tegra186.c +2 -0
index d1f1dfb42716..0ff014a9d3cd 100644
@@ -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;
 }
Signature · 1 line
2.17.1
Acked-by Tested-by on v1 1/1
#1 lore raw
Quoted 8 lines · Ashish Mhetre

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")

Thanks.

Quoted 24 lines
---
 drivers/memory/tegra/tegra186.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/memory/tegra/tegra186.c +2 -0
index d1f1dfb42716..0ff014a9d3cd 100644
@@ -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;
 }
Signature · 1 line
~Randy
#2 lore raw
In reply to Ashish Mhetre
Quoted 8 lines · Ashish Mhetre

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.

[...]

Please remember about crediting people's effort. Applied with proper Reported-by tags.

Applied, thanks!

[1/1] memory: tegra: Protect SID override call under CONFIG_IOMMU_API

      https://git.kernel.org/krzk/linux-mem-ctrl/c/4a23d0f9814c38308dc82b6dbc466666a400b27d

Best regards,

Signature · 1 line
Krzysztof Kozlowski <[email protected]>