upstream: [media] arv: fix sleep_on race
authorArnd Bergmann <arnd@arndb.de>
Wed, 26 Feb 2014 11:01:48 +0000 (08:01 -0300)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:54:56 +0000 (11:54 +0900)
commit97ff984142608ed50ecb5956920fba1b0349d648
tree2508602de38464371a86ddf3c93cb47c53143cfd
parentf0cff693d6f99b25796f9d36a3946f9fb7d227d7
upstream: [media] arv: fix sleep_on race

interruptible_sleep_on is racy and going away. In the arv driver that
race has probably never caused problems since it would require a whole
video frame to be captured before the read function has a chance to
go to sleep, but using wait_event_interruptible lets us kill off the
old interface. In order to do this, we have to slightly adapt the
meaning of the ar->start_capture field to distinguish between not having
started a frame and having completed it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/platform/arv.c