disp: msm: dp: add timeout state for simulated AUX transfers

Add a new state to indicate timeout failures in simulation mode.
This can be used by test scripts to trigger a retry of the
session.

Change-Id: I9e250ba7d42fcb318698d8456b3acc5b55081abc
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
This commit is contained in:
Tatenda Chipeperekwa
2019-07-09 14:32:35 -07:00
parent d2c24e44e2
commit d532f14537
2 changed files with 5 additions and 2 deletions

View File

@@ -505,7 +505,7 @@ static ssize_t dp_aux_transfer_debug(struct drm_dp_aux *drm_aux,
if (aux->read) {
timeout = wait_for_completion_timeout(&aux->comp, HZ);
if (!timeout) {
pr_err("aux timeout for 0x%x\n", msg->address);
pr_err("read timeout: 0x%x\n", msg->address);
atomic_set(&aux->aborted, 1);
ret = -ETIMEDOUT;
goto end;
@@ -519,7 +519,7 @@ static ssize_t dp_aux_transfer_debug(struct drm_dp_aux *drm_aux,
timeout = wait_for_completion_timeout(&aux->comp, HZ);
if (!timeout) {
pr_err("aux timeout for 0x%x\n", msg->address);
pr_err("write timeout: 0x%x\n", msg->address);
atomic_set(&aux->aborted, 1);
ret = -ETIMEDOUT;
goto end;
@@ -556,6 +556,8 @@ address_error:
memset(msg->buffer, 0, msg->size);
ret = msg->size;
end:
if (ret == -ETIMEDOUT)
aux->dp_aux.state |= DP_STATE_AUX_TIMEOUT;
aux->dp_aux.reg = 0xFFFF;
aux->dp_aux.read = true;
aux->dp_aux.size = 0;