drm/amdgpu/display: fix context switch issues in dcn20_validate_bandwidth
Subsystems (3)
cover drm/amdgpu/display: fix context switch issues in dcn20_validate_bandwidth
This is likely the real fix for issues such as
https://gitlab.freedesktop.org/drm/amd/-/issues/1215, or perhaps
https://gitlab.freedesktop.org/drm/amd/-/issues/1191, and should be probably backported into existing stable trees.
Daniel Kolesa (1):
drm/amdgpu/display: use GFP_ATOMIC in
dcn20_validate_bandwidth_internal
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 6 lines
2.28.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 1/1 drm/amdgpu/display: use GFP_ATOMIC in dcn20_validate_bandwidth_internal
GFP_KERNEL may and will sleep, and this is being executed in a non-preemptible context; this will mess things up since it's called inbetween DC_FP_START/END, and rescheduling will result in the DC_FP_END later being called in a different context (or just crashing if any floating point/vector registers/instructions are used after the call is resumed in a different context).
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +1 -1
@@ -3141,7 +3141,7 @@ static bool dcn20_validate_bandwidth_internal(struct dc *dc, struct dc_state *coint vlevel =0 ;int pipe_split_from[MAX_PIPES ];int pipe_cnt =0 ; -display_e2e_pipe_params_st *pipes =kzalloc (dc->res_pool->pipe_count *sizeof (display_e2e_pipe_params_st),GFP_KERNEL ); +display_e2e_pipe_params_st *pipes =kzalloc (dc->res_pool->pipe_count *sizeof (display_e2e_pipe_params_st),GFP_ATOMIC );DC_LOGGER_INIT (dc->ctx->logger);BW_VAL_TRACE_COUNT ();
Signature · 6 lines
2.28.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 1/1] drm/amdgpu/display: use GFP_ATOMIC in dcn20_validate_bandwidth_internal
Quoted 9 lines · Daniel Kolesa
GFP_KERNELmay and will sleep, and this is being executed in a non-preemptible context; this will mess things up since it's called inbetween DC_FP_START/END, and rescheduling will result in theDC_FP_ENDlater being called in a different context (or just crashing if any floating point/vector registers/instructions are used after the call is resumed in a different context).Signed-off-by Daniel Kolesa <[email protected]>
We should probably find a way to pre-allocate this, but in the meantime, I'll apply the patch.
Thanks!
Alex
Quoted 20 lines
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +1
-2@@ -3141,7 +3141,7 @@ static bool dcn20_validate_bandwidth_internal(struct dc *dc, struct dc_state *coint vlevel =0 ;int pipe_split_from[MAX_PIPES ];int pipe_cnt =0 ; -display_e2e_pipe_params_st *pipes =kzalloc (dc->res_pool->pipe_count *sizeof (display_e2e_pipe_params_st),GFP_KERNEL ); +display_e2e_pipe_params_st *pipes =kzalloc (dc->res_pool->pipe_count *sizeof (display_e2e_pipe_params_st),GFP_ATOMIC );DC_LOGGER_INIT (dc->ctx->logger);BW_VAL_TRACE_COUNT (); --2.28.0
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 1/1] drm/amdgpu/display: use GFP_ATOMIC in dcn20_validate_bandwidth_internal
Quoted 9 lines · Alex Deucher
Quoted 8 lines · Daniel Kolesa
GFP_KERNELmay and will sleep, and this is being executed in a non-preemptible context; this will mess things up since it's called inbetween DC_FP_START/END, and rescheduling will result in theDC_FP_ENDlater being called in a different context (or just crashing if any floating point/vector registers/instructions are used after the call is resumed in a different context).
Quoted 4 lines
Quoted 1 line
Signed-off-by Daniel Kolesa <[email protected]>We should probably find a way to pre-allocate this, but in the meantime, I'll apply the patch.
Indeed. But this should work as an immediate solution for people experiencing issues. For me it completely stopped dmesg noise on ppc64le and aarch64, and seemingly even fixed the screen flicker problem on POWER that I had to formerly work around by forcing the clocks to high (been running it for days and it's worked perfectly fine with adaptive during the time).
Daniel
Quoted 22 lines
Thanks!
Alex
Quoted 16 lines
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +1
-1@@ -3141,7 +3141,7 @@ static bool dcn20_validate_bandwidth_internal(struct dc *dc, struct dc_state *coint vlevel =0 ;int pipe_split_from[MAX_PIPES ];int pipe_cnt =0 ; -display_e2e_pipe_params_st *pipes =kzalloc (dc->res_pool->pipe_count *sizeof (display_e2e_pipe_params_st),GFP_KERNEL ); +display_e2e_pipe_params_st *pipes =kzalloc (dc->res_pool->pipe_count *sizeof (display_e2e_pipe_params_st),GFP_ATOMIC );DC_LOGGER_INIT (dc->ctx->logger);
Quoted 9 lines
Quoted 8 lines
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +0
-1BW_VAL_TRACE_COUNT (); --2.28.0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx