Commit dd33c2e7 authored by Srinivas Kandagatla's avatar Srinivas Kandagatla Committed by Mark Brown

ASoC: qcom: audioreach: fix ADSP ready check

currently q6apm_is_adsp_ready() will only return the cached value of
previous result. If we are unlucky and previous result is not-ready
then the caller will always get not-ready flag.

This is not correct, we should query the dsp of its current state in
irrespective of previous reported state.

Fixes: 47bc8cf6 ("ASoC: qdsp6: audioreach: Add ADSP ready check")
Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230209122806.18923-5-srinivas.kandagatla@linaro.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent aa759f3f
...@@ -145,14 +145,6 @@ static void q6apm_put_audioreach_graph(struct kref *ref) ...@@ -145,14 +145,6 @@ static void q6apm_put_audioreach_graph(struct kref *ref)
kfree(graph); kfree(graph);
} }
bool q6apm_is_adsp_ready(void)
{
if (g_apm && g_apm->state)
return true;
return false;
}
EXPORT_SYMBOL_GPL(q6apm_is_adsp_ready);
static int q6apm_get_apm_state(struct q6apm *apm) static int q6apm_get_apm_state(struct q6apm *apm)
{ {
...@@ -169,6 +161,15 @@ static int q6apm_get_apm_state(struct q6apm *apm) ...@@ -169,6 +161,15 @@ static int q6apm_get_apm_state(struct q6apm *apm)
return apm->state; return apm->state;
} }
bool q6apm_is_adsp_ready(void)
{
if (g_apm)
return q6apm_get_apm_state(g_apm);
return false;
}
EXPORT_SYMBOL_GPL(q6apm_is_adsp_ready);
static struct audioreach_module *__q6apm_find_module_by_mid(struct q6apm *apm, static struct audioreach_module *__q6apm_find_module_by_mid(struct q6apm *apm,
struct audioreach_graph_info *info, struct audioreach_graph_info *info,
uint32_t mid) uint32_t mid)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment