ASoC: msm: q6dspv2: fix APR deregistration logic in ASM during ADSP SSR

When ADSP subsystem restart is triggered, apr_reset is called
from the ASM callback function, which internally calls
apr_deregister. At the same time, user space will clean up
all existing audio sessions when ADSP SSR happens. To avoid
any race condition, make sure only the ASM callback function
is allowed to handle the APR deregistration process, while the
other (session close) skips the step.

CRs-fixed: 2022490
Change-Id: I0c395c19d177e66a03fbb4cee3dd4b34f84e2d10
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
1 file changed