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

Commit 5eb6f565 authored by Steven Cahail's avatar Steven Cahail
Browse files

ipc_logging: Allow logging to resume after device suspend



IPC log collection from userspace cannot resume after the
device is put into suspend mode, because 0 is returned to
userspace when this happens and is interpreted as EOF
(end-of-file).

Allow the signal generated during a suspend to be
propagated back to the userspace application, rather than
returning 0, so log collection can be resumed after a
suspend.

CRs-Fixed: 670289
Change-Id: I67cc4cc980d35bbdc3cbc521a3dd0c347be4abf4
Signed-off-by: default avatarSteven Cahail <scahail@codeaurora.org>
parent 65c7182d
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -37,6 +37,7 @@ static int debug_log(struct ipc_log_context *ilctxt,
		     char *buff, int size, int cont)
{
	int i = 0;
	int ret;

	if (size < MAX_MSG_DECODED_SIZE) {
		pr_err("%s: buffer size %d < %d\n", __func__, size,
@@ -46,9 +47,10 @@ static int debug_log(struct ipc_log_context *ilctxt,
	do {
		i = ipc_log_extract(ilctxt, buff, size - 1);
		if (cont && i == 0) {
			wait_for_completion_interruptible(&ilctxt->read_avail);
			if (signal_pending(current))
				break;
			ret = wait_for_completion_interruptible(
				&ilctxt->read_avail);
			if (ret < 0)
				return ret;
		}
	} while (cont && i == 0);