Skip to content

Commit c4849f8

Browse files
superm1alexdeucher
authored andcommitted
drm/amd/display: Revert W/A for hard hangs on DCN20/DCN21
The WA from commit 2a50edb ("drm/amd/display: Apply w/a for hard hang on HPD") and commit 1bd3bc7 ("drm/amd/display: Extend w/a for hard hang on HPD to dcn20") causes a regression in s0ix where the system will fail to resume properly on many laptops. Pull the workarounds out to avoid that s0ix regression in the common case. This HPD hang happens with an external device in special circumstances and a new W/A will need to be developed for this in the future. Cc: [email protected] Cc: Qingqing Zhuo <[email protected]> Reported-by: Scott Bruce <[email protected]> Reported-by: Chris Hixon <[email protected]> Reported-by: [email protected] Link: https://bugzilla.kernel.org/show_bug.cgi?id=215436 Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1821 Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1852 Fixes: 2a50edb ("drm/amd/display: Apply w/a for hard hang on HPD") Fixes: 1bd3bc7 ("drm/amd/display: Extend w/a for hard hang on HPD to dcn20") Reviewed-by: Nicholas Kazlauskas <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent d82ce3c commit c4849f8

File tree

8 files changed

+3
-79
lines changed

8 files changed

+3
-79
lines changed

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
#include "clk/clk_11_0_0_offset.h"
3939
#include "clk/clk_11_0_0_sh_mask.h"
4040

41-
#include "irq/dcn20/irq_service_dcn20.h"
4241

