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

Commit 2c6fd882 authored by Mulu He's avatar Mulu He Committed by Gerrit - the friendly Code Review server
Browse files

coresight: tmc: Fix buffer size can't change issue



The sysfs interface "buffer_size" is not workable due to drvdata->etr_buf
is valid. When the buffer size changed by userspace, the memory did not
re-allocated. To fix this free allocated memory when ETR sink is disabled.

Change-Id: I3a8b85408a60c4f54a2ff5b6ac83236ed1c985c5
Signed-off-by: default avatarMulu He <muluhe@codeaurora.org>
parent 0e75c141
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1147,6 +1147,9 @@ static void tmc_disable_etr_sink(struct coresight_device *csdev)
		tmc_etr_byte_cntr_stop(drvdata->byte_cntr);
		coresight_cti_unmap_trigin(drvdata->cti_reset, 2, 0);
		coresight_cti_unmap_trigout(drvdata->cti_flush, 3, 0);
		/* Free memory outside the spinlock if need be */
		if (drvdata->etr_buf)
			tmc_etr_free_sysfs_buf(drvdata->etr_buf);
	}
	mutex_unlock(&drvdata->mem_lock);
	dev_info(drvdata->dev, "TMC-ETR disabled\n");