Since commit def3488eb0fd ("drm/amd/display: refactor HPD to increase flexibility"), the link encoder programs the HPD filter, and dce110_program_hpd_filter() and dcn10_program_hpd_filter() hit ASSERT(0) if the encoder has no HPD GPIO. That is the case if link_get_hpd_gpio() finds no usable HPD info for the connector in the VBIOS, where program_hpd_filter() used to return early without a warning. This logs a warning with a stack trace on every boot of some systems, for example with Ryzen 7 PRO 4750G APUs on ASRock Rack X570D4U and X470D4U2-2T boards: WARNING: drivers/gpu/drm/amd/amdgpu/../display/dc/dio/dcn10/dcn10_link_encoder.c:1514 at dcn10_program_hpd_filter+0x39/0x90 [amdgpu], CPU#7: (udev-worker)/836 Call Trace: program_hpd_filter+0x5d/0xb0 [amdgpu] construct_phy+0x96f/0xe60 [amdgpu] link_create+0x1f0/0x240 [amdgpu] create_links+0x164/0x4f0 [amdgpu] dc_create+0x3ba/0x720 [amdgpu] amdgpu_dm_init+0x2c9/0x420 [amdgpu] Return false without asserting if there is no HPD GPIO, as before, and keep the assertion for failing to lock the pin. Fixes: def3488eb0fd ("drm/amd/display: refactor HPD to increase flexibility") Link: https://forum.proxmox.com/threads/kernel-7-0-14-24-and-7-0-14-25-bug-in-amdgpu.187181/ Cc: stable@vger.kernel.org Signed-off-by: Thomas Lamprecht --- drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 5 ++++- .../gpu/drm/amd/display/dc/dio/dcn10/dcn10_link_encoder.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c b/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c index c6a20378121b..0c1fcfd088ba 100644 --- a/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c @@ -1841,8 +1841,11 @@ bool dce110_get_hpd_state(struct link_encoder *enc) bool dce110_program_hpd_filter(struct link_encoder *enc, int delay_on_connect_in_ms, int delay_on_disconnect_in_ms) { + if (!enc->hpd_gpio) + return false; + /* Setup HPD filtering */ - if (enc->hpd_gpio && dal_gpio_lock_pin(enc->hpd_gpio) == GPIO_RESULT_OK) { + if (dal_gpio_lock_pin(enc->hpd_gpio) == GPIO_RESULT_OK) { struct gpio_hpd_config config; config.delay_on_connect = delay_on_connect_in_ms; diff --git a/drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_link_encoder.c b/drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_link_encoder.c index 32e12d894e31..ddb40e6507b5 100644 --- a/drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_link_encoder.c +++ b/drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_link_encoder.c @@ -1506,8 +1506,11 @@ bool dcn10_get_hpd_state(struct link_encoder *enc) bool dcn10_program_hpd_filter(struct link_encoder *enc, int delay_on_connect_in_ms, int delay_on_disconnect_in_ms) { + if (!enc->hpd_gpio) + return false; + /* Setup HPD filtering */ - if (enc->hpd_gpio && dal_gpio_lock_pin(enc->hpd_gpio) == GPIO_RESULT_OK) { + if (dal_gpio_lock_pin(enc->hpd_gpio) == GPIO_RESULT_OK) { struct gpio_hpd_config config; config.delay_on_connect = delay_on_connect_in_ms; -- 2.47.3