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

Commit 976ee49d authored by Saranya Chidura's avatar Saranya Chidura
Browse files

coresight:byte-cntr: fix the byte-counter of ETR



When ETR byte-cntr is enabled, ETR triggers an interrupt at
ETRBYTECNT. It indicates atleast 'block_size' bytes of data
is captured in DDR. The Byte-cntr is a 8-byte counter, so
the CSR register ETRBYTECNT is set to 'block_size/8'.

Change-Id: I62871b4a62216f35365ee490f6b0946a039e182e
Signed-off-by: default avatarSaranya Chidura <schidura@codeaurora.org>
parent be5c1d18
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -268,8 +268,12 @@ static int tmc_etr_byte_cntr_open(struct inode *in, struct file *fp)
		return -EINVAL;
	}

	/* IRQ is a '8- byte' counter and to observe interrupt at
	 * 'block_size' bytes of data
	 */
	coresight_csr_set_byte_cntr(byte_cntr_data->csr,
				byte_cntr_data->block_size);
				(byte_cntr_data->block_size) / 8);

	fp->private_data = byte_cntr_data;
	nonseekable_open(in, fp);
	byte_cntr_data->enable = true;
+6 −1
Original line number Diff line number Diff line
@@ -487,8 +487,13 @@ static ssize_t block_size_store(struct device *dev,
	if (!drvdata->byte_cntr)
		return -EINVAL;

	if (val && val < 16) {
		pr_err("Assign minimum block size of 16 bytes\n");
		return -EINVAL;
	}

	mutex_lock(&drvdata->byte_cntr->byte_cntr_lock);
	drvdata->byte_cntr->block_size = val * 8;
	drvdata->byte_cntr->block_size = val;
	mutex_unlock(&drvdata->byte_cntr->byte_cntr_lock);

	return size;