• Stylon Wang's avatar
    drm/amd/display: Fix race condition in DPIA AUX transfer · ead08b95
    Stylon Wang authored
    [Why]
    This fix was intended for improving on coding style but in the process
    uncovers a race condition, which explains why we are getting incorrect
    length in DPIA AUX replies. Due to the call path of DPIA AUX going from
    DC back to DM layer then again into DC and the added complexities on top
    of current DC AUX implementation, a proper fix to rely on current dc_lock
    to address the race condition is difficult without a major overhual
    on how DPIA AUX is implemented.
    
    [How]
    - Add a mutex dpia_aux_lock to protect DPIA AUX transfers
    - Remove DMUB_ASYNC_TO_SYNC_ACCESS_* codes and rely solely on
      aux_return_code_type for error reporting and handling
    - Separate SET_CONFIG from DPIA AUX transfer because they have quiet
      different processing logic
    - Remove unnecessary type casting to and from void * type
    Reviewed-by: default avatarNicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
    Acked-by: default avatarJasdeep Dhillon <jdhillon@amd.com>
    Signed-off-by: default avatarStylon Wang <stylon.wang@amd.com>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    ead08b95
amdgpu_dm.c 295 KB