From fba8d96566dff5b7cbae2d479c47c8b7a1ea1fcc Mon Sep 17 00:00:00 2001 From: Rajkumar Subbiah Date: Wed, 15 Sep 2021 13:00:58 -0400 Subject: [PATCH] disp: msm: dp: check for aux abort in sim mode In sim mode, the dp driver is not checking for the aux state before processing an aux request. This ends up causing the drm framework to unnecessarily wait for 4 seconds while destroying a stream. This change adds the check for aux state to align with the behavior of a real sink. Change-Id: I81900018ac1b403bb1e03fe26206e145694fefbd Signed-off-by: Rajkumar Subbiah --- msm/dp/dp_aux.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/msm/dp/dp_aux.c b/msm/dp/dp_aux.c index e75e10e7a4..00f9381f81 100644 --- a/msm/dp/dp_aux.c +++ b/msm/dp/dp_aux.c @@ -560,6 +560,15 @@ static ssize_t dp_aux_transfer_debug(struct drm_dp_aux *drm_aux, struct dp_aux_private *aux = container_of(drm_aux, struct dp_aux_private, drm_aux); ssize_t size; + int aborted; + + mutex_lock(&aux->mutex); + aborted = atomic_read(&aux->aborted); + mutex_unlock(&aux->mutex); + if (aborted) { + size = -ETIMEDOUT; + goto end; + } if (aux->sim_in_transfer) { if (aux->aux_bridge && aux->aux_bridge->transfer) @@ -572,7 +581,7 @@ static ssize_t dp_aux_transfer_debug(struct drm_dp_aux *drm_aux, drm_aux, msg); aux->sim_in_transfer = false; } - +end: return size; }