]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
media: i2c: ds90ub960: Reduce sleep in ub960_rxport_wait_locks()
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Fri, 6 Dec 2024 08:26:47 +0000 (10:26 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 19 Dec 2024 11:50:16 +0000 (12:50 +0100)
We currently sleep for 50 ms at the end of each iteration in
ub960_rxport_wait_locks(). This feels a bit excessive, especially as we
always do at least two loops, so there's always at least one sleep, even
if we already have a stable lock.

Change the sleep to 10 ms.

Reviewed-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/i2c/ds90ub960.c

index e3dc9b3c6aa53abf0410187206d88a7fbfb61216..20a37755248b3c5bf093bb5de38298d76888a42b 100644 (file)
@@ -1575,7 +1575,12 @@ static int ub960_rxport_wait_locks(struct ub960_data *priv,
                if (missing == 0)
                        break;
 
-               msleep(50);
+               /*
+                * The sleep time of 10 ms was found by testing to give a lock
+                * with a few iterations. It can be decreased if on some setups
+                * the lock can be achieved much faster.
+                */
+               fsleep(10 * USEC_PER_MSEC);
        }
 
        if (lock_mask)