LKML Archive on
help / color / mirror / Atom feed
* [PATCH V2] media: smiapp: core: add small range to usleep_range
@ 2019-05-08 15:11 Nicholas Mc Guire
  0 siblings, 0 replies; only message in thread
From: Nicholas Mc Guire @ 2019-05-08 15:11 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Mauro Carvalho Chehab, linux-media, linux-kernel, Nicholas Mc Guire

No need for a high-accuracy delay here as long as it is more than 2
milliseconds this should be ok - as it is non-atomic context it will
be not be precise 2 milliseconds so giving the hrtimer subsystem 50
microseconds to merge timers and reduce interrupts.

Signed-off-by: Nicholas Mc Guire <>

Problem located by an experimental coccinelle script

V2: As Sakari Ailus <> noted that the delays would be
    noticeable for the user but a range in the 50 microseconds range would
    be acceptable - the range is reduced from 2 millisecond to 50 microseconds
    which still gives the hrtimer subsystem some room for reducing interrupt

Patch was compile tested with: x86_64_defconfig + MEDIA_SUPPORT=m,

Patch is against 5.1 (localversion-next is next-20190508)

 drivers/media/i2c/smiapp/smiapp-quirk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/smiapp/smiapp-quirk.c b/drivers/media/i2c/smiapp/smiapp-quirk.c
index 95c0272..59cb2a5 100644
--- a/drivers/media/i2c/smiapp/smiapp-quirk.c
+++ b/drivers/media/i2c/smiapp/smiapp-quirk.c
@@ -202,7 +202,7 @@ static int jt8ev1_post_streamoff(struct smiapp_sensor *sensor)
 		return rval;
 	/* Wait for 1 ms + one line => 2 ms is likely enough */
-	usleep_range(2000, 2000);
+	usleep_range(2000, 2050);
 	/* Restore it */
 	rval = smiapp_write_8(sensor, 0x3205, 0x00);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-05-08 15:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-08 15:11 [PATCH V2] media: smiapp: core: add small range to usleep_range Nicholas Mc Guire

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).