From: Finley Xiao <finley.xiao@rock-chips.com>
To: Jiaxing Hu <gahing@gahingwoo.com>, ulfh@kernel.org, heiko@sntech.de
Cc: sebastian.reichel@collabora.com, shawn.lin@rock-chips.com,
zhangqing@rock-chips.com, linux-pm@vger.kernel.org,
linux-rockchip@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pmdomain: rockchip: do not restore QoS that was never saved
Date: Mon, 2 Nov 2026 14:51:49 +0800 [thread overview]
Message-ID: <b012a73f-1834-471f-982f-84244b863dce@rock-chips.com> (raw)
In-Reply-To: <20261101055633.101309-1-gahing@gahingwoo.com>
在 2026/11/1 13:56, Jiaxing Hu 写道:
> rockchip_pmu_restore_qos() writes back what rockchip_pmu_save_qos() read
> on the last power-off. A domain that was off when it was registered has
> not been powered off by the driver yet, so on its first power-on the
> restore writes the zeroed save array over the QoS reset values.
>
> On RK3576 this is the GPU on every boot. Read back after the restore, its
> QoS is all zeros; with this patch it keeps the values it powers up with,
> priority 0x101, mode 3, bandwidth 0x80 and saturation 8.
>
> Only restore after a save. Rockchip's own driver does the same with an
> is_qos_saved flag.
>
> Fixes: 074c6a422d86 ("soc: rockchip: power-domain: support qos save and restore")
> Signed-off-by: Jiaxing Hu <gahing@gahingwoo.com>
> ---
> drivers/pmdomain/rockchip/pm-domains.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/pmdomain/rockchip/pm-domains.c b/drivers/pmdomain/rockchip/pm-domains.c
> index db3879846db6..d1c025bdaa08 100644
> --- a/drivers/pmdomain/rockchip/pm-domains.c
> +++ b/drivers/pmdomain/rockchip/pm-domains.c
> @@ -97,6 +97,7 @@ struct rockchip_pm_domain {
> int num_qos;
> struct regmap **qos_regmap;
> u32 *qos_save_regs[MAX_QOS_REGS_NUM];
> + bool qos_saved;
The fix itself looks correct. One minor nit: the downstream Rockchip
kernel implements the same guard with a flag named `is_qos_saved`
(you already reference it in the commit log). Reusing that exact
name would make it easier to correlate with the vendor tree when
debugging or backporting QoS issues like the RK3576 GPU case.
Reviewed-by: Finley Xiao <finley.xiao@rock-chips.com>
> int num_clks;
> struct clk_bulk_data *clks;
> struct device_node *node;
> @@ -474,6 +475,7 @@ static int rockchip_pmu_save_qos(struct rockchip_pm_domain *pd)
> QOS_EXTCONTROL,
> &pd->qos_save_regs[4][i]);
> }
> + pd->qos_saved = true;
> return 0;
> }
>
> @@ -481,6 +483,14 @@ static int rockchip_pmu_restore_qos(struct rockchip_pm_domain *pd)
> {
> int i;
>
> + /*
> + * A domain that was off when it was registered has nothing saved yet,
> + * and writing the zeroed array would replace the reset values the QoS
> + * registers came up with.
> + */
> + if (!pd->qos_saved)
> + return 0;
> +
> for (i = 0; i < pd->num_qos; i++) {
> regmap_write(pd->qos_regmap[i],
> QOS_PRIORITY,
>
> base-commit: 7649ba73f9e7e1e04d0b46213e39c79ae09dd55c
--
Best regards,
底层平台中心 肖锋(Finley Xiao)
************************************************************************************
瑞芯微电子股份有限公司
Rockchip Electronics Co., Ltd.
福建省福州市铜盘路软件大道89号软件园A区21号楼 350003
No.21 Building, A District, Fuzhou Software Park, Fuzhou, Fujian 350003, P.R. China
Tel: 0591-83991906-8602 Mobile: 18506057603
************************************************************************************
prev parent reply other threads:[~2026-11-02 6:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-01 5:56 Jiaxing Hu
2026-11-01 11:09 ` Shawn Lin
2026-11-02 6:51 ` Finley Xiao [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=b012a73f-1834-471f-982f-84244b863dce@rock-chips.com \
--to=finley.xiao@rock-chips.com \
--cc=gahing@gahingwoo.com \
--cc=heiko@sntech.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=sebastian.reichel@collabora.com \
--cc=shawn.lin@rock-chips.com \
--cc=ulfh@kernel.org \
--cc=zhangqing@rock-chips.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®