[media] omap3isp: resizer: Protect against races when updating crop
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Wed, 23 Jul 2014 13:30:57 +0000 (10:30 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Thu, 21 Aug 2014 20:25:17 +0000 (15:25 -0500)
commitcd73bb6c4e493cbe227f7861d96dd864a71fe5bc
treeba1e0d50a10acb630b0d36f85bff94586e81bae8
parentd903a0a367f3e0350a3ba1455c0a7c533977fb42
[media] omap3isp: resizer: Protect against races when updating crop

When updating the crop rectangle during streaming, the IRQ handler will
reprogram the resizer after the current frame. A race condition
currently exists between the set selection operation and the IRQ
handler: if the set selection operation is called twice in a row and the
IRQ handler runs only during the second call, it could reprogram the
hardware with partially updated values. Use a spinlock to protect
against that.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/platform/omap3isp/ispresizer.c
drivers/media/platform/omap3isp/ispresizer.h