public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ashish Mhetre <amhetre@nvidia.com>
To: <amhetre@nvidia.com>, <krzysztof.kozlowski@linaro.org>,
	<thierry.reding@gmail.com>, <jonathanh@nvidia.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-tegra@vger.kernel.org>,
	<rdunlap@infradead.org>, <sfr@canb.auug.org.au>
Subject: [PATCH] memory: tegra: Protect SID override call under CONFIG_IOMMU_API
Date: Tue, 5 Dec 2023 11:30:45 +0530	[thread overview]
Message-ID: <20231205060045.7985-1-amhetre@nvidia.com> (raw)

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


             reply	other threads:[~2023-12-05  6:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-05  6:00 Ashish Mhetre [this message]
2023-12-05  6:55 ` [PATCH] memory: tegra: Protect SID override call under CONFIG_IOMMU_API Randy Dunlap
2023-12-06 10:26 ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231205060045.7985-1-amhetre@nvidia.com \
    --to=amhetre@nvidia.com \
    --cc=jonathanh@nvidia.com \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=sfr@canb.auug.org.au \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox