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

Commit 11822d11 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge changes Ia1763923,I0b903465,If4246dc2 into msm-4.14

* changes:
  coresight: tmc: Add SMMU S1 bypass support
  ARM: dts: coresight: Bypass SMMU for ETR
  coresight: etr: Lock mismatch in ETR
parents fdd4d7e3 dfc3a591
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -313,6 +313,7 @@
		      <0x6064000 0x15000>;
		reg-names = "tmc-base", "bam-base";

		qcom,smmu-s1-bypass;
		iommus = <&apps_smmu 0x05e0 0>;
		arm,buffer-size = <0x400000>;

+2 −4
Original line number Diff line number Diff line
@@ -376,10 +376,10 @@ static int tmc_enable_etr_sink_sysfs(struct coresight_device *csdev)
	 * If we don't have a buffer release the lock and allocate memory.
	 * Otherwise keep the lock and move along.
	 */
	mutex_lock(&drvdata->mem_lock);
	spin_lock_irqsave(&drvdata->spinlock, flags);
	if (!drvdata->vaddr) {
		spin_unlock_irqrestore(&drvdata->spinlock, flags);
		mutex_lock(&drvdata->mem_lock);

		if (drvdata->out_mode == TMC_ETR_OUT_MODE_MEM) {
			/*
@@ -417,9 +417,6 @@ static int tmc_enable_etr_sink_sysfs(struct coresight_device *csdev)

	if (drvdata->reading) {
		ret = -EBUSY;
		spin_unlock_irqrestore(&drvdata->spinlock, flags);
		mutex_unlock(&drvdata->mem_lock);
		return ret;
		goto out;
	}

@@ -518,6 +515,7 @@ static void tmc_disable_etr_sink(struct coresight_device *csdev)
	spin_lock_irqsave(&drvdata->spinlock, flags);
	if (drvdata->reading) {
		spin_unlock_irqrestore(&drvdata->spinlock, flags);
		mutex_unlock(&drvdata->mem_lock);
		return;
	}

+11 −0
Original line number Diff line number Diff line
@@ -461,6 +461,7 @@ static DEVICE_ATTR_RW(block_size);
static int tmc_iommu_init(struct tmc_drvdata *drvdata)
{
	struct device_node *node = drvdata->dev->of_node;
	int s1_bypass;
	int ret = 0;

	if (!of_property_read_bool(node, "iommus"))
@@ -474,6 +475,15 @@ static int tmc_iommu_init(struct tmc_drvdata *drvdata)
		goto iommu_map_err;
	}

	s1_bypass = of_property_read_bool(node, "qcom,smmu-s1-bypass");
	ret = iommu_domain_set_attr(drvdata->iommu_mapping->domain,
			DOMAIN_ATTR_S1_BYPASS, &s1_bypass);
	if (ret) {
		dev_err(drvdata->dev, "IOMMU set s1 bypass (%d) failed (%d)\n",
			s1_bypass, ret);
		goto iommu_attach_fail;
	}

	ret = arm_iommu_attach_device(drvdata->dev, drvdata->iommu_mapping);
	if (ret) {
		dev_err(drvdata->dev, "Attach device failed, err = %d\n", ret);
@@ -485,6 +495,7 @@ static int tmc_iommu_init(struct tmc_drvdata *drvdata)
iommu_attach_fail:
	arm_iommu_release_mapping(drvdata->iommu_mapping);
iommu_map_err:
	drvdata->iommu_mapping = NULL;
	return ret;
}