]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: nau8824: Fix semaphore is released unexpectedly
authorSJLIN0 <SJLIN0@nuvoton.com>
Thu, 15 Sep 2022 01:28:00 +0000 (09:28 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 19 Sep 2022 17:35:23 +0000 (18:35 +0100)
commit3550d71bafe2b2001dca985a2f2d252426a9dab4
treee95b169369d21c6acd0ff935d0735ff1a6ae3c73
parentf161d0ff07ac8bb30e98a809b4aeef9d08e78146
ASoC: nau8824: Fix semaphore is released unexpectedly

On resuming, we anticipate that the jack is detected before playback
or capture. Therefore, we use semaphore to control the jack detection
done without any bothering. During booting, the driver launches jack
detection and releases the semaphore. However, it doesn't perceive the
maniputation of semaphore is not like resuming procedure. This makes
the semaphore's count value become to 2. There is more than one thread
can enter into the critical section. This may get unexpected situation
and make some chaos.

Signed-off-by: SJLIN0 <SJLIN0@nuvoton.com>
Signed-off-by: Wallace Lin <savagecin@gmail.com>
Link: https://lore.kernel.org/r/20220915012800.825196-1-SJLIN0@nuvoton.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/nau8824.c
sound/soc/codecs/nau8824.h