summaryrefslogtreecommitdiff
path: root/ipc
diff options
context:
space:
mode:
authorLaxminath Kasam <lkasam@codeaurora.org>2018-04-04 10:59:57 +0530
committerMeng Wang <mengw@codeaurora.org>2019-01-02 15:44:42 +0800
commitc910c02395f07a9f44ba0f40573f7bbebc163a2e (patch)
tree5c9b14bc47a85ced7fbdf96423c89fc73062253b /ipc
parent63f481553592839f2da47d70abb10d2253f7e13a (diff)
downloadmsm-extra-c910c02395f07a9f44ba0f40573f7bbebc163a2e.tar.gz
dsp: return ENETRESET error if apr is down
In SSR/PDR, return ENETRESET errno to propagate this failure to userspace. After audio HAL receives ENETRESET, it stops retry for pcm_open continuously. Rate limit the logs when apr send packet fails during PDR/SSR usecases to avoid watchdog timeouts. Change-Id: I03a80aef6ffedb4f15f953fff5213d6a3c9efc4b Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Diffstat (limited to 'ipc')
-rw-r--r--ipc/apr.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/ipc/apr.c b/ipc/apr.c
index d3ee38ea..ec05d3b1 100644
--- a/ipc/apr.c
+++ b/ipc/apr.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
- * Copyright (c) 2010-2014, 2016-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2010-2014, 2016-2019 The Linux Foundation. All rights reserved.
*/
#include <linux/kernel.h>
@@ -368,13 +368,13 @@ int apr_send_pkt(void *handle, uint32_t *buf)
return -EINVAL;
}
if (svc->need_reset) {
- pr_err("apr: send_pkt service need reset\n");
+ pr_err_ratelimited("apr: send_pkt service need reset\n");
return -ENETRESET;
}
if ((svc->dest_id == APR_DEST_QDSP6) &&
(apr_get_q6_state() != APR_SUBSYS_LOADED)) {
- pr_err("%s: Still dsp is not Up\n", __func__);
+ pr_err_ratelimited("%s: Still dsp is not Up\n", __func__);
return -ENETRESET;
} else if ((svc->dest_id == APR_DEST_MODEM) &&
(apr_get_modem_state() == APR_SUBSYS_DOWN)) {
@@ -388,7 +388,7 @@ int apr_send_pkt(void *handle, uint32_t *buf)
clnt = &client[dest_id][client_id];
if (!client[dest_id][client_id].handle) {
- pr_err("APR: Still service is not yet opened\n");
+ pr_err_ratelimited("APR: Still service is not yet opened\n");
spin_unlock_irqrestore(&svc->w_lock, flags);
return -EINVAL;
}
@@ -501,7 +501,7 @@ struct apr_svc *apr_register(char *dest, char *svc_name, apr_fn svc_fn,
if (dest_id == APR_DEST_QDSP6) {
if (apr_get_q6_state() != APR_SUBSYS_LOADED) {
- pr_err("%s: adsp not up\n", __func__);
+ pr_err_ratelimited("%s: adsp not up\n", __func__);
return NULL;
}
pr_debug("%s: adsp Up\n", __func__);
@@ -525,7 +525,7 @@ struct apr_svc *apr_register(char *dest, char *svc_name, apr_fn svc_fn,
}
if (apr_get_svc(svc_name, domain_id, &client_id, &svc_idx, &svc_id)) {
- pr_err("%s: apr_get_svc failed\n", __func__);
+ pr_err_ratelimited("%s: apr_get_svc failed\n", __func__);
goto done;
}
@@ -536,7 +536,7 @@ struct apr_svc *apr_register(char *dest, char *svc_name, apr_fn svc_fn,
APR_DL_SMD, apr_cb_func, NULL);
if (!clnt->handle) {
svc = NULL;
- pr_err("APR: Unable to open handle\n");
+ pr_err_ratelimited("APR: Unable to open handle\n");
mutex_unlock(&clnt->m_lock);
goto done;
}
@@ -547,7 +547,7 @@ struct apr_svc *apr_register(char *dest, char *svc_name, apr_fn svc_fn,
clnt->id = client_id;
if (svc->need_reset) {
mutex_unlock(&svc->m_lock);
- pr_err("APR: Service needs reset\n");
+ pr_err_ratelimited("APR: Service needs reset\n");
svc = NULL;
goto done;
}