From e044c01cccaaedb68c856248e042b8332521fca8 Mon Sep 17 00:00:00 2001 From: Maheshwar Ajja Date: Tue, 21 Feb 2023 13:20:55 -0800 Subject: [PATCH] video-driver: resolve retry assert xo reset issue In assert xo reset failure case, count increment and usleep are skipped resulting in indefinite while loop. Correct the conditions to avoid looping indefinitely. Change-Id: I38fae272f0c7c676e1454e1fb0a8bfee860ea2f0 Signed-off-by: Maheshwar Ajja --- driver/variant/iris33/src/msm_vidc_iris33.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/driver/variant/iris33/src/msm_vidc_iris33.c b/driver/variant/iris33/src/msm_vidc_iris33.c index 616232679d..d0d616edd0 100644 --- a/driver/variant/iris33/src/msm_vidc_iris33.c +++ b/driver/variant/iris33/src/msm_vidc_iris33.c @@ -471,13 +471,16 @@ static int __power_off_iris33_controller(struct msm_vidc_core *core) count = 0; do { rc = call_res_op(core, reset_control_acquire, core, "video_xo_reset"); - if (rc) { - d_vpr_e("%s: failed to acquire video_xo_reset control\n", __func__); + if (!rc) { + break; } else { + d_vpr_e( + "%s: failed to acquire video_xo_reset control, count %d\n", + __func__, count); count++; usleep_range(1000, 1000); } - } while (rc && count < 100); + } while (count < 100); if (count >= 100) { d_vpr_e("%s: timeout acquiring video_xo_reset\n", __func__);