asoc: codecs: fix race condition of core vote and reg access

Auto suspend timer for core vote is triggering before read write complete.
Move the auto suspend of core vote to post read write operation.

Change-Id: I619da358c7c42af45ef480ed0dba2c2cc26e9cc1
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
This commit is contained in:
Vatsal Bucha
2021-03-08 15:30:59 +05:30
committed by Gerrit - the friendly Code Review server
parent b9b9a51df2
commit eb27bf253d
3 changed files with 28 additions and 14 deletions

View File

@@ -657,6 +657,7 @@ done:
static int lpass_cdc_va_macro_core_vote(void *handle, bool enable)
{
int rc = 0;
struct lpass_cdc_va_macro_priv *va_priv =
(struct lpass_cdc_va_macro_priv *) handle;
@@ -666,14 +667,15 @@ static int lpass_cdc_va_macro_core_vote(void *handle, bool enable)
}
if (enable) {
pm_runtime_get_sync(va_priv->dev);
if (lpass_cdc_check_core_votes(va_priv->dev))
rc = 0;
else
rc = -ENOTSYNC;
} else {
pm_runtime_put_autosuspend(va_priv->dev);
pm_runtime_mark_last_busy(va_priv->dev);
}
if (lpass_cdc_check_core_votes(va_priv->dev))
return 0;
else
return -EINVAL;
return rc;
}
static int lpass_cdc_va_macro_swrm_clock(void *handle, bool enable)