drm/amdgpu/vcn1: add cancel_delayed_work_sync before power gate
Subsystems (2)
PATCH 1/7 drm/amdgpu/vcn1: add cancel_delayed_work_sync before power gate
Add cancel_delayed_work_sync before set power gating state to avoid race condition issue when power gating.
--- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +5 -1
@@ -231,9 +231,13 @@ static int vcn_v1_0_hw_fini(void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; +cancel_delayed_work_sync (&adev->vcn.idle_work); +if ((adev->pg_flags &AMD_PG_SUPPORT_VCN_DPG ) || -RREG32_SOC15 (VCN ,0 , mmUVD_STATUS)) + (adev->vcn.cur_state !=AMD_PG_STATE_GATE && +RREG32_SOC15 (VCN ,0 , mmUVD_STATUS))) {vcn_v1_0_set_powergating_state (adev,AMD_PG_STATE_GATE ); + }return 0 ; }
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/7 drm/amdgpu/vcn2.0: add cancel_delayed_work_sync before power gate
Add cancel_delayed_work_sync before set power gating state to avoid race condition issue when power gating.
--- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +2 -0
@@ -262,6 +262,8 @@ static int vcn_v2_0_hw_fini(void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; +cancel_delayed_work_sync (&adev->vcn.idle_work); +if ((adev->pg_flags &AMD_PG_SUPPORT_VCN_DPG ) || (adev->vcn.cur_state !=AMD_PG_STATE_GATE &&RREG32_SOC15 (VCN ,0 , mmUVD_STATUS)))
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/7 drm/amdgpu/vcn2.5: add cancel_delayed_work_sync before power gate
In reply to James ZhuAdd cancel_delayed_work_sync before set power gating state to avoid race condition issue when power gating.
--- drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c +2 -0
@@ -321,6 +321,8 @@ static int vcn_v2_5_hw_fini(void *handle)struct amdgpu_device *adev = (struct amdgpu_device *)handle;int i; +cancel_delayed_work_sync (&adev->vcn.idle_work); +for (i =0 ; i < adev->vcn.num_vcn_inst; ++i) {if (adev->vcn.harvest_config & (1 << i))continue ;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/7 drm/amdgpu/vcn3: add cancel_delayed_work_sync before power gate
In reply to James ZhuAdd cancel_delayed_work_sync before set power gating state to avoid race condition issue when power gating.
--- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +3 -4
@@ -380,15 +380,14 @@ static int vcn_v3_0_hw_init(void *handle)static int vcn_v3_0_hw_fini (void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; -struct amdgpu_ring *ring; -int i, j; +int i; + +cancel_delayed_work_sync (&adev->vcn.idle_work);for (i =0 ; i < adev->vcn.num_vcn_inst; ++i) {if (adev->vcn.harvest_config & (1 << i))continue ; - ring = &adev->vcn.inst[i].ring_dec; -if (!amdgpu_sriov_vf (adev)) { if ((adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) || (adev->vcn.cur_state != AMD_PG_STATE_GATE &&
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/7 drm/amdgpu/jpeg2.0: add cancel_delayed_work_sync before power gate
In reply to James ZhuAdd cancel_delayed_work_sync before set power gating state to avoid race condition issue when power gating.
--- drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c +2 -0
@@ -172,6 +172,8 @@ static int jpeg_v2_0_hw_fini(void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; +cancel_delayed_work_sync (&adev->vcn.idle_work); +if (adev->jpeg.cur_state !=AMD_PG_STATE_GATE &&RREG32_SOC15 (JPEG ,0 , mmUVD_JRBC_STATUS))jpeg_v2_0_set_powergating_state (adev,AMD_PG_STATE_GATE );
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/7 drm/amdgpu/jpeg2.5: add cancel_delayed_work_sync before power gate
In reply to James ZhuAdd cancel_delayed_work_sync before set power gating state to avoid race condition issue when power gating.
--- drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c +2 -2
@@ -187,14 +187,14 @@ static int jpeg_v2_5_hw_init(void *handle)static int jpeg_v2_5_hw_fini (void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; -struct amdgpu_ring *ring;int i; +cancel_delayed_work_sync (&adev->vcn.idle_work); +for (i =0 ; i < adev->jpeg.num_jpeg_inst; ++i) {if (adev->jpeg.harvest_config & (1 << i))continue ; - ring = &adev->jpeg.inst[i].ring_dec;if (adev->jpeg.cur_state !=AMD_PG_STATE_GATE &&RREG32_SOC15 (JPEG , i, mmUVD_JRBC_STATUS))jpeg_v2_5_set_powergating_state (adev,AMD_PG_STATE_GATE );
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/7 drm/amdgpu/jpeg3: add cancel_delayed_work_sync before power gate
In reply to James ZhuAdd cancel_delayed_work_sync before set power gating state to avoid race condition issue when power gating.
--- drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c +2 -2
@@ -159,9 +159,9 @@ static int jpeg_v3_0_hw_init(void *handle)static int jpeg_v3_0_hw_fini (void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; -struct amdgpu_ring *ring; - ring = &adev->jpeg.inst->ring_dec; +cancel_delayed_work_sync (&adev->vcn.idle_work); +if (adev->jpeg.cur_state !=AMD_PG_STATE_GATE &&RREG32_SOC15 (JPEG ,0 , mmUVD_JRBC_STATUS))jpeg_v3_0_set_powergating_state (adev,AMD_PG_STATE_GATE );
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 19.05.21 um 18:22 schrieb James Zhu:
Quoted 4 lines
Add
cancel_delayed_work_syncbefore set power gating state to avoid race condition issue when power gating.Signed-off-by James Zhu <[email protected]>
Quoted 13 lines
--- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1
-0@@ -231,9 +231,13 @@ static int vcn_v1_0_hw_fini(void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; +cancel_delayed_work_sync (&adev->vcn.idle_work);
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c static int vcn_v1_0_hw_fini(void *handle) · line 243
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +4
-1+if ((adev->pg_flags &AMD_PG_SUPPORT_VCN_DPG ) || -RREG32_SOC15 (VCN ,0 , mmUVD_STATUS)) + (adev->vcn.cur_state !=AMD_PG_STATE_GATE && +RREG32_SOC15 (VCN ,0 , mmUVD_STATUS))) {vcn_v1_0_set_powergating_state (adev,AMD_PG_STATE_GATE ); + }return 0 ; }
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
The series are:
Quoted 17 lines · James Zhu
Add
cancel_delayed_work_syncbefore set power gating state to avoid race condition issue when power gating.Signed-off-by James Zhu <[email protected]>--- drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1
-0@@ -231,9 +231,13 @@ static int vcn_v1_0_hw_fini(void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; +cancel_delayed_work_sync (&adev->vcn.idle_work);
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c static int vcn_v1_0_hw_fini(void *handle) · line 243
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +4
-1+if ((adev->pg_flags &AMD_PG_SUPPORT_VCN_DPG ) || -RREG32_SOC15 (VCN ,0 , mmUVD_STATUS)) + (adev->vcn.cur_state !=AMD_PG_STATE_GATE && +RREG32_SOC15 (VCN ,0 , mmUVD_STATUS))) {vcn_v1_0_set_powergating_state (adev,AMD_PG_STATE_GATE ); + }return 0 ; }
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx