Skip to content

Commit fe3b082

Browse files
ashishmhetre8krzk
authored andcommitted
memory: tegra: Add SID override programming for MC clients
For some devices the bootloader/firmware may set up the device in bypass. Memory clients like display needs kernel to program SID after resume because bootloader/firmware programs the SID of display device to bypass. In order to make sure that kernel IOMMU mappings for these devices work after resume, add SID override programming support for all memory clients on memory controller resume. This partially reverts 'commit ef86b2c ("memory: tegra: Remove clients SID override programming")' Signed-off-by: Ashish Mhetre <amhetre@nvidia.com> Link: https://lore.kernel.org/r/20231107112713.21399-1-amhetre@nvidia.com Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
1 parent b85ea95 commit fe3b082

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

drivers/memory/tegra/tegra186.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,23 @@ static int tegra186_mc_probe_device(struct tegra_mc *mc, struct device *dev)
136136
return 0;
137137
}
138138

139+
static int tegra186_mc_resume(struct tegra_mc *mc)
140+
{
141+
unsigned int i;
142+
143+
for (i = 0; i < mc->soc->num_clients; i++) {
144+
const struct tegra_mc_client *client = &mc->soc->clients[i];
145+
146+
tegra186_mc_client_sid_override(mc, client, client->sid);
147+
}
148+
149+
return 0;
150+
}
151+
139152
const struct tegra_mc_ops tegra186_mc_ops = {
140153
.probe = tegra186_mc_probe,
141154
.remove = tegra186_mc_remove,
155+
.resume = tegra186_mc_resume,
142156
.probe_device = tegra186_mc_probe_device,
143157
.handle_irq = tegra30_mc_handle_irq,
144158
};

include/soc/tegra/mc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ struct tegra_mc_ops {
162162
*/
163163
int (*probe)(struct tegra_mc *mc);
164164
void (*remove)(struct tegra_mc *mc);
165+
int (*resume)(struct tegra_mc *mc);
165166
irqreturn_t (*handle_irq)(int irq, void *data);
166167
int (*probe_device)(struct tegra_mc *mc, struct device *dev);
167168
};

0 commit comments

Comments
 (0)