Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: fix resume hang because of DP short pulse

There is a hard hang observed during resume from S3 when
the system receives a DP short pulse interrupt. This is
because there are two code paths contending for GPIO
access for AUX channel transactions. One such path is
through amdgpu_dm_display_resume() function which is
invoked from the regular system resume code path. The
other path is through handle_hpd_rx_irq(), which is
invoked in response to system receiving DP short pulse
interrupt. handle_hpd_rx_irq() guards against conflicting
GPIO access using hpd_lock, but the GPIO access from
amdgpu_dm_display_resume() remains unguarded.

This patch makes sure we use hpd_lock inside
amdgpu_dm_display_resume() to avoid race conditions
for GPIO access.

Signed-off-by: Arindam Nath <arindam.nath@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Arindam Nath and committed by
Alex Deucher
03ea364c ba624cdd

+2
+2
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 580 580 if (aconnector->mst_port) 581 581 continue; 582 582 583 + mutex_lock(&aconnector->hpd_lock); 583 584 dc_link_detect(aconnector->dc_link, false); 584 585 aconnector->dc_sink = NULL; 585 586 amdgpu_dm_update_connector_after_detect(aconnector); 587 + mutex_unlock(&aconnector->hpd_lock); 586 588 } 587 589 588 590 /* Force mode set in atomic comit */