]> git.baikalelectronics.ru Git - kernel.git/commit
media: cxd2841er: avoid too many status inquires
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Sun, 6 Oct 2019 12:48:23 +0000 (09:48 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 16 Oct 2019 15:24:30 +0000 (12:24 -0300)
commitcf0c98edd75ba3a8eacce267c8ecaabcfa9f54f8
treef85a064ffa23d2bdf9d759b6365ff76c531656aa
parente2917d2532b9922e125e8aa0a388227a15ac3ec7
media: cxd2841er: avoid too many status inquires

I2C ops are expensive, as the I2C bus typical speed is 100kbps.

Also, stats reading take some time, as it requires to retrieve a
certain number of packets to complete.

While we don't know the minimal for CXD2841er, trying to do it
too quickly is still a very bad idea.

So, add some sanity logic there, preventing to retrieve stats
faster than one second.

This shouldn't cause any issues with well behavior apps, as they
usually take stats on a polling rate slower than 1 second.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sean Young <sean@mess.org>
drivers/media/dvb-frontends/cxd2841er.c