public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ashish Mhetre <amhetre@nvidia.com>
To: Jon Hunter <jonathanh@nvidia.com>,
	krzk@kernel.org, thierry.reding@kernel.org
Cc: ketanp@nvidia.com, linux-kernel@vger.kernel.org,
	linux-tegra@vger.kernel.org
Subject: Re: [PATCH V2 1/2] memory: tegra: Wire up system sleep PM ops
Date: Thu, 30 Apr 2026 15:09:29 +0530	[thread overview]
Message-ID: <f60904dd-1337-42a5-9759-d3282c99f502@nvidia.com> (raw)
In-Reply-To: <536e3912-9351-4825-b25b-776e4cd4c748@nvidia.com>



On 4/30/2026 2:09 PM, Jon Hunter wrote:
>
>
> On 30/04/2026 08:09, Ashish Mhetre wrote:
>> The tegra-mc platform driver does not register any dev_pm_ops, so the
>> 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.
>>
>> Register a dev_pm_ops on the tegra-mc driver and route the system
>> resume callback into mc->soc->ops->resume() so the existing SID
>> restore path runs again on wake.
>>
>> No suspend callback is needed as the resume path reprograms all MC
>> state from the static SoC tables, so there is nothing to save.
>>
>> Fixes: fe3b082a6eb8 ("memory: tegra: Add SID override programming for 
>> MC clients")
>> Signed-off-by: Ashish Mhetre <amhetre@nvidia.com>
>> ---
>>   drivers/memory/tegra/mc.c | 14 ++++++++++++++
>>   1 file changed, 14 insertions(+)
>>
>> diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c
>> index d620660da331..343ac0018eba 100644
>> --- a/drivers/memory/tegra/mc.c
>> +++ b/drivers/memory/tegra/mc.c
>> @@ -13,6 +13,7 @@
>>   #include <linux/of.h>
>>   #include <linux/of_platform.h>
>>   #include <linux/platform_device.h>
>> +#include <linux/pm.h>
>>   #include <linux/slab.h>
>>   #include <linux/sort.h>
>>   #include <linux/tegra-icc.h>
>> @@ -1010,10 +1011,23 @@ static void tegra_mc_sync_state(struct device 
>> *dev)
>>           icc_sync_state(dev);
>>   }
>>   +static int tegra_mc_resume(struct device *dev)
>> +{
>> +    struct tegra_mc *mc = dev_get_drvdata(dev);
>> +
>> +    if (mc->soc->ops && mc->soc->ops->resume)
>> +        return mc->soc->ops->resume(mc);
>
> I noticed that the tegra186_mc_resume never fails and always returns 
> 0. Given that this is the only resume handler, it seem that we should 
> change this to a void return type and then we can avoid the extra 
> return here. This also simplifies the next patch. So may be we should 
> add one more patch to change the return type for this resume callback.
>
> If we ever need to return a error code in the future we can add back, 
> but if we don't need it now, then I don't see why we should keep this.
>
> Jon
>

Okay, I'll update the return-type in new patch and send V3.

Thanks,
Ashish Mhetre

  reply	other threads:[~2026-04-30  9:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-30  7:09 [PATCH V2 0/2] memory: tegra: Restore MC state on system resume Ashish Mhetre
2026-04-30  7:09 ` [PATCH V2 1/2] memory: tegra: Wire up system sleep PM ops Ashish Mhetre
2026-04-30  8:39   ` Jon Hunter
2026-04-30  9:39     ` Ashish Mhetre [this message]
2026-04-30  7:09 ` [PATCH V2 2/2] memory: tegra: Restore MC interrupt masks on resume Ashish Mhetre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f60904dd-1337-42a5-9759-d3282c99f502@nvidia.com \
    --to=amhetre@nvidia.com \
    --cc=jonathanh@nvidia.com \
    --cc=ketanp@nvidia.com \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=thierry.reding@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox