[media] marvell-cam: fix the green screen of death
authorJonathan Corbet <corbet@lwn.net>
Fri, 16 Mar 2012 22:14:53 +0000 (19:14 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 20 Mar 2012 01:16:19 +0000 (22:16 -0300)
commit121bbe254a46e075673e6b9eec5613ea16400ccc
treee263df14121003ed7e78eeec82ac3eaa61643fba
parent482d35c41f2efb0408624e222bbc9efc0b3518eb
[media] marvell-cam: fix the green screen of death

I had learned through hard experience that dinking around with the DMA
descriptors while the C1_DESC_ENA enable bit was set is a recipe for all
kinds of truly malicious behavior on the hardware's part, regardless of
whether the DMA engine is actually operating at the time.  That
notwithstanding, the driver did so dink, resulting in "green frame"
captures and the death of the system in random, spectacular ways.

Move the tweaking of C1_DESC_ENA to the same function that sets the
descriptor so we know that we'll never try to set a descriptor while that
bit is set.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/marvell-ccic/mcam-core.c