mfd: Clean up after WM83xx AUXADC interrupt if it arrives late
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 2 Apr 2010 12:08:39 +0000 (13:08 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 13 May 2010 10:58:55 +0000 (12:58 +0200)
commit5051d411ec87381693433d24c4488b2fa4a6306c
tree82ddb281a3bb02163af1041db8e1769274ba9814
parentbe835674b55324c1abe973b15343c3663910c620
mfd: Clean up after WM83xx AUXADC interrupt if it arrives late

In certain circumstances, especially under heavy load, the AUXADC
completion interrupt may be detected after we've timed out waiting for
it.  That conversion would still succeed but the next conversion will
see the completion that was signalled by the interrupt for the previous
conversion and therefore not wait for the AUXADC conversion to run,
causing it to report failure.

Provide a simple, non-invasive cleanup by using try_wait_for_completion()
to ensure that the completion is not signalled before we wait.  Since
the AUXADC is run within a mutex we know there can only have been at
most one AUXADC interrupt outstanding.  A more involved change should
follow for the next merge window.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/wm831x-core.c
drivers/mfd/wm8350-core.c