All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lazar, Lijo" <lijo.lazar@amd.com>
To: chen gong <curry.gong@amd.com>, amd-gfx@lists.freedesktop.org
Cc: Alexander.Deucher@amd.com, James.Zhu@amd.com, leo.liu@amd.com,
	evan.quan@amd.com
Subject: Re: [PATCH] drm/amdgpu: When the VCN(1.0) block is suspended, powergating is explicitly enabled
Date: Fri, 10 Dec 2021 17:55:19 +0530	[thread overview]
Message-ID: <eb4b71d5-9e08-eac2-43a6-55c82467faca@amd.com> (raw)
In-Reply-To: <1639136511-6357-1-git-send-email-curry.gong@amd.com>



On 12/10/2021 5:11 PM, chen gong wrote:
> Play a video on the raven (or PCO, raven2) platform, and then do the S3
> test. When resume, the following error will be reported:
> 
> amdgpu 0000:02:00.0: [drm:amdgpu_ring_test_helper [amdgpu]] *ERROR* ring
> vcn_dec test failed (-110)
> [drm:amdgpu_device_ip_resume_phase2 [amdgpu]] *ERROR* resume of IP block
> <vcn_v1_0> failed -110
> amdgpu 0000:02:00.0: amdgpu: amdgpu_device_ip_resume failed (-110).
> PM: dpm_run_callback(): pci_pm_resume+0x0/0x90 returns -110
> 
> [why]
> When playing the video: The power state flag of the vcn block is set to
> POWER_STATE_ON.
> 
> When doing suspend: There is no change to the power state flag of the
> vcn block, it is still POWER_STATE_ON.
> 
> When doing resume: Need to open the power gate of the vcn block and set
> the power state flag of the VCN block to POWER_STATE_ON.
> But at this time, the power state flag of the vcn block is already
> POWER_STATE_ON. The power status flag check in the "8f2cdef drm/amd/pm:
> avoid duplicate powergate/ungate setting" patch will return the
> amdgpu_dpm_set_powergating_by_smu function directly.
> As a result, the gate of the power was not opened, causing the
> subsequent ring test to fail.
> 
> [how]
> In the suspend function of the vcn block, explicitly change the power
> state flag of the vcn block to POWER_STATE_OFF.
> 
> Signed-off-by: chen gong <curry.gong@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
> index d54d720..d73676b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
> @@ -246,6 +246,13 @@ static int vcn_v1_0_suspend(void *handle)
>   {
>   	int r;
>   	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> +	bool cancel_success;
> +
> +	cancel_success = cancel_delayed_work_sync(&adev->vcn.idle_work);
> +	if (cancel_success) {
> +		if (adev->pm.dpm_enabled)
> +			amdgpu_dpm_enable_uvd(adev, false);
> +	}
>   

Probably this is a common issue. Can you try moving this to 
amdgpu_vcn_suspend?

if (adev->pm.dpm_enabled)
    amdgpu_device_ip_set_powergating_state(adev, 
AMD_IP_BLOCK_TYPE_VCN,AMD_PG_STATE_GATE);

Call this after cancel_delayed_work_sync. Shouldn't have any effect if 
idle work already put it in PG state. Evan, what do you think?

Thanks,
Lijo

>   	r = vcn_v1_0_hw_fini(adev);
>   	if (r)
> 

  reply	other threads:[~2021-12-10 12:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10 11:41 [PATCH] drm/amdgpu: When the VCN(1.0) block is suspended, powergating is explicitly enabled chen gong
2021-12-10 12:25 ` Lazar, Lijo [this message]
2021-12-10 16:19   ` Quan, Evan
2021-12-10 21:17     ` James Zhu
2021-12-10 16:06 ` Quan, Evan
2021-12-10 19:50   ` Alex Deucher
2021-12-10 21:07 ` James Zhu
2021-12-13  8:55   ` Gong, Curry
2021-12-13 10:09     ` Quan, Evan
2021-12-13 13:39     ` James Zhu
2021-12-14  5:59       ` Quan, Evan
2021-12-16 15:38         ` Alex Deucher
2021-12-17  1:43           ` Quan, Evan
2021-12-17  2:02             ` 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=eb4b71d5-9e08-eac2-43a6-55c82467faca@amd.com \
    --to=lijo.lazar@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=James.Zhu@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=curry.gong@amd.com \
    --cc=evan.quan@amd.com \
    --cc=leo.liu@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.