Commit 6e54919
ASoC: nau8821: Cancel jdet_work before handling jack ejection
The microphone detection work scheduled by a prior jack insertion
interrupt may still be in a pending state or under execution when a jack
ejection interrupt has been fired.
This might lead to a racing condition or nau8821_jdet_work() completing
after nau8821_eject_jack(), which will override the currently
disconnected state of the jack and incorrectly report the headphone or
the headset as being connected.
Cancel any pending jdet_work or wait for its execution to finish before
attempting to handle the ejection interrupt.
Proceed similarly before launching the eject handler as a consequence of
detecting an invalid insert interrupt.
Fixes: aab1ad1 ("ASoC: nau8821: new driver")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Link: https://patch.msgid.link/20251003-nau8821-jdet-fixes-v1-1-f7b0e2543f09@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>1 parent 3a86608 commit 6e54919
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1185 | 1185 | | |
1186 | 1186 | | |
1187 | 1187 | | |
| 1188 | + | |
1188 | 1189 | | |
1189 | 1190 | | |
1190 | 1191 | | |
| |||
1199 | 1200 | | |
1200 | 1201 | | |
1201 | 1202 | | |
| 1203 | + | |
1202 | 1204 | | |
1203 | 1205 | | |
1204 | 1206 | | |
1205 | 1207 | | |
1206 | | - | |
1207 | 1208 | | |
1208 | 1209 | | |
1209 | 1210 | | |
| |||
0 commit comments