Loading drivers/hwtracing/coresight/coresight-tmc-etr.c +9 −5 Original line number Original line Diff line number Diff line Loading @@ -2168,15 +2168,19 @@ int tmc_read_prepare_etr(struct tmc_drvdata *drvdata) goto out; goto out; } } drvdata->reading = true; /* Disable the TMC if we are trying to read from a running session */ /* Disable the TMC if we are trying to read from a running session */ if (drvdata->mode == CS_MODE_SYSFS) { if (drvdata->mode == CS_MODE_SYSFS) { spin_unlock_irqrestore(&drvdata->spinlock, flags); spin_unlock_irqrestore(&drvdata->spinlock, flags); mutex_unlock(&drvdata->mem_lock); coresight_disable_all_source_link(); coresight_disable_all_source_link(); mutex_lock(&drvdata->mem_lock); spin_lock_irqsave(&drvdata->spinlock, flags); spin_lock_irqsave(&drvdata->spinlock, flags); __tmc_etr_disable_hw(drvdata); __tmc_etr_disable_hw(drvdata); } } drvdata->reading = true; out: out: spin_unlock_irqrestore(&drvdata->spinlock, flags); spin_unlock_irqrestore(&drvdata->spinlock, flags); mutex_unlock(&drvdata->mem_lock); mutex_unlock(&drvdata->mem_lock); Loading Loading @@ -2204,10 +2208,6 @@ int tmc_read_unprepare_etr(struct tmc_drvdata *drvdata) * be NULL. * be NULL. */ */ __tmc_etr_enable_hw(drvdata); __tmc_etr_enable_hw(drvdata); spin_unlock_irqrestore(&drvdata->spinlock, flags); coresight_enable_all_source_link(); spin_lock_irqsave(&drvdata->spinlock, flags); } else { } else { /* /* * The ETR is not tracing and the buffer was just read. * The ETR is not tracing and the buffer was just read. Loading @@ -2224,5 +2224,9 @@ int tmc_read_unprepare_etr(struct tmc_drvdata *drvdata) tmc_etr_free_sysfs_buf(sysfs_buf); tmc_etr_free_sysfs_buf(sysfs_buf); mutex_unlock(&drvdata->mem_lock); mutex_unlock(&drvdata->mem_lock); if (drvdata->mode == CS_MODE_SYSFS) coresight_enable_all_source_link(); return 0; return 0; } } Loading
drivers/hwtracing/coresight/coresight-tmc-etr.c +9 −5 Original line number Original line Diff line number Diff line Loading @@ -2168,15 +2168,19 @@ int tmc_read_prepare_etr(struct tmc_drvdata *drvdata) goto out; goto out; } } drvdata->reading = true; /* Disable the TMC if we are trying to read from a running session */ /* Disable the TMC if we are trying to read from a running session */ if (drvdata->mode == CS_MODE_SYSFS) { if (drvdata->mode == CS_MODE_SYSFS) { spin_unlock_irqrestore(&drvdata->spinlock, flags); spin_unlock_irqrestore(&drvdata->spinlock, flags); mutex_unlock(&drvdata->mem_lock); coresight_disable_all_source_link(); coresight_disable_all_source_link(); mutex_lock(&drvdata->mem_lock); spin_lock_irqsave(&drvdata->spinlock, flags); spin_lock_irqsave(&drvdata->spinlock, flags); __tmc_etr_disable_hw(drvdata); __tmc_etr_disable_hw(drvdata); } } drvdata->reading = true; out: out: spin_unlock_irqrestore(&drvdata->spinlock, flags); spin_unlock_irqrestore(&drvdata->spinlock, flags); mutex_unlock(&drvdata->mem_lock); mutex_unlock(&drvdata->mem_lock); Loading Loading @@ -2204,10 +2208,6 @@ int tmc_read_unprepare_etr(struct tmc_drvdata *drvdata) * be NULL. * be NULL. */ */ __tmc_etr_enable_hw(drvdata); __tmc_etr_enable_hw(drvdata); spin_unlock_irqrestore(&drvdata->spinlock, flags); coresight_enable_all_source_link(); spin_lock_irqsave(&drvdata->spinlock, flags); } else { } else { /* /* * The ETR is not tracing and the buffer was just read. * The ETR is not tracing and the buffer was just read. Loading @@ -2224,5 +2224,9 @@ int tmc_read_unprepare_etr(struct tmc_drvdata *drvdata) tmc_etr_free_sysfs_buf(sysfs_buf); tmc_etr_free_sysfs_buf(sysfs_buf); mutex_unlock(&drvdata->mem_lock); mutex_unlock(&drvdata->mem_lock); if (drvdata->mode == CS_MODE_SYSFS) coresight_enable_all_source_link(); return 0; return 0; } }