From: Laurent Pinchart Date: Mon, 23 Jun 2014 21:00:22 +0000 (-0300) Subject: [media] v4l: vb2: Fix stream start and buffer completion race X-Git-Tag: omap-for-v3.17/fixes-against-rc2~155^2~325 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd994ddb2a12a3ff48cd549ec82cdceaea9614df;p=pandora-kernel.git [media] v4l: vb2: Fix stream start and buffer completion race videobuf2 stores the driver streaming state internally in the queue in the start_streaming_called variable. The state is set right after the driver start_stream operation returns, and checked in the vb2_buffer_done() function, typically called from the frame completion interrupt handler. A race condition exists if the hardware finishes processing the first frame before the start_stream operation returns. Fix this by setting start_streaming_called to 1 before calling the start_stream operation, and resetting it to 0 if the operation fails. Cc: stable@vger.kernel.org # for v3.15 and up Signed-off-by: Laurent Pinchart Reviewed-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- Reading git-diff-tree failed