ASoC: msm: qdsp6v2: Handle subsystem restart event
The LSM callback can receive event when subsystem restart happened.
In this case, payload doesn't contain valid pointer so shouldn't be
refered. Check opcode first and return if it indicates subsystem
restart.
CRs-Fixed: 487983
Change-Id: Ice130210f427eb27f587b15cf1cbfdc4ef1cee81
Signed-off-by: Kiran Kandi <kkandi@codeaurora.org>
diff --git a/sound/soc/msm/qdsp6v2/q6lsm.c b/sound/soc/msm/qdsp6v2/q6lsm.c
index 49e5ede..daa2916 100644
--- a/sound/soc/msm/qdsp6v2/q6lsm.c
+++ b/sound/soc/msm/qdsp6v2/q6lsm.c
@@ -83,6 +83,13 @@
return -EINVAL;
}
+ if (data->opcode == RESET_EVENTS) {
+ pr_debug("%s: SSR event received 0x%x, event 0x%x, proc 0x%x\n",
+ __func__, data->opcode, data->reset_event,
+ data->reset_proc);
+ return 0;
+ }
+
payload = data->payload;
pr_debug("%s: Session %d opcode 0x%x token 0x%x payload size %d\n",
__func__, client->session,
@@ -649,12 +656,21 @@
static int q6lsm_mmapcallback(struct apr_client_data *data, void *priv)
{
unsigned long flags;
- uint32_t sid = 0;
+ uint32_t command;
+ uint32_t retcode;
+ uint32_t sid;
const uint32_t *payload = data->payload;
- const uint32_t command = payload[0];
- const uint32_t retcode = payload[1];
struct lsm_client *client = NULL;
+ if (data->opcode == RESET_EVENTS) {
+ pr_debug("%s: SSR event received 0x%x, event 0x%x, proc 0x%x\n",
+ __func__, data->opcode, data->reset_event,
+ data->reset_proc);
+ return 0;
+ }
+
+ command = payload[0];
+ retcode = payload[1];
pr_debug("%s: opcode 0x%x command 0x%x return code 0x%x\n", __func__,
data->opcode, command, retcode);