dsp: increase the spf close all command timeout

While graph_open is processing by the SPF, apps receives
userspace(agm/pal) crash which will triggers spf_close_all
cmd from msm common drivers and immediately calls
msm_audio_ion_crash_handler() which will un-maps the memory. But
here SPF is still in processing the graph_open, recieved spf_close_all
cmd is queued in SPF. Due to un-mapping is done immediately in HLOS
will resulting in SMMU fault.

To avoid such scenarios, increased the spf_close_all cmd timeout,
because the AGM timeout for the graph_open is 4sec, so increase the timeout
for spf_close_all cmd response until graph open completes or timed out.

Change-Id: I67430cad5a55bd250ea110587c0ead2d97115efc
Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
This commit is contained in:
Prasad Kumpatla
2022-09-06 11:34:03 +05:30
committed by Gerrit - the friendly Code Review server
parent 2937a09ddc
commit a976c491a1

View File

@@ -26,6 +26,7 @@
#define APM_STATE_READY_TIMEOUT_MS 10000 #define APM_STATE_READY_TIMEOUT_MS 10000
#define Q6_READY_TIMEOUT_MS 1000 #define Q6_READY_TIMEOUT_MS 1000
#define Q6_CLOSE_ALL_TIMEOUT_MS 5000
#define APM_CMD_GET_SPF_STATE 0x01001021 #define APM_CMD_GET_SPF_STATE 0x01001021
#define APM_CMD_CLOSE_ALL 0x01001013 #define APM_CMD_CLOSE_ALL 0x01001013
#define APM_CMD_RSP_GET_SPF_STATE 0x02001007 #define APM_CMD_RSP_GET_SPF_STATE 0x02001007
@@ -239,8 +240,20 @@ void spf_core_apm_close_all(void)
goto done; goto done;
} }
/* While graph_open is processing by the SPF, apps receives
* userspace(agm/pal) crash which will triggers spf_close_all
* cmd from msm common drivers and immediately calls
* msm_audio_ion_crash_handler() which will un-maps the memory. But
* here SPF is still in processing the graph_open, recieved spf_close_all
* cmd is queued in SPF. Due to un-mapping is done immediately in HLOS
* will resulting in SMMU fault.
* To avoid such scenarios, increased the spf_close_all cmd timeout,
* because the AGM timeout for the graph_open is 4sec, so increase the timeout
* for spf_close_all cmd response until graph open completes or timed out.
*/
rc = wait_event_timeout(core->wait, (core->resp_received), rc = wait_event_timeout(core->wait, (core->resp_received),
msecs_to_jiffies(Q6_READY_TIMEOUT_MS)); msecs_to_jiffies(Q6_CLOSE_ALL_TIMEOUT_MS));
dev_info_ratelimited(spf_core_priv->dev, "%s: wait event unblocked \n", __func__); dev_info_ratelimited(spf_core_priv->dev, "%s: wait event unblocked \n", __func__);
if (rc > 0 && core->resp_received) { if (rc > 0 && core->resp_received) {
if (core->status != 0) if (core->status != 0)