]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: arizona: Poll for FLL clock OK rather than use interrupts
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Tue, 25 Aug 2015 11:43:48 +0000 (12:43 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 25 Aug 2015 18:10:52 +0000 (19:10 +0100)
commite5af637a5bb681e1541e5c88e5f3833f3f064864
tree2a1d90acd807a03065a04692c0b220ff2277400e
parent9627b9c97fbeb99adda66f0a737b143adb3e62d1
ASoC: arizona: Poll for FLL clock OK rather than use interrupts

The extcon driver takes the DAPM mutex from within the interrupt thread
in several places, which makes it possible to get into a situation where
the interrupt thread is blocked waiting on the DAPM mutex whilst a DAPM
sequence is running which is attempting to configure the FLL. In this
case the FLL completion can't be completed as as the IRQ handler is
ONE_SHOT, which cause the FLL lock to use the full time out (250mS) and
report that the process timed out.

It is not really practical to make the extcon driver not take the DAPM
mutex from within the interrupt thread, at least not without extensive
modification. So this patch fixes the issue by switching the wait for
the FLL lock to polling. A few fast polls are done first as the FLL
should lock quickly for a good quality reference clock, (indeed it hits
on the first poll on my system) and it will poll every 20mS after that
until it times out.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
sound/soc/codecs/arizona.c
sound/soc/codecs/arizona.h