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

Commit e117350b authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "tmc-etr: Check if it is mode switch action during disable etr"

parents 6f98876d a8ece7e3
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -1984,7 +1984,8 @@ static int tmc_enable_etr_sink(struct coresight_device *csdev,
	return -EINVAL;
}

static int _tmc_disable_etr_sink(struct coresight_device *csdev)
static int _tmc_disable_etr_sink(struct coresight_device *csdev,
			bool mode_switch)
{
	unsigned long flags;
	struct tmc_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent);
@@ -1996,7 +1997,7 @@ static int _tmc_disable_etr_sink(struct coresight_device *csdev)
		return -EBUSY;
	}

	if (atomic_dec_return(csdev->refcnt)) {
	if (atomic_dec_return(csdev->refcnt) && !mode_switch) {
		spin_unlock_irqrestore(&drvdata->spinlock, flags);
		return -EBUSY;
	}
@@ -2070,7 +2071,7 @@ static int tmc_disable_etr_sink(struct coresight_device *csdev)
	int ret;

	mutex_lock(&drvdata->mem_lock);
	ret = _tmc_disable_etr_sink(csdev);
	ret = _tmc_disable_etr_sink(csdev, false);
	mutex_unlock(&drvdata->mem_lock);
	return ret;
}
@@ -2101,7 +2102,7 @@ int tmc_etr_switch_mode(struct tmc_drvdata *drvdata, const char *out_mode)
	}

	coresight_disable_all_source_link();
	_tmc_disable_etr_sink(drvdata->csdev);
	_tmc_disable_etr_sink(drvdata->csdev, true);
	old_mode = drvdata->out_mode;
	drvdata->out_mode = new_mode;
	if (tmc_enable_etr_sink_sysfs(drvdata->csdev)) {