media: atmel: atmel-isi: fix timeout value for stop streaming
authorAlexandre Kroupski <alexandre.kroupski@ingenico.com>
Tue, 20 Aug 2019 11:37:45 +0000 (08:37 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:51:06 +0000 (14:51 +0100)
commit57bc41eb3420b43823acc89745fe78ec5aa1585d
treeaf443ec33a73db97c73055f41bcaa6e83158e2e1
parentb5b164b79a919415122125af69925c355928c8b2
media: atmel: atmel-isi: fix timeout value for stop streaming

[ Upstream commit 623fd246bb40234fe68dd4e7c1f1f081f9c45a3d ]

In case of sensor malfunction, stop streaming timeout takes much longer
than expected. This is due to conversion of time to jiffies: milliseconds
multiplied with HZ (ticks/second) gives out a value of jiffies with 10^3
greater. We need to also divide by 10^3 to obtain the right jiffies value.
In other words FRAME_INTERVAL_MILLI_SEC must be in seconds in order to
multiply by HZ and get the right jiffies value to add to the current
jiffies for the timeout expire time.

Fixes: 195ebc43bf76 ("[media] V4L: at91: add Atmel Image Sensor Interface (ISI) support")
Signed-off-by: Alexandre Kroupski <alexandre.kroupski@ingenico.com>
Reviewed-by: Eugen Hristev <eugen.hristev@microchip.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/atmel/atmel-isi.c