4342
#undef FN
4443
#define FN(reg_name, field_name) \
@@ -223,8 +222,6 @@ void dcn2_update_clocks(struct clk_mgr *clk_mgr_base,
223222
bool force_reset = false;
224223
bool p_state_change_support;
225224
int total_plane_count;
226-
int irq_src;
227-
uint32_t hpd_state;
228225

229226
if (dc->work_arounds.skip_clock_update)
230227
return;
@@ -242,13 +239,7 @@ void dcn2_update_clocks(struct clk_mgr *clk_mgr_base,
242239
if (dc->res_pool->pp_smu)
243240
pp_smu = &dc->res_pool->pp_smu->nv_funcs;
244241

245-
for (irq_src = DC_IRQ_SOURCE_HPD1; irq_src <= DC_IRQ_SOURCE_HPD6; irq_src++) {
246-
hpd_state = dc_get_hpd_state_dcn20(dc->res_pool->irqs, irq_src);
247-
if (hpd_state)
248-
break;
249-
}
250-
251-
if (display_count == 0 && !hpd_state)
242+
if (display_count == 0)
252243
enter_display_off = true;
253244

254245
if (enter_display_off == safe_to_lower) {

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
#include "clk/clk_10_0_2_sh_mask.h"
4343
#include "renoir_ip_offset.h"
4444

45-
#include "irq/dcn21/irq_service_dcn21.h"
4645

4746
/* Constants */
4847

@@ -129,11 +128,9 @@ static void rn_update_clocks(struct clk_mgr *clk_mgr_base,
129128
struct dc_clocks *new_clocks = &context->bw_ctx.bw.dcn.clk;
130129
struct dc *dc = clk_mgr_base->ctx->dc;
131130
int display_count;
132-
int irq_src;
133131
bool update_dppclk = false;
134132
bool update_dispclk = false;
135133
bool dpp_clock_lowered = false;
136-
uint32_t hpd_state;
137134

138135
struct dmcu *dmcu = clk_mgr_base->ctx->dc->res_pool->dmcu;
139136

@@ -150,14 +147,8 @@ static void rn_update_clocks(struct clk_mgr *clk_mgr_base,
150147

151148
display_count = rn_get_active_display_cnt_wa(dc, context);
152149

153-
for (irq_src = DC_IRQ_SOURCE_HPD1; irq_src <= DC_IRQ_SOURCE_HPD5; irq_src++) {
154-
hpd_state = dc_get_hpd_state_dcn21(dc->res_pool->irqs, irq_src);
155-
if (hpd_state)
156-
break;
157-
}
158-
159150
/* if we can go lower, go lower */
160-
if (display_count == 0 && !hpd_state) {
151+
if (display_count == 0) {
161152
rn_vbios_smu_set_dcn_low_power_state(clk_mgr, DCN_PWR_STATE_LOW_POWER);
162153
/* update power state */
163154
clk_mgr_base->clks.pwr_state = DCN_PWR_STATE_LOW_POWER;

drivers/gpu/drm/amd/display/dc/irq/dcn20/irq_service_dcn20.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -132,31 +132,6 @@ enum dc_irq_source to_dal_irq_source_dcn20(
132132
}
133133
}
134134

135-
uint32_t dc_get_hpd_state_dcn20(struct irq_service *irq_service, enum dc_irq_source source)
136-
{
137-
const struct irq_source_info *info;
138-
uint32_t addr;
139-
uint32_t value;
140-
uint32_t current_status;
141-
142-
info = find_irq_source_info(irq_service, source);
143-
if (!info)
144-
return 0;
145-
146-
addr = info->status_reg;
147-
if (!addr)
148-
return 0;
149-
150-
value = dm_read_reg(irq_service->ctx, addr);
151-
current_status =
152-
get_reg_field_value(
153-
value,
154-
HPD0_DC_HPD_INT_STATUS,
155-
DC_HPD_SENSE);
156-
157-
return current_status;
158-
}
159-
160135
static bool hpd_ack(
161136
struct irq_service *irq_service,
162137
const struct irq_source_info *info)

drivers/gpu/drm/amd/display/dc/irq/dcn20/irq_service_dcn20.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,4 @@
3131
struct irq_service *dal_irq_service_dcn20_create(
3232
struct irq_service_init_data *init_data);
3333

34-
uint32_t dc_get_hpd_state_dcn20(struct irq_service *irq_service, enum dc_irq_source source);
35-
3634
#endif

drivers/gpu/drm/amd/display/dc/irq/dcn21/irq_service_dcn21.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -134,31 +134,6 @@ static enum dc_irq_source to_dal_irq_source_dcn21(struct irq_service *irq_servic
134134
return DC_IRQ_SOURCE_INVALID;
135135
}
136136

137-
uint32_t dc_get_hpd_state_dcn21(struct irq_service *irq_service, enum dc_irq_source source)
138-
{
139-
const struct irq_source_info *info;
140-
uint32_t addr;
141-
uint32_t value;
142-
uint32_t current_status;
143-
144-
info = find_irq_source_info(irq_service, source);
145-
if (!info)
146-
return 0;
147-
148-
addr = info->status_reg;
149-
if (!addr)
150-
return 0;
151-
152-
value = dm_read_reg(irq_service->ctx, addr);
153-
current_status =
154-
get_reg_field_value(
155-
value,
156-
HPD0_DC_HPD_INT_STATUS,
157-
DC_HPD_SENSE);
158-
159-
return current_status;
160-
}
161-
162137
static bool hpd_ack(
163138
struct irq_service *irq_service,
164139
const struct irq_source_info *info)

drivers/gpu/drm/amd/display/dc/irq/dcn21/irq_service_dcn21.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,4 @@
3131
struct irq_service *dal_irq_service_dcn21_create(
3232
struct irq_service_init_data *init_data);
3333

34-
uint32_t dc_get_hpd_state_dcn21(struct irq_service *irq_service, enum dc_irq_source source);
35-
3634
#endif

drivers/gpu/drm/amd/display/dc/irq/irq_service.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void dal_irq_service_destroy(struct irq_service **irq_service)
7979
*irq_service = NULL;
8080
}
8181

82-
const struct irq_source_info *find_irq_source_info(
82+
static const struct irq_source_info *find_irq_source_info(
8383
struct irq_service *irq_service,
8484
enum dc_irq_source source)
8585
{

drivers/gpu/drm/amd/display/dc/irq/irq_service.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ struct irq_service {
6969
const struct irq_service_funcs *funcs;
7070
};
7171

72-
const struct irq_source_info *find_irq_source_info(
73-
struct irq_service *irq_service,
74-
enum dc_irq_source source);
75-
7672
void dal_irq_service_construct(
7773
struct irq_service *irq_service,
7874
struct irq_service_init_data *init_data);

0 commit comments

Comments
 (0)