[media] sur40: fix occasional hard freeze due to buffer queue underrun
authorFlorian Echtler <floe@butterbrot.org>
Tue, 31 Mar 2015 09:43:28 +0000 (06:43 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Wed, 8 Apr 2015 09:28:56 +0000 (06:28 -0300)
commitc2529908a1905cd8b76bed0a6039975226cb24eb
treee6dba3f1a48f4d54cf060ee77f00a9e623dd6239
parentaf7f388e7452e1707f862378f38a0372c6c33728
[media] sur40: fix occasional hard freeze due to buffer queue underrun

This patch fixes a kernel panic which occurs when buf_list is empty. This can
happen occasionally when user space is under heavy load (e.g. due to image
processing on the CPU) and new buffers aren't re-queued fast enough. In that
case, vb2_start_streaming_called can return true, but when the spinlock
is taken and sur40_poll attempts to fetch the next buffer from buf_list, the
list is in fact empty.

This patch needs to be applied on top of the queued one adding V4L2 support
to the sur40 driver.

Signed-off-by: Florian Echtler <floe@butterbrot.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/input/touchscreen/sur40.c