@@ -1879,7 +1879,7 @@ static ssize_t mtk_dp_aux_transfer(struct drm_dp_aux *mtk_aux,
bool is_read;
u8 request;
size_t accessed_bytes = 0;
- int retry = 3, ret = 0;
+ int retry, ret = 0;
mtk_dp = container_of(mtk_aux, struct mtk_dp, aux);
@@ -1913,15 +1913,21 @@ static ssize_t mtk_dp_aux_transfer(struct drm_dp_aux *mtk_aux,
}
if (msg->size == 0) {
- ret = mtk_dp_aux_do_transfer(mtk_dp, is_read, request,
- msg->address + accessed_bytes,
- msg->buffer + accessed_bytes, 0);
+ retry = 7;
+ while (retry--) {
+ ret = mtk_dp_aux_do_transfer(mtk_dp, is_read, request,
+ msg->address + accessed_bytes,
+ msg->buffer + accessed_bytes, 0);
+ if (ret == 0)
+ break;
+ msleep(50);
}
} else {
while (accessed_bytes < msg->size) {
size_t to_access =
min_t(size_t, DP_AUX_MAX_PAYLOAD_BYTES,
msg->size - accessed_bytes);
+ retry = 7;
while (retry--) {
ret = mtk_dp_aux_do_transfer(mtk_dp,
is_read, request,