Skip to content

Commit ef86b2c

Browse files
ashishmhetre8krzk
authored andcommitted
memory: tegra: Remove clients SID override programming
On newer Tegra releases, early boot SID override programming and SID override programming during resume is handled by bootloader. In the function tegra186_mc_program_sid() which is getting removed, SID override register of all clients is written without checking if secure firmware has allowed write on it or not. If write is disabled by secure firmware then it can lead to errors coming from secure firmware and hang in kernel boot. Also, SID override is programmed on-demand during probe_finalize() call of IOMMU which is done in tegra186_mc_client_sid_override() in this same file. This function does it correctly by checking if write is permitted on SID override register. It also checks if SID override register is already written with correct value and skips re-writing it in that case. Fixes: 393d66f ("memory: tegra: Implement SID override programming") Signed-off-by: Ashish Mhetre <[email protected]> Acked-by: Thierry Reding <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Krzysztof Kozlowski <[email protected]>
1 parent 827e092 commit ef86b2c

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

drivers/memory/tegra/tegra186.c

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,6 @@
2222
#define MC_SID_STREAMID_SECURITY_WRITE_ACCESS_DISABLED BIT(16)
2323
#define MC_SID_STREAMID_SECURITY_OVERRIDE BIT(8)
2424

25-
static void tegra186_mc_program_sid(struct tegra_mc *mc)
26-
{
27-
unsigned int i;
28-
29-
for (i = 0; i < mc->soc->num_clients; i++) {
30-
const struct tegra_mc_client *client = &mc->soc->clients[i];
31-
u32 override, security;
32-
33-
override = readl(mc->regs + client->regs.sid.override);
34-
security = readl(mc->regs + client->regs.sid.security);
35-
36-
dev_dbg(mc->dev, "client %s: override: %x security: %x\n",
37-
client->name, override, security);
38-
39-
dev_dbg(mc->dev, "setting SID %u for %s\n", client->sid,
40-
client->name);
41-
writel(client->sid, mc->regs + client->regs.sid.override);
42-
43-
override = readl(mc->regs + client->regs.sid.override);
44-
security = readl(mc->regs + client->regs.sid.security);
45-
46-
dev_dbg(mc->dev, "client %s: override: %x security: %x\n",
47-
client->name, override, security);
48-
}
49-
}
50-
5125
static int tegra186_mc_probe(struct tegra_mc *mc)
5226
{
5327
struct platform_device *pdev = to_platform_device(mc->dev);
@@ -85,8 +59,6 @@ static int tegra186_mc_probe(struct tegra_mc *mc)
8559
if (err < 0)
8660
return err;
8761

88-
tegra186_mc_program_sid(mc);
89-
9062
return 0;
9163
}
9264

@@ -95,13 +67,6 @@ static void tegra186_mc_remove(struct tegra_mc *mc)
9567
of_platform_depopulate(mc->dev);
9668
}
9769

98-
static int tegra186_mc_resume(struct tegra_mc *mc)
99-
{
100-
tegra186_mc_program_sid(mc);
101-
102-
return 0;
103-
}
104-
10570
#if IS_ENABLED(CONFIG_IOMMU_API)
10671
static void tegra186_mc_client_sid_override(struct tegra_mc *mc,
10772
const struct tegra_mc_client *client,
@@ -173,7 +138,6 @@ static int tegra186_mc_probe_device(struct tegra_mc *mc, struct device *dev)
173138
const struct tegra_mc_ops tegra186_mc_ops = {
174139
.probe = tegra186_mc_probe,
175140
.remove = tegra186_mc_remove,
176-
.resume = tegra186_mc_resume,
177141
.probe_device = tegra186_mc_probe_device,
178142
.handle_irq = tegra30_mc_handle_irq,
179143
};

0 commit comments

Comments
 (0)