Re: [PATCH v2 1/2] drm/amdgpu: enhance amdgpu_vcn_suspend

2021-05-17 Thread Leo Liu
Zhu *From:* Liu, Leo *Sent:* Monday, May 17, 2021 2:07 PM *To:* Zhu, James ; Zhu, James ; amd-gfx@lists.freedesktop.org *Subject:* Re: [PATCH v2 1/2] drm/amdgpu: enhance amdgpu_vcn_suspend Definitely, we need to move cancel_delayed_work_sync moved to before power gate. Sh

Re: [PATCH v2 1/2] drm/amdgpu: enhance amdgpu_vcn_suspend

2021-05-17 Thread Leo Liu
,  it just keeps data in memory. Thanks & Best Regards! James Zhu *From:* Liu, Leo *Sent:* Monday, May 17, 2021 2:07 PM *To:* Zhu, James ; Zhu, James ; amd-gfx@lists.freedesktop.org *Subject:* Re: [PATCH v2 1/2] drm/am

Re: [PATCH v2 1/2] drm/amdgpu: enhance amdgpu_vcn_suspend

2021-05-17 Thread Zhu, James
.org Subject: Re: [PATCH v2 1/2] drm/amdgpu: enhance amdgpu_vcn_suspend Definitely, we need to move cancel_delayed_work_sync moved to before power gate. Should "save_bo" be step 4 before power gate ? Regards, Leo On 2021-05-17 1:59 p.m., James Zhu wrote: Then we forgot the propo

Re: [PATCH v2 1/2] drm/amdgpu: enhance amdgpu_vcn_suspend

2021-05-17 Thread Leo Liu
Definitely, we need to move cancel_delayed_work_sync moved to before power gate. Should "save_bo" be step 4 before power gate ? Regards, Leo On 2021-05-17 1:59 p.m., James Zhu wrote: Then we forgot the proposal I provided before. I think the below seq may fixed the race condition issue

Re: [PATCH v2 1/2] drm/amdgpu: enhance amdgpu_vcn_suspend

2021-05-17 Thread James Zhu
Then we forgot the proposal I provided before. I think the below seq may fixed the race condition issue that we are facing. 1. stop scheduling new jobs     for (i = 0; i < adev->vcn.num_vcn_inst; ++i) {         if (adev->vcn.harvest_config & (1 << i))             continue;         ring =

Re: [PATCH v2 1/2] drm/amdgpu: enhance amdgpu_vcn_suspend

2021-05-17 Thread Leo Liu
On 2021-05-17 12:54 p.m., James Zhu wrote: I am wondering if there are still some jobs kept in the queue, it is lucky to check Yes it's possible, in this case delayed handler is set, so cancelling once is enough. UVD_POWER_STATUS done, but after, fw start a new job that list in the

Re: [PATCH v2 1/2] drm/amdgpu: enhance amdgpu_vcn_suspend

2021-05-17 Thread James Zhu
I am wondering if there are still some jobs kept in the queue, it is lucky to check UVD_POWER_STATUS done, but after, fw start a new job that list in the queue. To handle this situation perfectly, we need add mechanism to suspend fw first. Another case, if it is unlucky, that  vcn fw hung

Re: [PATCH v2 1/2] drm/amdgpu: enhance amdgpu_vcn_suspend

2021-05-17 Thread Leo Liu
On 2021-05-17 11:52 a.m., James Zhu wrote: During vcn suspends, stop ring continue to receive new requests, and try to wait for all vcn jobs to finish gracefully. v2: Forced powering gate vcn hardware after few wainting retry. Signed-off-by: James Zhu ---

[PATCH v2 1/2] drm/amdgpu: enhance amdgpu_vcn_suspend

2021-05-17 Thread James Zhu
During vcn suspends, stop ring continue to receive new requests, and try to wait for all vcn jobs to finish gracefully. v2: Forced powering gate vcn hardware after few wainting retry. Signed-off-by: James Zhu --- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 22 +- 1 file