memory: tegra: Skip SID programming if SID registers aren't set
authorAshish Mhetre <amhetre@nvidia.com>
Tue, 7 Nov 2023 11:27:13 +0000 (16:57 +0530)
committerKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tue, 21 Nov 2023 09:09:28 +0000 (10:09 +0100)
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>
Link: https://lore.kernel.org/r/20231107112713.21399-2-amhetre@nvidia.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
drivers/memory/tegra/tegra186.c

index 8203f0db1350bd2a6fe7080cfb9c4e888a7da494..d1f1dfb427161ec265791e79feb7cb2a205651c5 100644 (file)
@@ -75,6 +75,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) {
                /*