public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] memory: tegra: Protect SID override call under CONFIG_IOMMU_API
@ 2023-12-05  6:00 Ashish Mhetre
  2023-12-05  6:55 ` Randy Dunlap
  2023-12-06 10:26 ` Krzysztof Kozlowski
  0 siblings, 2 replies; 3+ messages in thread
From: Ashish Mhetre @ 2023-12-05  6:00 UTC (permalink / raw)
  To: amhetre, krzysztof.kozlowski, thierry.reding, jonathanh
  Cc: linux-kernel, linux-tegra, rdunlap, sfr

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>
---
 drivers/memory/tegra/tegra186.c | 2 ++
 1 file changed, 2 insertions(+)

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;
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] memory: tegra: Protect SID override call under CONFIG_IOMMU_API
  2023-12-05  6:00 [PATCH] memory: tegra: Protect SID override call under CONFIG_IOMMU_API Ashish Mhetre
@ 2023-12-05  6:55 ` Randy Dunlap
  2023-12-06 10:26 ` Krzysztof Kozlowski
  1 sibling, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2023-12-05  6:55 UTC (permalink / raw)
  To: Ashish Mhetre, krzysztof.kozlowski, thierry.reding, jonathanh
  Cc: linux-kernel, linux-tegra, sfr



On 12/4/23 22:00, Ashish Mhetre wrote:
> 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

Thanks.

> ---
>  drivers/memory/tegra/tegra186.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> 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;
>  }

-- 
~Randy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] memory: tegra: Protect SID override call under CONFIG_IOMMU_API
  2023-12-05  6:00 [PATCH] memory: tegra: Protect SID override call under CONFIG_IOMMU_API Ashish Mhetre
  2023-12-05  6:55 ` Randy Dunlap
@ 2023-12-06 10:26 ` Krzysztof Kozlowski
  1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2023-12-06 10:26 UTC (permalink / raw)
  To: thierry.reding, jonathanh, Ashish Mhetre
  Cc: Krzysztof Kozlowski, linux-kernel, linux-tegra, rdunlap, sfr


On Tue, 05 Dec 2023 11:30:45 +0530, Ashish Mhetre wrote:
> 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,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-06 10:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-05  6:00 [PATCH] memory: tegra: Protect SID override call under CONFIG_IOMMU_API Ashish Mhetre
2023-12-05  6:55 ` Randy Dunlap
2023-12-06 10:26 ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox