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

Commit 2881fd89 authored by Saranya Chidura's avatar Saranya Chidura Committed by Gerrit - the friendly Code Review server
Browse files

coresight-byte-cntr: Fix the Byte-Counter read operation



The tmc struct has two entries: memtype and mem_type. Where
mem_type attribute contains the mem_type sysfs node value
and memtype attribute contains the ETR mode of operation
chosen at the etr memory allocation. The byte cntr read
operation should use the memtype value.

Change-Id: Ia9c8bdfa858e85ba777217806625a156960932b3
Signed-off-by: default avatarSaranya Chidura <schidura@codeaurora.org>
parent 2b6a49e9
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@ static ssize_t tmc_etr_byte_cntr_read(struct file *fp, char __user *data,
				goto err0;
		}

		if (tmcdrvdata->mem_type == TMC_ETR_MEM_TYPE_CONTIG)
		if (tmcdrvdata->memtype == TMC_ETR_MEM_TYPE_CONTIG)
			tmc_etr_read_bytes(byte_cntr_data, ppos,
					   byte_cntr_data->block_size, &len,
					   &bufp);
@@ -173,7 +173,7 @@ static ssize_t tmc_etr_byte_cntr_read(struct file *fp, char __user *data,

	} else {
		if (!atomic_read(&byte_cntr_data->irq_cnt)) {
			if (tmcdrvdata->mem_type == TMC_ETR_MEM_TYPE_CONTIG)
			if (tmcdrvdata->memtype == TMC_ETR_MEM_TYPE_CONTIG)
				tmc_etr_flush_bytes(ppos,
						    byte_cntr_data->block_size,
						    &len);
@@ -185,7 +185,7 @@ static ssize_t tmc_etr_byte_cntr_read(struct file *fp, char __user *data,
			if (!len)
				goto err0;
		} else {
			if (tmcdrvdata->mem_type == TMC_ETR_MEM_TYPE_CONTIG)
			if (tmcdrvdata->memtype == TMC_ETR_MEM_TYPE_CONTIG)
				tmc_etr_read_bytes(byte_cntr_data, ppos,
						   byte_cntr_data->block_size,
						   &len, &bufp);