amdgpu freezes kernel after kernel 5.7.6 changes
Subsystems (3)
Not sure if I am contacting the correct person,
Since I updated to kernel 5.7.6, my system started to freeze randomly. After a couple of freezes, I noticed, that they always happen when playing games, or during videoplayback in e.g. firefox.
I reverted to the previous kernel 5.7.5, and all issues are gone. Next I started to revert and test single commits between the two kernel versions, which affect amdgpu. If I revert the changes listed below, the kernel does not freeze any more.
Sadly I can`t get any crash reports / logs. Even the magic sysrq key does not work, when the system is frozen.
I will also attach a patch, which includes all reverted commits.
List of changes I reverted:
-----------------------------------------------------------------------
commit 6674508ba1a2ea6caca5de2bcb25bc00a050fd0a
Author: Harry Wentland <[email protected]> Date: Thu May 28 09:44:44 2020 -0400
Revert "drm/amd/display: disable dcn20 abm feature for bring up"
commit 14ed1c908a7a623cc0cbf0203f8201d1b7d31d16 upstream.
This reverts commit 96cb7cf13d8530099c256c053648ad576588c387.
This change was used for DCN2 bringup and is no longer desired. In fact it breaks backlight on DCN2 systems.
(quoted diff) +0 -0
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 7fc15b82fe48..f9f02e08054b 100644
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -7
@@ -1334,7 +1334,7 @@ static int dm_late_init(void *handle)unsigned int linear_lut[16 ];int i;struct dmcu *dmcu = adev->dm.dc->res_pool->dmcu; -bool ret = false; +bool ret;for (i =0 ; i <16 ; i++) linear_lut[i] =0xFFFF * i /15 ;
@@ -1350,13 +1350,10 @@ static int dm_late_init(void *handle)*/ params.min_abm_backlight =0x28F ; -/* todo will enable for navi10 */ -if (adev->asic_type <=CHIP_RAVEN ) { - ret =dmcu_load_iram (dmcu, params); + ret =dmcu_load_iram (dmcu, params); -if (!ret) -return -EINVAL ; - } +if (!ret) +return -EINVAL ;return detect_mst_link_for_all_connectors (adev->ddev); }
commit fba8f9ef7e1405ee6f422beb874791e8a5eb489c
Author: Alex Deucher <[email protected]> Date: Tue Jun 2 17:22:48 2020 -0400
drm/amdgpu/display: use blanked rather than plane state for sync
groups
commit b7f839d292948142eaab77cedd031aad0bfec872 upstream.
We may end up with no planes set yet, depending on the ordering,
but we
should have the proper blanking state which is either handled by
either
DPG or TG depending on the hardware generation. Check both to
determine
the proper blanked state.
synced by plane state")
(quoted diff) +0 -0
b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 4a619328101c..4acaf4be8a81 100644
drivers/gpu/drm/amd/display/dc/core/dc.c +4 -2
@@ -1011,9 +1011,17 @@ static void program_timing_sync( } } -/* set first pipe with plane as master */ +/* set first unblanked pipe as master */ for (j =0 ; j < group_size; j++) { -if (pipe_set[j]->plane_state) { +bool is_blanked; + + if (pipe_set[j]->stream_res.opp->funcs-
Quoted 1 line
dpg_is_blanked)
+ is_blanked =
+ pipe_set[j]->stream_res.opp-
Quoted 1 line
funcs->dpg_is_blanked(pipe_set[j]->stream_res.opp);
+ else
+ is_blanked =
+ pipe_set[j]->stream_res.tg-
Quoted 1 line
funcs->is_blanked(pipe_set[j]->stream_res.tg);
+ if (!is_blanked) {
if (j == 0)
break;
@@ -1034,9 +1042,17 @@ static void program_timing_sync(
status->timing_sync_info.master =
false;
}
- /* remove any other pipes with plane as they have
already been synced */
+ /* remove any other unblanked pipes as they have
already been synced */
for (j = j + 1; j < group_size; j++) {
- if (pipe_set[j]->plane_state) {
+ bool is_blanked;
+
+ if (pipe_set[j]->stream_res.opp->funcs-
Quoted 1 line
dpg_is_blanked)
+ is_blanked =
+ pipe_set[j]->stream_res.opp-
Quoted 1 line
funcs->dpg_is_blanked(pipe_set[j]->stream_res.opp);
+ else
+ is_blanked =
+ pipe_set[j]->stream_res.tg-
Quoted 1 line
funcs->is_blanked(pipe_set[j]->stream_res.tg);
+ if (!is_blanked) {
group_size--; pipe_set[j] = pipe_set[group_size]; j--;
commit b5232e2ee8df85891514c73472cac09921e5d51d
Author: Nicholas Kazlauskas <[email protected]> Date: Tue Jun 2 20:42:33 2020 -0400
drm/amd/display: Revalidate bandwidth before commiting DC updates
[ Upstream commit a24eaa5c51255b344d5a321f1eeb3205f2775498 ]
[Why]
Whenever we switch between tiled formats without also switching
pixel
formats or doing anything else that recreates the DC plane state we can run into underflow or hangs since we're not updating the DML parameters before committing to the hardware.
[How]
If the update type is FULL then call validate_bandwidth again to
update
the DML parmeters before committing the state.
This is basically just a workaround and protective measure against update types being added DC where we could run into this issue in the future.
We can only fully validate the state in advance before applying it
to
the hardware if we recreate all the plane and stream states since we can't modify what's currently in use.
The next step is to update DM to ensure that we're creating the
plane
and stream states for whatever could potentially be a full update
in
DC to pre-emptively recreate the state for DC global validation.
The workaround can stay until this has been fixed in DM.
(quoted diff) +0 -0
b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 47431ca6986d..4a619328101c 100644
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -0
@@ -2517,6 +2517,12 @@ void dc_commit_updates_for_stream(struct dc *dc, copy_stream_update_to_stream(dc, context, stream,
stream_update);
+ if (!dc->res_pool->funcs->validate_bandwidth(dc, context,
false)) {
+ DC_ERROR("Mode validation failed for stream
update!\n");
+ dc_release_state(context);
+ return;
+ }
+
commit_planes_for_stream(
dc,
srf_updates,
Details:
* Kernel: 5.7.6
* GPU: radeon 5700XT
* CPU: ryzen 3800X
* running on swaywm(wayland)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +7 -4
@@ -1334,7 +1334,7 @@ static int dm_late_init(void *handle)unsigned int linear_lut[16 ];int i;struct dmcu *dmcu = adev->dm.dc->res_pool->dmcu; -bool ret; +bool ret = false;for (i =0 ; i <16 ; i++) linear_lut[i] =0xFFFF * i /15 ;
@@ -1350,10 +1350,13 @@ static int dm_late_init(void *handle)*/ params.min_abm_backlight =0x28F ; - ret =dmcu_load_iram (dmcu, params); +/* todo will enable for navi10 */ +if (adev->asic_type <=CHIP_RAVEN ) { + ret =dmcu_load_iram (dmcu, params); -if (!ret) -return -EINVAL ; +if (!ret) +return -EINVAL ; + }return detect_mst_link_for_all_connectors (adev->ddev); }
drivers/gpu/drm/amd/display/dc/core/dc.c +4 -26
@@ -1011,17 +1011,9 @@ static void program_timing_sync( } } -/* set first unblanked pipe as master */ +/* set first pipe with plane as master */ for (j =0 ; j < group_size; j++) { -bool is_blanked; - -if (pipe_set[j]->stream_res.opp->funcs->dpg_is_blanked) - is_blanked = - pipe_set[j]->stream_res.opp->funcs->dpg_is_blanked (pipe_set[j]->stream_res.opp); -else - is_blanked = - pipe_set[j]->stream_res.tg->funcs->is_blanked (pipe_set[j]->stream_res.tg); -if (!is_blanked) { +if (pipe_set[j]->plane_state) {if (j ==0 )break ;
@@ -1042,17 +1034,9 @@ static void program_timing_sync( status->timing_sync_info.master = false; } -/* remove any other unblanked pipes as they have already been synced */ +/* remove any other pipes with plane as they have already been synced */ for (j = j +1 ; j < group_size; j++) { -bool is_blanked; - -if (pipe_set[j]->stream_res.opp->funcs->dpg_is_blanked) - is_blanked = - pipe_set[j]->stream_res.opp->funcs->dpg_is_blanked (pipe_set[j]->stream_res.opp); -else - is_blanked = - pipe_set[j]->stream_res.tg->funcs->is_blanked (pipe_set[j]->stream_res.tg); -if (!is_blanked) { +if (pipe_set[j]->plane_state) { group_size--; pipe_set[j] = pipe_set[group_size]; j--;
@@ -2533,12 +2517,6 @@ void dc_commit_updates_for_stream(struct dc *dc,copy_stream_update_to_stream (dc, context, stream, stream_update); -if (!dc->res_pool->funcs->validate_bandwidth (dc, context, false)) { -DC_ERROR ("Mode validation failed for stream update!\n" ); -dc_release_state (context); -return ; - } - commit_planes_for_stream( dc, srf_updates,
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
I narrowed it down even more. When reverting
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b5232e2ee8df85891514c73472cac09921e5d51d everything is stable. I have an uptime of 4+ hours while actively trying to reproduce the bug (gaming).
Here is a bug report:
https://gitlab.freedesktop.org/drm/amd/-/issues/1191
Added Nicholas Kazlauskas, author of the mentioned commit.
Am Samstag, den 27.06.2020, 18:03 +0200 schrieb [email protected]:
Quoted 229 lines
Not sure if I am contacting the correct person,
Since I updated to kernel 5.7.6, my system started to freeze randomly.
After a couple of freezes, I noticed, that they always happen when playing games, or during videoplayback in e.g. firefox.I reverted to the previous kernel 5.7.5, and all issues are gone. Next
I started to revert and test single commits between the two kernel versions, which affect amdgpu. If I revert the changes listed below, the kernel does not freeze any more.Sadly I can`t get any crash reports / logs. Even the magic sysrq key does not work, when the system is frozen.
I will also attach a patch, which includes all reverted commits.
List of changes I reverted:
-------------------------------------------------------------------
----commit
6674508ba1a2ea6caca5de2bcb25bc00a050fd0aAuthor: Harry Wentland <[email protected]> Date: Thu May 28 09:44:44 2020 -0400Revert "drm/amd/display: disable dcn20 abm feature for bring up"
commit
14ed1c908a7a623cc0cbf0203f8201d1b7d31d16upstream.This reverts commit
96cb7cf13d8530099c256c053648ad576588c387.This change was used for DCN2 bringup and is no longer desired. In fact it breaks backlight on DCN2 systems.
Cc Alexander Monakov <[email protected]>Cc Hersen Wu <[email protected]>Cc Anthony Koo <[email protected]>Cc Michael Chiu <[email protected]>Signed-off-by Harry Wentland <[email protected]>Acked-by Alex Deucher <[email protected]>Reviewed-by Nicholas Kazlauskas <[email protected]>Reported-and-tested-by Alexander Monakov <[email protected]>Signed-off-by Alex Deucher <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4
-7@@ -1334,7 +1334,7 @@ static int dm_late_init(void *handle)unsigned int linear_lut[16 ];int i;struct dmcu *dmcu = adev->dm.dc->res_pool->dmcu; -bool ret = false; +bool ret;for (i =0 ; i <16 ; i++) linear_lut[i] =0xFFFF * i /15 ;@@ -1350,13 +1350,10 @@ static int dm_late_init(void *handle)*/ params.min_abm_backlight =0x28F ; -/* todo will enable for navi10 */ -if (adev->asic_type <=CHIP_RAVEN ) { - ret =dmcu_load_iram (dmcu, params); + ret =dmcu_load_iram (dmcu, params); -if (!ret) -return -EINVAL ; - } +if (!ret) +return -EINVAL ;return detect_mst_link_for_all_connectors (adev->ddev); }commit
fba8f9ef7e1405ee6f422beb874791e8a5eb489cAuthor: Alex Deucher <[email protected]> Date: Tue Jun 2 17:22:48 2020 -0400drm/amdgpu/display: use blanked rather than plane state for sync
groupscommit
b7f839d292948142eaab77cedd031aad0bfec872upstream.We may end up with no planes set yet, depending on the ordering,
but we
should have the proper blanking state which is either handled by
either
DPG or TG depending on the hardware generation. Check both to
determine
the proper blanked state.Fixes 5fc0cbfad45648 ("drm/amd/display: determine if a pipe issynced by plane state")
Reviewed-by Nicholas Kazlauskas <[email protected]>Signed-off-by Alex Deucher <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>drivers/gpu/drm/amd/display/dc/core/dc.c +10
-2@@ -1011,9 +1011,17 @@ static void program_timing_sync( } } -/* set first pipe with plane as master */ +/* set first unblanked pipe as master */ for (j =0 ; j < group_size; j++) { -if (pipe_set[j]->plane_state) { +bool is_blanked; + +if (pipe_set[j]->stream_res.opp->funcs- > dpg_is_blanked) + is_blanked = + pipe_set[j]->stream_res.opp- > funcs->dpg_is_blanked(pipe_set[j]->stream_res.opp); +else + is_blanked = + pipe_set[j]->stream_res.tg- > funcs->is_blanked(pipe_set[j]->stream_res.tg); +if (!is_blanked) {drivers/gpu/drm/amd/display/dc/core/dc.c +0
-1if (j ==0 )break ;@@ -1034,9 +1042,17 @@ static void program_timing_sync( status->timing_sync_info.master = false; } -/* remove any other pipes with plane as they have already been synced */
drivers/gpu/drm/amd/display/dc/core/dc.c +1
-0+/* remove any other unblanked pipes as they have already been synced */
drivers/gpu/drm/amd/display/dc/core/dc.c +3
-1for (j = j +1 ; j < group_size; j++) { -if (pipe_set[j]->plane_state) { +bool is_blanked; + + if (pipe_set[j]->stream_res.opp->funcs-Quoted 1 line
dpg_is_blanked)drivers/gpu/drm/amd/display/dc/core/dc.c +2
-0+ is_blanked = + pipe_set[j]->stream_res.opp-Quoted 1 line
funcs->dpg_is_blanked(pipe_set[j]->stream_res.opp);drivers/gpu/drm/amd/display/dc/core/dc.c +3
-0+else + is_blanked = + pipe_set[j]->stream_res.tg-Quoted 1 line
funcs->is_blanked(pipe_set[j]->stream_res.tg);drivers/gpu/drm/amd/display/dc/core/dc.c +1
-0+if (!is_blanked) { group_size--; pipe_set[j] = pipe_set[group_size]; j--;commit
b5232e2ee8df85891514c73472cac09921e5d51dAuthor: Nicholas Kazlauskas <[email protected]> Date: Tue Jun 2 20:42:33 2020 -0400drm/amd/display: Revalidate bandwidth before commiting DC updates
[ Upstream commit
a24eaa5c51255b344d5a321f1eeb3205f2775498][Why]
Whenever we switch between tiled formats without also switching
pixel
formats or doing anything else that recreates the DC plane state
we
can run into underflow or hangs since we're not updating the DML parameters before committing to the hardware.[How]
If the update type is FULL then callvalidate_bandwidthagain to
update
the DML parmeters before committing the state.This is basically just a workaround and protective measure
against
update types being added DC where we could run into this issue in the future.We can only fully validate the state in advance before applying
it
to
the hardware if we recreate all the plane and stream states since we can't modify what's currently in use.The next step is to update DM to ensure that we're creating the
plane
and stream states for whatever could potentially be a full update
in
DC to pre-emptively recreate the state for DC global validation.The workaround can stay until this has been fixed in DM.
Signed-off-by Nicholas Kazlauskas <[email protected]>Reviewed-by Hersen Wu <[email protected]>Signed-off-by Alex Deucher <[email protected]>Signed-off-by Sasha Levin <[email protected]>drivers/gpu/drm/amd/display/dc/core/dc.c +2
-0@@ -2517,6 +2517,12 @@ void dc_commit_updates_for_stream(struct dc *dc,copy_stream_update_to_stream (dc, context, stream, stream_update); +if (!dc->res_pool->funcs->validate_bandwidth (dc, context, false)) { + DC_ERROR("Mode validation failed for streamupdate!\n");
drivers/gpu/drm/amd/display/dc/core/dc.c +4
-0+dc_release_state (context); +return ; + } + commit_planes_for_stream( dc, srf_updates,
Quoted 6 lines
Details:
* Kernel: 5.7.6
* GPU: radeon 5700XT
* CPU: ryzen 3800X
* running on swaywm(wayland)
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel