mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 08:07:32 -04:00
Merge "tmc-etr: Check if it is mode switch action during disable etr"
This commit is contained in:
commit
4b59da9515
1 changed files with 5 additions and 4 deletions
|
|
@ -1925,7 +1925,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);
|
||||
|
|
@ -1937,7 +1938,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;
|
||||
}
|
||||
|
|
@ -1985,7 +1986,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;
|
||||
}
|
||||
|
|
@ -2016,7 +2017,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)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue