[PATCH V3 0/3] memory: tegra: Restore MC state on system resume

Ashish Mhetre posted 3 patches 1 month, 2 weeks ago
drivers/memory/tegra/mc.c       | 37 ++++++++++++++++++++++++++-------
drivers/memory/tegra/tegra186.c |  4 +---
include/soc/tegra/mc.h          |  2 +-
3 files changed, 32 insertions(+), 11 deletions(-)
[PATCH V3 0/3] memory: tegra: Restore MC state on system resume
Posted by Ashish Mhetre 1 month, 2 weeks ago
The tegra-mc platform driver does not register any dev_pm_ops, so the
SoC-specific ->resume() is never invoked (e.g. tegra186_mc_resume) on
system wake. On Tegra186 and later this means MC client Stream-ID
override registers are not reprogrammed, and clients behind the ARM
SMMU fault on the first DMA after resume.

Patch 1 makes the SoC-level ->resume() callback return void, since the
sole implementation never fails. This simplifies the wrapper added in
the next patch.

Patch 2 registers a dev_pm_ops on the tegra-mc driver and routes the
system resume callback into mc->soc->ops->resume() so the existing SID
restore path runs again on wake.

Patch 3 factors the existing intmask programming out of
tegra_mc_probe() into a helper and reuses it from the resume path so
the MC interrupt mask state, which is also lost across SC7, is
restored on wake too.

Changes in V3:
- New patch 1 to change the SoC ->resume() callback return type from
  int to void, so the wrapper in patch 2 does not need to deal with
  an err value that is always 0. (Jon Hunter)
- Patches 2 and 3 simplified accordingly, no other functional change.

Changes in V2:
- Split the original single patch into two - register the PM ops and
  reprogram the MC interrupt masks on resume.

Ashish Mhetre (3):
  memory: tegra: Make ->resume() callback return void
  memory: tegra: Wire up system sleep PM ops
  memory: tegra: Restore MC interrupt masks on resume

 drivers/memory/tegra/mc.c       | 37 ++++++++++++++++++++++++++-------
 drivers/memory/tegra/tegra186.c |  4 +---
 include/soc/tegra/mc.h          |  2 +-
 3 files changed, 32 insertions(+), 11 deletions(-)

-- 
2.50.1
Re: [PATCH V3 0/3] memory: tegra: Restore MC state on system resume
Posted by Krzysztof Kozlowski 1 month, 1 week ago
On Thu, 30 Apr 2026 09:51:59 +0000, Ashish Mhetre wrote:
> The tegra-mc platform driver does not register any dev_pm_ops, so the
> SoC-specific ->resume() is never invoked (e.g. tegra186_mc_resume) on
> system wake. On Tegra186 and later this means MC client Stream-ID
> override registers are not reprogrammed, and clients behind the ARM
> SMMU fault on the first DMA after resume.
> 
> Patch 1 makes the SoC-level ->resume() callback return void, since the
> sole implementation never fails. This simplifies the wrapper added in
> the next patch.
> 
> [...]

Applied, thanks!

[1/3] memory: tegra: Make ->resume() callback return void
      https://git.kernel.org/krzk/linux-mem-ctrl/c/4f42beeb9796e24e8009c46d1a2d676803e5ab24
[2/3] memory: tegra: Wire up system sleep PM ops
      https://git.kernel.org/krzk/linux-mem-ctrl/c/2411c8d1e3e09910e94bab0d0a2c071fbc8a9e7b
[3/3] memory: tegra: Restore MC interrupt masks on resume
      https://git.kernel.org/krzk/linux-mem-ctrl/c/35934fd08d17071c5ae0e99b95258f61f0cff763

Best regards,
-- 
Krzysztof Kozlowski <krzk@kernel.org>
Re: [PATCH V3 0/3] memory: tegra: Restore MC state on system resume
Posted by Jon Hunter 1 month, 2 weeks ago
On 30/04/2026 10:51, Ashish Mhetre wrote:
> The tegra-mc platform driver does not register any dev_pm_ops, so the
> SoC-specific ->resume() is never invoked (e.g. tegra186_mc_resume) on
> system wake. On Tegra186 and later this means MC client Stream-ID
> override registers are not reprogrammed, and clients behind the ARM
> SMMU fault on the first DMA after resume.
> 
> Patch 1 makes the SoC-level ->resume() callback return void, since the
> sole implementation never fails. This simplifies the wrapper added in
> the next patch.
> 
> Patch 2 registers a dev_pm_ops on the tegra-mc driver and routes the
> system resume callback into mc->soc->ops->resume() so the existing SID
> restore path runs again on wake.
> 
> Patch 3 factors the existing intmask programming out of
> tegra_mc_probe() into a helper and reuses it from the resume path so
> the MC interrupt mask state, which is also lost across SC7, is
> restored on wake too.
> 
> Changes in V3:
> - New patch 1 to change the SoC ->resume() callback return type from
>    int to void, so the wrapper in patch 2 does not need to deal with
>    an err value that is always 0. (Jon Hunter)
> - Patches 2 and 3 simplified accordingly, no other functional change.
> 
> Changes in V2:
> - Split the original single patch into two - register the PM ops and
>    reprogram the MC interrupt masks on resume.
> 
> Ashish Mhetre (3):
>    memory: tegra: Make ->resume() callback return void
>    memory: tegra: Wire up system sleep PM ops
>    memory: tegra: Restore MC interrupt masks on resume
> 
>   drivers/memory/tegra/mc.c       | 37 ++++++++++++++++++++++++++-------
>   drivers/memory/tegra/tegra186.c |  4 +---
>   include/soc/tegra/mc.h          |  2 +-
>   3 files changed, 32 insertions(+), 11 deletions(-)
> 


For the series ...

Reviewed-by: Jon Hunter <jonathanh@nvidia.com>

Thanks!
Jon

-- 
nvpublic