From: Wei-Guang Li Date: Wed, 6 May 2026 12:32:33 +0000 (+0800) Subject: drm/amd/display: Add debug option for replay ESD recovery X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=775054e27e2e033b7544896eb526af7d196f1587;p=thirdparty%2Flinux.git drm/amd/display: Add debug option for replay ESD recovery [Why&How] Add a new debug option "enable_replay_esd_recovery" to control whether to enable the replay ESD recovery feature. Reviewed-by: Robin Chen Reviewed-by: Wenjing Liu Signed-off-by: Wei-Guang Li Signed-off-by: Ivan Lipski Tested-by: Dan Wheeler Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h index d0b6fad65bc0..a356cf4faa1d 100644 --- a/drivers/gpu/drm/amd/display/dc/dc.h +++ b/drivers/gpu/drm/amd/display/dc/dc.h @@ -1220,6 +1220,7 @@ struct dc_debug_options { bool enable_otg_frame_sync_pwa; unsigned int min_deep_sleep_dcfclk_khz; unsigned int force_odm2to1_for_edp_pixclk_mhz; + bool enable_replay_esd_recovery; }; diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_irq_handler.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_irq_handler.c index f9e0ba24d401..54ce768ae6ad 100644 --- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_irq_handler.c +++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_irq_handler.c @@ -312,12 +312,14 @@ static void handle_hpd_irq_replay_sink(struct dc_link *link, bool *need_re_enabl } } - if (!link->replay_settings.replay_allow_active && - replay_sink_status.bits.SINK_DEVICE_REPLAY_STATUS == 0x7) { - /* If sink device replay status is 0x7 and replay is disabled, - * it means sink is in a bad state and link retraining is needed to recover - */ - *replay_esd_detection_needed = true; + if (link->ctx->dc->debug.enable_replay_esd_recovery) { + if (!link->replay_settings.replay_allow_active && + replay_sink_status.bits.SINK_DEVICE_REPLAY_STATUS == 0x7) { + /* If sink device replay status is 0x7 and replay is disabled, + * it means sink is in a bad state and link retraining is needed to recover + */ + *replay_esd_detection_needed = true; + } } }