diff mbox series

[2/2] memory: tegra: Skip SID programming if SID registers aren't set

Message ID 20231107052824.29418-2-amhetre@nvidia.com
State Changes Requested
Headers show
Series [1/2] memory: tegra: Add SID override programming for MC clients | expand

Commit Message

Ashish Mhetre Nov. 7, 2023, 5:28 a.m. UTC
There are few MC clients where SID security and override register
offsets are not specified like "sw_cluster0" in Tegra234. Don't program
SID override for such clients because it leads to access to invalid
addresses.

Signed-off-by: Ashish Mhetre <amhetre@nvidia.com>
---
 drivers/memory/tegra/tegra186.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/drivers/memory/tegra/tegra186.c b/drivers/memory/tegra/tegra186.c
index bd8cecc3cde2..1abbd12dce0b 100644
--- a/drivers/memory/tegra/tegra186.c
+++ b/drivers/memory/tegra/tegra186.c
@@ -88,6 +88,9 @@  static void tegra186_mc_client_sid_override(struct tegra_mc *mc,
 {
 	u32 value, old;
 
+	if (client->regs.sid.security == 0 && client->regs.sid.override == 0)
+		return;
+
 	value = readl(mc->regs + client->regs.sid.security);
 	if ((value & MC_SID_STREAMID_SECURITY_OVERRIDE) == 0) {
 		/*