On Fri Dec 6 10:26:47 2024 +0200, Tomi Valkeinen wrote:
> 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 <[email protected]>
> Signed-off-by: Tomi Valkeinen <[email protected]>
> Signed-off-by: Sakari Ailus <[email protected]>
> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Patch committed.
Thanks,
Mauro Carvalho Chehab
drivers/media/i2c/ds90ub960.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/drivers/media/i2c/ds90ub960.c b/drivers/media/i2c/ds90ub960.c
index e3dc9b3c6aa5..20a37755248b 100644
--- a/drivers/media/i2c/ds90ub960.c
+++ b/drivers/media/i2c/ds90ub960.c
@@ -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)