aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2012-03-16 18:14:52 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-03-19 21:15:51 -0400
commit482d35c41f2efb0408624e222bbc9efc0b3518eb (patch)
tree2465380fce219dd1488008a5802fa4fbfde84605 /drivers/media
parent0770d07f7b33081f68f8d7a291395005d7044c6b (diff)
[media] marvell-cam: Increase the DMA shutdown timeout
Experience shows that, on the Armada platform, it can take as much as 120ms for the DMA engine to actually shut down after it has been told to. So a 40ms timeout is not adequate; use 150ms instead. Also make sure we don't leave the DMA_ACTIVE flag set once things are down. Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/marvell-ccic/mcam-core.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/media/video/marvell-ccic/mcam-core.c b/drivers/media/video/marvell-ccic/mcam-core.c
index b26118246763..050724f8d3e6 100644
--- a/drivers/media/video/marvell-ccic/mcam-core.c
+++ b/drivers/media/video/marvell-ccic/mcam-core.c
@@ -742,7 +742,14 @@ static void mcam_ctlr_stop_dma(struct mcam_camera *cam)
742 mcam_ctlr_stop(cam); 742 mcam_ctlr_stop(cam);
743 cam->state = S_IDLE; 743 cam->state = S_IDLE;
744 spin_unlock_irqrestore(&cam->dev_lock, flags); 744 spin_unlock_irqrestore(&cam->dev_lock, flags);
745 msleep(40); 745 /*
746 * This is a brutally long sleep, but experience shows that
747 * it can take the controller a while to get the message that
748 * it needs to stop grabbing frames. In particular, we can
749 * sometimes (on mmp) get a frame at the end WITHOUT the
750 * start-of-frame indication.
751 */
752 msleep(150);
746 if (test_bit(CF_DMA_ACTIVE, &cam->flags)) 753 if (test_bit(CF_DMA_ACTIVE, &cam->flags))
747 cam_err(cam, "Timeout waiting for DMA to end\n"); 754 cam_err(cam, "Timeout waiting for DMA to end\n");
748 /* This would be bad news - what now? */ 755 /* This would be bad news - what now? */
@@ -885,6 +892,7 @@ static int mcam_read_setup(struct mcam_camera *cam)
885 * Turn it loose. 892 * Turn it loose.
886 */ 893 */
887 spin_lock_irqsave(&cam->dev_lock, flags); 894 spin_lock_irqsave(&cam->dev_lock, flags);
895 clear_bit(CF_DMA_ACTIVE, &cam->flags);
888 mcam_reset_buffers(cam); 896 mcam_reset_buffers(cam);
889 mcam_ctlr_irq_enable(cam); 897 mcam_ctlr_irq_enable(cam);
890 cam->state = S_STREAMING; 898 cam->state = S_STREAMING;