From: Dirk Gouders <dirk@gouders.net>
To: Evan Quan <evan.quan@amd.com>
Cc: Alexander.Deucher@amd.com, Ray.Huang@amd.com,
amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/amd/pm: setup APU dpm clock table in SMU HW initialization
Date: Wed, 30 Sep 2020 11:53:31 +0200 [thread overview]
Message-ID: <gha6x78uas.fsf@gouders.net> (raw)
In-Reply-To: <20200930040756.23559-1-evan.quan@amd.com> (Evan Quan's message of "Wed, 30 Sep 2020 12:07:56 +0800")
Evan Quan <evan.quan@amd.com> writes:
> As the dpm clock table is needed during DC HW initialization.
> And that (DC HW initialization) comes before smu_late_init()
> where current APU dpm clock table setup is performed. So, NULL
> pointer dereference will be triggered. By moving APU dpm clock
> table setup to smu_hw_init(), this can be avoided.
Thanks for the quick response. I tested the patch and it fixes the call
trace I initially reportet (#1 in the table below). #2 is unaffected by
this patch. I could try to bisect it as well bud did not do it, so far.
Probably, I caused some confusion in the original thread and I will try to
order it a bit. What I noticed is:
with amdgpu.discovery value | noticed issue
===============================================================
1) unset or "1" | call trace because of
| assert(0) in rn_clk_mgr_helper_populate_bw_params()
-------------------------------+-------------------------------
2) 0 | NULL pointer dereference in soc15_set_ip_blocks()
This patch fixes #1, i.e. avoids the assert() in following code in
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c
for (i = PP_SMU_NUM_FCLK_DPM_LEVELS - 1; i >= 0; i--) {
if (clock_table->FClocks[i].Freq != 0 && clock_table->FClocks[i].Vol != 0) {
j = i;
break;
}
}
if (j == -1) {
/* clock table is all 0s, just use our own hardcode */
ASSERT(0);
return;
}
To me, the commit message sounds as if the patch fixes #2 whereas it
really is #1 that gets fixed. I also wonder if we probably want a
fixes-line for completeness:
Fixes: 02cf91c113ea (drm/amd/powerplay: postpone operations not required for hw setup to late_init)
Dirk
> Change-Id: I2bb1f9ba26f9c8820c08241da62f7be64ab75840
> Signed-off-by: Evan Quan <evan.quan@amd.com>
> Reported-by: Dirk Gouders <dirk@gouders.net>
> ---
> drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> index f46cf9ea355e..8f6045def272 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> @@ -482,17 +482,6 @@ static int smu_late_init(void *handle)
> return ret;
> }
>
> - /*
> - * Set initialized values (get from vbios) to dpm tables context such as
> - * gfxclk, memclk, dcefclk, and etc. And enable the DPM feature for each
> - * type of clks.
> - */
> - ret = smu_set_default_dpm_table(smu);
> - if (ret) {
> - dev_err(adev->dev, "Failed to setup default dpm clock tables!\n");
> - return ret;
> - }
> -
> ret = smu_populate_umd_state_clk(smu);
> if (ret) {
> dev_err(adev->dev, "Failed to populate UMD state clocks!\n");
> @@ -1021,6 +1010,17 @@ static int smu_smc_hw_setup(struct smu_context *smu)
> return ret;
> }
>
> + /*
> + * Set initialized values (get from vbios) to dpm tables context such as
> + * gfxclk, memclk, dcefclk, and etc. And enable the DPM feature for each
> + * type of clks.
> + */
> + ret = smu_set_default_dpm_table(smu);
> + if (ret) {
> + dev_err(adev->dev, "Failed to setup default dpm clock tables!\n");
> + return ret;
> + }
> +
> ret = smu_notify_display_change(smu);
> if (ret)
> return ret;
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2020-09-30 13:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-30 4:07 [PATCH] drm/amd/pm: setup APU dpm clock table in SMU HW initialization Evan Quan
2020-09-30 9:53 ` Dirk Gouders [this message]
2020-09-30 10:42 ` Nirmoy
2020-09-30 13:10 ` Alex Deucher
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=gha6x78uas.fsf@gouders.net \
--to=dirk@gouders.net \
--cc=Alexander.Deucher@amd.com \
--cc=Ray.Huang@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=evan.quan@amd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.