From: Sui Jingfeng <suijingfeng@loongson.cn>
To: Lucas Stach <l.stach@pengutronix.de>, etnaviv@lists.freedesktop.org
Cc: Russell King <linux+etnaviv@armlinux.org.uk>,
dri-devel@lists.freedesktop.org, kernel@pengutronix.de,
patchwork-lst@pengutronix.de
Subject: Re: drm/etnaviv: disable MLCG and pulse eater on GPU reset
Date: Wed, 14 Jun 2023 00:42:17 +0800 [thread overview]
Message-ID: <b154bee4-9129-8f21-06d4-d86e3b5234f7@loongson.cn> (raw)
In-Reply-To: <20230607125841.3518385-1-l.stach@pengutronix.de>
Hi, Lucas
I love your patch, perhaps something to improve:
The MLCG stand for "Module Level Clock Gating",
without reading the commit message, I guess there may have people don't
know its meaning.
There are still more thing in this patch can only be understand relay on
guessing... :-)
But drm/etnaviv drvier still works with this patch applied, so
On 2023/6/7 20:58, Lucas Stach wrote:
> Module level clock gating and the pulse eater might interfere with
> the GPU reset, as they both have the potential to stop the clock
> and thus reset propagation to parts of the GPU.
>
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Tested-by: Sui Jingfeng <suijingfeng@loongson.cn>
> ---
> I'm not aware of any cases where this would have been an issue, but
> it is what the downstream driver does and fundametally seems like
> the right thing to do.
> ---
> drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> index de8c9894967c..41aab1aa330b 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> @@ -505,8 +505,19 @@ static int etnaviv_hw_reset(struct etnaviv_gpu *gpu)
> timeout = jiffies + msecs_to_jiffies(1000);
>
> while (time_is_after_jiffies(timeout)) {
> - /* enable clock */
> unsigned int fscale = 1 << (6 - gpu->freq_scale);
> + u32 pulse_eater = 0x01590880;
> +
> + /* disable clock gating */
> + gpu_write_power(gpu, VIVS_PM_POWER_CONTROLS, 0x0);
> +
> + /* disable pulse eater */
> + pulse_eater |= BIT(17);
> + gpu_write_power(gpu, VIVS_PM_PULSE_EATER, pulse_eater);
> + pulse_eater |= BIT(0);
> + gpu_write_power(gpu, VIVS_PM_PULSE_EATER, pulse_eater);
> +
> + /* enable clock */
> control = VIVS_HI_CLOCK_CONTROL_FSCALE_VAL(fscale);
> etnaviv_gpu_load_clock(gpu, control);
>
--
Jingfeng
next prev parent reply other threads:[~2023-06-13 16:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-07 12:58 [PATCH] drm/etnaviv: disable MLCG and pulse eater on GPU reset Lucas Stach
2023-06-13 13:30 ` Christian Gmeiner
2023-06-13 16:42 ` Sui Jingfeng [this message]
2023-06-14 7:45 ` Lucas Stach
2023-06-14 17:49 ` Sui Jingfeng
2023-06-15 9:14 ` Lucas Stach
2023-06-15 9:22 ` Sui Jingfeng
2023-06-14 16:46 ` [PATCH] " Russell King (Oracle)
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=b154bee4-9129-8f21-06d4-d86e3b5234f7@loongson.cn \
--to=suijingfeng@loongson.cn \
--cc=dri-devel@lists.freedesktop.org \
--cc=etnaviv@lists.freedesktop.org \
--cc=kernel@pengutronix.de \
--cc=l.stach@pengutronix.de \
--cc=linux+etnaviv@armlinux.org.uk \
--cc=patchwork-lst@pengutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).