Linux Tegra architecture development
 help / color / mirror / Atom feed
* [PATCH 1/2] memory: tegra: Add SID override programming for MC clients
@ 2023-11-07  5:28 Ashish Mhetre
  2023-11-07  5:28 ` [PATCH 2/2] memory: tegra: Skip SID programming if SID registers aren't set Ashish Mhetre
  2023-11-07  9:16 ` [PATCH 1/2] memory: tegra: Add SID override programming for MC clients kernel test robot
  0 siblings, 2 replies; 5+ messages in thread
From: Ashish Mhetre @ 2023-11-07  5:28 UTC (permalink / raw)
  To: krzysztof.kozlowski, thierry.reding, jonathanh, dmitry.osipenko
  Cc: linux-tegra, linux-kernel, Ashish Mhetre

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 ef86b2c2807f ("memory: tegra: Remove
clients SID override programming")'

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

diff --git a/drivers/memory/tegra/tegra186.c b/drivers/memory/tegra/tegra186.c
index 533f85a4b2bd..bd8cecc3cde2 100644
--- a/drivers/memory/tegra/tegra186.c
+++ b/drivers/memory/tegra/tegra186.c
@@ -68,6 +68,19 @@ static void tegra186_mc_remove(struct tegra_mc *mc)
 	of_platform_depopulate(mc->dev);
 }
 
+static int tegra186_mc_resume(struct tegra_mc *mc)
+{
+	unsigned int i;
+
+	for (i = 0; i < mc->soc->num_clients; i++) {
+		const struct tegra_mc_client *client = &mc->soc->clients[i];
+
+		tegra186_mc_client_sid_override(mc, client, client->sid);
+	}
+
+	return 0;
+}
+
 #if IS_ENABLED(CONFIG_IOMMU_API)
 static void tegra186_mc_client_sid_override(struct tegra_mc *mc,
 					    const struct tegra_mc_client *client,
@@ -139,6 +152,7 @@ static int tegra186_mc_probe_device(struct tegra_mc *mc, struct device *dev)
 const struct tegra_mc_ops tegra186_mc_ops = {
 	.probe = tegra186_mc_probe,
 	.remove = tegra186_mc_remove,
+	.resume = tegra186_mc_resume,
 	.probe_device = tegra186_mc_probe_device,
 	.handle_irq = tegra30_mc_handle_irq,
 };
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-11-07 11:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-07  5:28 [PATCH 1/2] memory: tegra: Add SID override programming for MC clients Ashish Mhetre
2023-11-07  5:28 ` [PATCH 2/2] memory: tegra: Skip SID programming if SID registers aren't set Ashish Mhetre
2023-11-07  9:16 ` [PATCH 1/2] memory: tegra: Add SID override programming for MC clients kernel test robot
2023-11-07 11:40   ` Ashish Mhetre
2023-11-07 11:42     ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox