OSDN Git Service

drm/amd/display: take dc_lock in short pulse handler only
authorAurabindo Pillai <aurabindo.pillai@amd.com>
Wed, 19 May 2021 20:51:01 +0000 (16:51 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 21 May 2021 14:30:26 +0000 (10:30 -0400)
commitd2aa1356834d845ffdac0d8c01b58aa60d1bdc65
tree8ff55fd8b1e2bbfc907974bf5688e1769a26f5c6
parent9a91e5e0af5e03940d0eec72c36364a1701de240
drm/amd/display: take dc_lock in short pulse handler only

[Why]
Conditions that end up modifying the global dc state must be locked.
However, during mst allocate payload sequence, lock is already taken.
With StarTech 1.2 DP hub, we get an HPD RX interrupt for a reason other
than to indicate down reply availability right after sending payload
allocation. The handler again takes dc lock before calling the
dc's HPD RX handler. Due to this contention, the DRM thread which waits
for MST down reply never gets a chance to finish its waiting
successfully and ends up timing out. Once the lock is released, the hpd
rx handler fires and goes ahead to read from the MST HUB, but now its
too late and the HUB doesnt lightup all displays since DRM lacks error
handling when payload allocation fails.

[How]
Take lock only if there is a change in link status or if automated test
pattern bit is set. The latter fixes the null pointer dereference when
running certain DP Link Layer Compliance test.

Fixes: c8ea79a8a276 ("drm/amd/display: NULL pointer error during compliance test")

Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
drivers/gpu/drm/amd/display/dc/inc/dc_link_dp.h