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

Commit 2cd5cec3 authored by Archana Sathyakumar's avatar Archana Sathyakumar
Browse files

msm-pm: Fix pc_debug_counter for 64bit kernel



Currently pc_debug_counter is 4 bytes value. On 64bit targets,
this is 8 bytes, causing it to print incorrect counter values.
Fix this counter to be long (4 bytes for 32bit/8 bytes for 64bit)
size.

Change-Id: Ife2596b4828e3c1210ba59cc8ea1924547d11d98
Signed-off-by: default avatarArchana Sathyakumar <asathyak@codeaurora.org>
parent 1fb7ca1e
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -639,7 +639,7 @@ static struct platform_driver msm_cpu_pm_snoc_client_driver = {
};

struct msm_pc_debug_counters_buffer {
	int *reg;
	long *reg;
	u32 len;
	char buf[MAX_BUF_SIZE];
};
@@ -673,7 +673,7 @@ static int msm_pc_debug_counters_copy(

		data->len += len;

		for (j = 0; j < MSM_PC_NUM_COUNTERS; j++) {
		for (j = 0; j < MSM_PC_NUM_COUNTERS - 1; j++) {
			stat = data->reg[offset + j];
			len = scnprintf(data->buf + data->len,
					 sizeof(data->buf) - data->len,
@@ -681,7 +681,11 @@ static int msm_pc_debug_counters_copy(

			data->len += len;
		}
		len = scnprintf(data->buf + data->len,
			 sizeof(data->buf) - data->len,
			"\n");

		data->len += len;
	}

	return data->len;
@@ -730,7 +734,7 @@ static int msm_pc_debug_counters_file_open(struct inode *inode,
	}

	buf = file->private_data;
	buf->reg = (int *)inode->i_private;
	buf->reg = (long *)inode->i_private;

	return 0;
}