lkml.org 
[lkml]   [2026]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH V2 2/2] memory: tegra: Restore MC interrupt masks on resume
Date
The MC interrupt mask registers lose their state across SC7. Without
re-applying them on resume, MC interrupts that were enabled at probe
remain masked after wake, so any post-resume MC error goes unreported.

Factor the existing intmask programming out of tegra_mc_probe() into
tegra_mc_setup_intmask() and reuse it from the system resume callback
so the mask state is restored on wake.

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

diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c
index 343ac0018eba..ea7b489d666b 100644
--- a/drivers/memory/tegra/mc.c
+++ b/drivers/memory/tegra/mc.c
@@ -911,6 +911,19 @@ static void tegra_mc_num_channel_enabled(struct tegra_mc *mc)
}
}

+static void tegra_mc_setup_intmask(struct tegra_mc *mc)
+{
+ unsigned int i;
+
+ for (i = 0; i < mc->soc->num_intmasks; i++) {
+ if (mc->soc->num_channels)
+ mc_ch_writel(mc, MC_BROADCAST_CHANNEL, mc->soc->intmasks[i].mask,
+ mc->soc->intmasks[i].reg);
+ else
+ mc_writel(mc, mc->soc->intmasks[i].mask, mc->soc->intmasks[i].reg);
+ }
+}
+
static int tegra_mc_probe(struct platform_device *pdev)
{
struct tegra_mc *mc;
@@ -971,13 +984,7 @@ static int tegra_mc_probe(struct platform_device *pdev)
}
}

- for (i = 0; i < mc->soc->num_intmasks; i++) {
- if (mc->soc->num_channels)
- mc_ch_writel(mc, MC_BROADCAST_CHANNEL, mc->soc->intmasks[i].mask,
- mc->soc->intmasks[i].reg);
- else
- mc_writel(mc, mc->soc->intmasks[i].mask, mc->soc->intmasks[i].reg);
- }
+ tegra_mc_setup_intmask(mc);
}

if (mc->soc->reset_ops) {
@@ -1014,9 +1021,15 @@ static void tegra_mc_sync_state(struct device *dev)
static int tegra_mc_resume(struct device *dev)
{
struct tegra_mc *mc = dev_get_drvdata(dev);
+ int err;
+
+ if (mc->soc->ops && mc->soc->ops->resume) {
+ err = mc->soc->ops->resume(mc);
+ if (err)
+ return err;
+ }

- if (mc->soc->ops && mc->soc->ops->resume)
- return mc->soc->ops->resume(mc);
+ tegra_mc_setup_intmask(mc);

return 0;
}
--
2.50.1

\
 
 \ /
  Last update: 2026-04-30 09:11    [W:0.094 / U:0.043 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog