diff options
| author | Linux Build Service Account <lnxbuild@quicinc.com> | 2017-04-27 07:06:52 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-04-27 07:06:51 -0700 |
| commit | 9d9b16e021b32fe2bb7144ae8d081e8c139d3a74 (patch) | |
| tree | 0b2f52278a5c3e3ac354953237ab18e96f15addb | |
| parent | dfa58d63ec3f64031b016f67271e75096a610304 (diff) | |
| parent | bdea399022683d0ac0fc582218c0d5517887416d (diff) | |
Merge "msm: ipa: fix IPC low priority logging"
| -rw-r--r-- | drivers/platform/msm/ipa/ipa_v2/ipa_debugfs.c | 20 | ||||
| -rw-r--r-- | drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c | 17 |
2 files changed, 17 insertions, 20 deletions
diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_debugfs.c b/drivers/platform/msm/ipa/ipa_v2/ipa_debugfs.c index 8d2213f30ec2..e48c19c522a7 100644 --- a/drivers/platform/msm/ipa/ipa_v2/ipa_debugfs.c +++ b/drivers/platform/msm/ipa/ipa_v2/ipa_debugfs.c @@ -123,6 +123,7 @@ static struct dentry *dfile_ipa_poll_iteration; static char dbg_buff[IPA_MAX_MSG_LEN]; static char *active_clients_buf; static s8 ep_reg_idx; +static void *ipa_ipc_low_buff; int _ipa_read_gen_reg_v1_1(char *buff, int max_len) { @@ -1823,23 +1824,20 @@ static ssize_t ipa_enable_ipc_low(struct file *file, if (kstrtos8(dbg_buff, 0, &option)) return -EFAULT; + mutex_lock(&ipa_ctx->lock); if (option) { - if (!ipa_ctx->logbuf_low) { - ipa_ctx->logbuf_low = + if (!ipa_ipc_low_buff) { + ipa_ipc_low_buff = ipc_log_context_create(IPA_IPC_LOG_PAGES, "ipa_low", 0); + if (ipa_ipc_low_buff == NULL) + IPAERR("failed to get logbuf_low\n"); } - - if (ipa_ctx->logbuf_low == NULL) { - IPAERR("failed to get logbuf_low\n"); - return -EFAULT; - } - + ipa_ctx->logbuf_low = ipa_ipc_low_buff; } else { - if (ipa_ctx->logbuf_low) - ipc_log_context_destroy(ipa_ctx->logbuf_low); - ipa_ctx->logbuf_low = NULL; + ipa_ctx->logbuf_low = NULL; } + mutex_unlock(&ipa_ctx->lock); return count; } diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c b/drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c index 17e6973b807f..72eb3808c7a4 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa_debugfs.c @@ -106,6 +106,7 @@ static char dbg_buff[IPA_MAX_MSG_LEN]; static char *active_clients_buf; static s8 ep_reg_idx; +static void *ipa_ipc_low_buff; static ssize_t ipa3_read_gen_reg(struct file *file, char __user *ubuf, @@ -1778,22 +1779,20 @@ static ssize_t ipa3_enable_ipc_low(struct file *file, if (kstrtos8(dbg_buff, 0, &option)) return -EFAULT; + mutex_lock(&ipa3_ctx->lock); if (option) { - if (!ipa3_ctx->logbuf_low) { - ipa3_ctx->logbuf_low = + if (!ipa_ipc_low_buff) { + ipa_ipc_low_buff = ipc_log_context_create(IPA_IPC_LOG_PAGES, "ipa_low", 0); } - - if (ipa3_ctx->logbuf_low == NULL) { - IPAERR("failed to get logbuf_low\n"); - return -EFAULT; - } + if (ipa_ipc_low_buff == NULL) + IPAERR("failed to get logbuf_low\n"); + ipa3_ctx->logbuf_low = ipa_ipc_low_buff; } else { - if (ipa3_ctx->logbuf_low) - ipc_log_context_destroy(ipa3_ctx->logbuf_low); ipa3_ctx->logbuf_low = NULL; } + mutex_unlock(&ipa3_ctx->lock); return count; } |
