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

Commit 81d63049 authored by Mao Jinlong's avatar Mao Jinlong
Browse files

byte-cntr: Don't write csr register when byte-cntr is disabled



It is possible that byte-cntr release happens after byte-cntr is disabled.
Don't write csr register when byte-cntr is disabled to avoid the register
access issue.

Change-Id: Ic818107e1bcbe31e1a55cdc8c0f6ff89ff70564f
Signed-off-by: default avatarMao Jinlong <jinlmao@codeaurora.org>
Signed-off-by: default avatarYuanfang Zhang <zhangyuanfang@codeaurora.org>
parent 71add667
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -181,6 +181,7 @@ static int tmc_etr_byte_cntr_release(struct inode *in, struct file *fp)
	mutex_lock(&byte_cntr_data->byte_cntr_lock);
	byte_cntr_data->read_active = false;

	if (byte_cntr_data->enable)
		coresight_csr_set_byte_cntr(byte_cntr_data->csr, 0);
	mutex_unlock(&byte_cntr_data->byte_cntr_lock);