From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Abel Vesa <abel.vesa@oss.qualcomm.com>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Abel Vesa <abelvesa@kernel.org>
Cc: Maulik Shah <maulik.shah@oss.qualcomm.com>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] soc: qcom: rpmh-rsc: Write the sleep and wake sets again after hibernation
Date: Thu, 26 Nov 2026 15:39:07 +0100 [thread overview]
Message-ID: <72c567ad-d321-42ca-8b7a-f6be442daefa@oss.qualcomm.com> (raw)
In-Reply-To: <20261120-soc-qcom-rpmh-rsc-restore-hibernation-v1-1-3ffd45c9c55a@oss.qualcomm.com>
On 11/20/26 4:08 PM, Abel Vesa wrote:
> The sleep and wake TCSes are written by rpmh_flush() right before the
> last CPU of the RSC power domain goes down, but only when the cached
> votes changed since the last flush. A hibernation image is restored by
> another kernel, which used the TCSes for its own votes. The cache of the
> restored kernel still says the TCSes hold its votes, so it never writes
> them again and every power collapse after the restore applies the sleep
> and wake votes of the kernel that loaded the image, until one of the
> cached votes happens to change.
>
> Mark the cache dirty when restoring from hibernation, so that the next
> power collapse writes the sleep and wake sets of the restored kernel.
>
> Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
> ---
> drivers/soc/qcom/rpmh-rsc.c | 23 +++++++++++++++++++++++
> 1 file changed, 23 insertions(+)
>
> diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
> index 02b74c510c3f..3f89857d9d22 100644
> --- a/drivers/soc/qcom/rpmh-rsc.c
> +++ b/drivers/soc/qcom/rpmh-rsc.c
> @@ -1169,12 +1169,35 @@ static const struct of_device_id rpmh_drv_match[] = {
> };
> MODULE_DEVICE_TABLE(of, rpmh_drv_match);
>
> +/*
> + * A hibernation image is restored by another kernel, which filled the sleep
> + * and wake TCSes with its own votes. Our cache still says they hold ours, so
> + * rpmh_flush() would never write them again and the next power collapse would
> + * use what the other kernel left behind. Write them again before that.
Should we fully drop that cache as we go towards hibernation?
(perhaps at a point when we're sure it isn't going to fail..)
IIUC we're going to have some votes that have been cast by drivers
that need them and then some leftover ones
Konrad
prev parent reply other threads:[~2026-11-26 14:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 15:08 Abel Vesa
2026-11-26 14:39 ` Konrad Dybcio [this message]
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=72c567ad-d321-42ca-8b7a-f6be442daefa@oss.qualcomm.com \
--to=konrad.dybcio@oss.qualcomm.com \
--cc=abel.vesa@oss.qualcomm.com \
--cc=abelvesa@kernel.org \
--cc=andersson@kernel.org \
--cc=konradybcio@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maulik.shah@oss.qualcomm.com \
/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
all inboxes | Powered by JetHome®