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

Commit 3b553cc4 authored by Bhaumik Bhatt's avatar Bhaumik Bhatt
Browse files

mhi: cntrl: qcom: allow printing large strings to IPC logs



Large strings are truncated to 255 bytes by IPC logging API.
Allow for them to be printed in their entirety by using the
string separator API and split it using newline as the
delimiter.

Change-Id: If9ddbad7e9a9c30da57a733c94fb837c120f12ae
Signed-off-by: default avatarBhaumik Bhatt <bbhatt@codeaurora.org>
parent 6a0ab408
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -308,12 +308,22 @@ static void mhi_bl_dl_cb(struct mhi_device *mhi_device,
	struct mhi_dev *mhi_dev = mhi_controller_get_devdata(mhi_cntrl);
	struct arch_info *arch_info = mhi_dev->arch_info;
	char *buf = mhi_result->buf_addr;
	char *token, *delim = "\n";

	/* force a null at last character */
	buf[mhi_result->bytes_xferd - 1] = 0;

	if (mhi_result->bytes_xferd >= MAX_MSG_SIZE) {
		do {
			token = strsep((char **)&buf, delim);
			if (token)
				ipc_log_string(arch_info->boot_ipc_log, "%s %s",
					       DLOG, token);
		} while (token);
	} else {
		ipc_log_string(arch_info->boot_ipc_log, "%s %s", DLOG, buf);
	}
}

static void mhi_bl_dummy_cb(struct mhi_device *mhi_dev,
			    struct mhi_result *mhi_result)