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

Commit afeee38b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "coresight: byte-cntr: stop reading byte-cntr when etr is diasbled"

parents 34f2473a 4f8e6413
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -237,6 +237,7 @@ void tmc_etr_byte_cntr_stop(struct byte_cntr *byte_cntr_data)

	mutex_lock(&byte_cntr_data->byte_cntr_lock);
	byte_cntr_data->enable = false;
	byte_cntr_data->read_active = false;
	coresight_csr_set_byte_cntr(byte_cntr_data->csr, 0);
	mutex_unlock(&byte_cntr_data->byte_cntr_lock);

@@ -264,7 +265,7 @@ static int tmc_etr_byte_cntr_open(struct inode *in, struct file *fp)

	mutex_lock(&byte_cntr_data->byte_cntr_lock);

	if (!tmcdrvdata->enable || !byte_cntr_data->block_size) {
	if (!byte_cntr_data->enable || !byte_cntr_data->block_size) {
		mutex_unlock(&byte_cntr_data->byte_cntr_lock);
		return -EINVAL;
	}
@@ -277,7 +278,6 @@ static int tmc_etr_byte_cntr_open(struct inode *in, struct file *fp)

	fp->private_data = byte_cntr_data;
	nonseekable_open(in, fp);
	byte_cntr_data->enable = true;
	byte_cntr_data->read_active = true;
	mutex_unlock(&byte_cntr_data->byte_cntr_lock);

+3 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012, 2017-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012, 2017-2019, The Linux Foundation. All rights reserved.
 *
 * Description: CoreSight Trace Memory Controller driver
 *
@@ -469,6 +469,8 @@ static ssize_t out_mode_store(struct device *dev,
		coresight_cti_unmap_trigout(drvdata->cti_flush, 3, 0);
		coresight_cti_unmap_trigin(drvdata->cti_reset, 2, 0);

		tmc_etr_byte_cntr_stop(drvdata->byte_cntr);

		drvdata->usbch = usb_qdss_open("qdss", drvdata,
					       usb_notifier);
		if (IS_ERR(drvdata->usbch)) {