]> asedeno.scripts.mit.edu Git - linux.git/commit
drm/amd/display: Use atomic types for ref_count
authorJerry Zuo <Jerry.Zuo@amd.com>
Mon, 31 Jul 2017 21:10:44 +0000 (17:10 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2017 22:16:36 +0000 (18:16 -0400)
commite8cd26434df0cd8d97f31aeb4399afcdc37fcfda
tree26614c3e36f8cb14e10d34a5431c4dcf2efe820f
parentf81483c4ccca0d2ceca14ee15564a14f2c34eb2c
drm/amd/display: Use atomic types for ref_count

Current ref_count inc/dec is not guarded by locks which leads to
a raced condition where two threads try to access the variable
at the same time. In this case, both might act on the same cached
value and inc/dec from the same value, rather than inc/dec by 2.

Signed-off-by: Jerry Zuo <Jerry.Zuo@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc.c
drivers/gpu/drm/amd/display/dc/core/dc_resource.c
drivers/gpu/drm/amd/display/dc/core/dc_sink.c
drivers/gpu/drm/amd/display/dc/core/dc_stream.c
drivers/gpu/drm/amd/display/dc/core/dc_surface.c
drivers/gpu/drm/amd/display/dc/dc.h
drivers/gpu/drm/amd/display/dc/dc_hw_types.h
drivers/gpu/drm/amd/display/dc/inc/core_types.h