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

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

Merge "coresight: tmc-etr: fix etr enable issue"

parents d3c620bf 3ffa1531
Loading
Loading
Loading
Loading
+17 −6
Original line number Diff line number Diff line
@@ -1997,12 +1997,22 @@ static int _tmc_disable_etr_sink(struct coresight_device *csdev)
	WARN_ON_ONCE(drvdata->mode == CS_MODE_DISABLED);
	if (drvdata->mode != CS_MODE_DISABLED) {
		if (drvdata->out_mode == TMC_ETR_OUT_MODE_USB) {
			if (!drvdata->byte_cntr->sw_usb) {
				__tmc_etr_disable_to_bam(drvdata);
			spin_unlock_irqrestore(&drvdata->spinlock, flags);
				spin_unlock_irqrestore(&drvdata->spinlock,
					flags);
				tmc_etr_bam_disable(drvdata);
				usb_qdss_close(drvdata->usbch);
				drvdata->usbch = NULL;
				drvdata->mode = CS_MODE_DISABLED;
				goto out;
			} else {
				spin_unlock_irqrestore(&drvdata->spinlock,
					flags);
				usb_qdss_close(drvdata->usbch);
				spin_lock_irqsave(&drvdata->spinlock, flags);
				tmc_etr_disable_hw(drvdata);
			}
		} else {
			tmc_etr_disable_hw(drvdata);
		}
@@ -2021,6 +2031,7 @@ static int _tmc_disable_etr_sink(struct coresight_device *csdev)
		&& drvdata->byte_cntr->sw_usb) {
		usb_bypass_stop(drvdata->byte_cntr);
		flush_workqueue(drvdata->byte_cntr->usb_wq);
		drvdata->usbch = NULL;
		coresight_cti_unmap_trigin(drvdata->cti_reset, 2, 0);
		coresight_cti_unmap_trigout(drvdata->cti_flush, 3, 0);
		/* Free memory outside the spinlock if need be */