From: Laurent Pinchart Date: Tue, 10 Jun 2014 13:26:28 +0000 (-0300) Subject: [media] omap3isp: ccdc: Don't timeout on stream off when the CCDC is stopped X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0b3fcd5727e835c60de46d33b2f5f5803c4a5de7;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git [media] omap3isp: ccdc: Don't timeout on stream off when the CCDC is stopped When the CCDC is already stopped due to a buffer underrun, the stop state machine won't advance in BT.656 mode as no interrupt are generated by the stopped CCDC in that mode. Handle this case explicitly in the ccdc_disable() function. Signed-off-by: Laurent Pinchart Tested-by: Enrico Butera Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/omap3isp/ispccdc.c b/drivers/media/platform/omap3isp/ispccdc.c index ff2ea2bf31e4..ec0a0e884c79 100644 --- a/drivers/media/platform/omap3isp/ispccdc.c +++ b/drivers/media/platform/omap3isp/ispccdc.c @@ -1320,6 +1320,8 @@ static void __ccdc_enable(struct isp_ccdc_device *ccdc, int enable) isp_reg_clr_set(isp, OMAP3_ISP_IOMEM_CCDC, ISPCCDC_PCR, ISPCCDC_PCR_EN, enable ? ISPCCDC_PCR_EN : 0); + + ccdc->running = enable; } static int ccdc_disable(struct isp_ccdc_device *ccdc) @@ -1330,6 +1332,8 @@ static int ccdc_disable(struct isp_ccdc_device *ccdc) spin_lock_irqsave(&ccdc->lock, flags); if (ccdc->state == ISP_PIPELINE_STREAM_CONTINUOUS) ccdc->stopping = CCDC_STOP_REQUEST; + if (!ccdc->running) + ccdc->stopping = CCDC_STOP_FINISHED; spin_unlock_irqrestore(&ccdc->lock, flags); ret = wait_event_timeout(ccdc->wait, diff --git a/drivers/media/platform/omap3isp/ispccdc.h b/drivers/media/platform/omap3isp/ispccdc.h index 731ecc768197..3440a7097940 100644 --- a/drivers/media/platform/omap3isp/ispccdc.h +++ b/drivers/media/platform/omap3isp/ispccdc.h @@ -124,6 +124,7 @@ struct ispccdc_lsc { * @lock: Serializes shadow_update with interrupt handler * @wait: Wait queue used to stop the module * @stopping: Stopping state + * @running: Is the CCDC hardware running * @ioctl_lock: Serializes ioctl calls and LSC requests freeing */ struct isp_ccdc_device { @@ -155,6 +156,7 @@ struct isp_ccdc_device { spinlock_t lock; wait_queue_head_t wait; unsigned int stopping; + bool running; struct mutex ioctl_lock; };