]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-6.8/drm-amd-display-disable-idle-reallow-as-part-of-comm.patch
Linux 6.6.27
[thirdparty/kernel/stable-queue.git] / queue-6.8 / drm-amd-display-disable-idle-reallow-as-part-of-comm.patch
1 From b777ac2df61e292ab4119f27e1cf73e68e31e9b0 Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Wed, 24 Jan 2024 10:51:49 -0500
4 Subject: drm/amd/display: Disable idle reallow as part of command/gpint
5 execution
6
7 From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
8
9 [ Upstream commit 6226a5aa77370329e01ee8abe50a95e60618ce97 ]
10
11 [Why]
12 Workaroud for a race condition where DMCUB is in the process of
13 committing to IPS1 during the handshake causing us to miss the
14 transition into IPS2 and touch the INBOX1 RPTR causing a HW hang.
15
16 [How]
17 Disable the reallow to ensure that we have enough of a gap between entry
18 and exit and we're not seeing back-to-back wake_and_executes.
19
20 Reviewed-by: Ovidiu Bunea <ovidiu.bunea@amd.com>
21 Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
22 Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
23 Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
24 Signed-off-by: Sasha Levin <sashal@kernel.org>
25 ---
26 drivers/gpu/drm/amd/display/dc/dc.h | 1 +
27 drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 4 ++--
28 .../gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c | 1 +
29 3 files changed, 4 insertions(+), 2 deletions(-)
30
31 diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
32 index f1342314f7f43..fc60fa5814fbe 100644
33 --- a/drivers/gpu/drm/amd/display/dc/dc.h
34 +++ b/drivers/gpu/drm/amd/display/dc/dc.h
35 @@ -987,6 +987,7 @@ struct dc_debug_options {
36 bool psp_disabled_wa;
37 unsigned int ips2_eval_delay_us;
38 unsigned int ips2_entry_delay_us;
39 + bool disable_dmub_reallow_idle;
40 bool disable_timeout;
41 bool disable_extblankadj;
42 unsigned int static_screen_wait_frames;
43 diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
44 index 363d522603a21..9084b320849a6 100644
45 --- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
46 +++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
47 @@ -1364,7 +1364,7 @@ bool dc_wake_and_execute_dmub_cmd_list(const struct dc_context *ctx, unsigned in
48 else
49 result = dm_execute_dmub_cmd(ctx, cmd, wait_type);
50
51 - if (result && reallow_idle)
52 + if (result && reallow_idle && !ctx->dc->debug.disable_dmub_reallow_idle)
53 dc_dmub_srv_apply_idle_power_optimizations(ctx->dc, true);
54
55 return result;
56 @@ -1413,7 +1413,7 @@ bool dc_wake_and_execute_gpint(const struct dc_context *ctx, enum dmub_gpint_com
57
58 result = dc_dmub_execute_gpint(ctx, command_code, param, response, wait_type);
59
60 - if (result && reallow_idle)
61 + if (result && reallow_idle && !ctx->dc->debug.disable_dmub_reallow_idle)
62 dc_dmub_srv_apply_idle_power_optimizations(ctx->dc, true);
63
64 return result;
65 diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c
66 index 04d230aa8861f..78c315541f031 100644
67 --- a/drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c
68 +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c
69 @@ -782,6 +782,7 @@ static const struct dc_debug_options debug_defaults_drv = {
70 .psp_disabled_wa = true,
71 .ips2_eval_delay_us = 2000,
72 .ips2_entry_delay_us = 800,
73 + .disable_dmub_reallow_idle = true,
74 .static_screen_wait_frames = 2,
75 };
76
77 --
78 2.43.0
79