From: Arnd Bergmann Date: Thu, 2 Jan 2014 12:07:29 +0000 (-0300) Subject: upstream: [media] omap_vout: avoid sleep_on race X-Git-Tag: submit/tizen/20141121.110247~1430 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=11a6ca7625a21c9f522adc35ae314ddf91d12dbe;p=platform%2Fkernel%2Flinux-3.10.git upstream: [media] omap_vout: avoid sleep_on race sleep_on and its variants are broken and going away soon. This changes the omap vout driver to use wait_event_interruptible_timeout instead, which fixes potential race where the dma is complete before we schedule. [hans.verkuil@cisco.com: replaced interruptible_sleep_on_timeout by wait_event_interruptible_timeout in the commit msg, obvious typo] Signed-off-by: Arnd Bergmann Cc: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/omap/omap_vout_vrfb.c b/drivers/media/platform/omap/omap_vout_vrfb.c index cf1c437..62e7e57 100644 --- a/drivers/media/platform/omap/omap_vout_vrfb.c +++ b/drivers/media/platform/omap/omap_vout_vrfb.c @@ -270,7 +270,8 @@ int omap_vout_prepare_vrfb(struct omap_vout_device *vout, omap_dma_set_global_params(DMA_DEFAULT_ARB_RATE, 0x20, 0); omap_start_dma(tx->dma_ch); - interruptible_sleep_on_timeout(&tx->wait, VRFB_TX_TIMEOUT); + wait_event_interruptible_timeout(tx->wait, tx->tx_status == 1, + VRFB_TX_TIMEOUT); if (tx->tx_status == 0) { omap_stop_dma(tx->dma_ch);