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

Commit 61105e04 authored by Satyajit Desai's avatar Satyajit Desai Committed by Rama Aparna Mallavarapu
Browse files

coresight-tmc-etr: Fix conditional check in TMC read



The current check will cause all of the ETR read
transactions to fail. Fix it so that we only
fail the read if byte-cntr is active.

Change-Id: I0d6ef03e692bebc8b775a399633b28c5a3158b0d
Signed-off-by: default avatarSatyajit Desai <sadesai@codeaurora.org>
Signed-off-by: default avatarRama Aparna Mallavarapu <aparnam@codeaurora.org>
parent 9533c9f7
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -251,7 +251,7 @@ struct byte_cntr *byte_cntr_init(struct amba_device *adev,
	if (byte_cntr_irq < 0)
		return NULL;

	byte_cntr_data = devm_kmalloc(dev, sizeof(*byte_cntr_data), GFP_KERNEL);
	byte_cntr_data = devm_kzalloc(dev, sizeof(*byte_cntr_data), GFP_KERNEL);
	if (!byte_cntr_data)
		return NULL;

@@ -273,7 +273,6 @@ struct byte_cntr *byte_cntr_init(struct amba_device *adev,
	}

	tmcdrvdata = drvdata;
	byte_cntr_data->block_size = 0;
	byte_cntr_data->byte_cntr_irq = byte_cntr_irq;
	atomic_set(&byte_cntr_data->irq_cnt, 0);
	init_waitqueue_head(&byte_cntr_data->wq);
+1 −1
Original line number Diff line number Diff line
@@ -611,7 +611,7 @@ int tmc_read_prepare_etr(struct tmc_drvdata *drvdata)
		goto out;
	}

	if (!drvdata->byte_cntr || drvdata->byte_cntr->enable) {
	if (drvdata->byte_cntr && drvdata->byte_cntr->enable) {
		ret = -EINVAL;
		goto out;
	}