Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4cbbb38 authored by Skylar Chang's avatar Skylar Chang
Browse files

msm: ipa: fix IPC low priority logging



Allocate IPC low priority on first usage only.

Change-Id: I69eb7e94e85f1a0ad36ebd6e5f2bf25d3b951bcf
CRs-Fixed: 2016076
Acked-by: default avatarAdy Abraham <adya@qti,qualcomm.com>
Signed-off-by: default avatarSkylar Chang <chiaweic@codeaurora.org>
parent 4728a0a0
Loading
Loading
Loading
Loading
+9 −11
Original line number Diff line number Diff line
@@ -132,6 +132,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)
{
@@ -1834,23 +1835,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_ctx->logbuf_low == NULL) {
			if (ipa_ipc_low_buff == 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;
	}
	mutex_unlock(&ipa_ctx->lock);

	return count;
}