OSDN Git Service

drm/amd/display: fix sporadic multiple aux transaction failure
authorYogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Thu, 1 Nov 2018 18:48:48 +0000 (00:18 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 30 Nov 2018 17:01:42 +0000 (12:01 -0500)
commit50f9ca048c190b08f06a2b88e4d18d507b528b52
tree844393a42de8ea2ca9423d2eec646eb732aad725
parent2c486cc4c2774df684d8a43ca7a20670c67ccd76
drm/amd/display: fix sporadic multiple aux transaction failure

[why]
When there are multiple aux transaction in parallel, it is sometime
sporadically the aux transaction starts to continuously fail. The
aux transaction was failing because the busy bit for the given gpio
pin was always set. The busy bit was alway set because the
programming sequence to read, modify and write busy bit was not
atomic. Due to which when multiple threads are trying to modify the
busy bits for their gpio pins in the same integer variable sometimes
the busy bits integer variable is written with old data causing
failure.

[how]
Instead of using individual bits to track gpio pins and grouping
them to integers, one byte will be allcoated for each gpio pin.
Now whenever a gpio pin needs to be set to mark being used, only
writing a value of one to that byte is sufficient, other bytes
are not impacted. Also no need to have atomicity with bytes unlike
with bits.

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/gpio/gpio_service.c
drivers/gpu/drm/amd/display/dc/gpio/gpio_service.h