• Aurabindo Pillai's avatar
    drm/amd/display: take dc_lock in short pulse handler only · d2aa1356
    Aurabindo Pillai authored
    [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: c8ea79a8 ("drm/amd/display: NULL pointer error during compliance test")
    Signed-off-by: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
    Reviewed-by: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    d2aa1356
amdgpu_dm.c 309 KB