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

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

Merge "coresight: tmc: clear has_iommu flag when smmu is bypassed"

parents 9540b205 d107ab8f
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -824,9 +824,22 @@ static struct etr_buf *tmc_alloc_etr_buf(struct tmc_drvdata *drvdata,
	bool has_sg, has_catu;
	struct etr_buf *etr_buf;
	struct device *dev = &drvdata->csdev->dev;
	int s1_bypass = 0;
	struct iommu_domain *domain;

	has_etr_sg = tmc_etr_has_cap(drvdata, TMC_ETR_SG);
	has_iommu = iommu_get_domain_for_dev(dev->parent);
	domain = iommu_get_domain_for_dev(dev->parent);
	if (domain) {
		iommu_domain_get_attr(domain, DOMAIN_ATTR_S1_BYPASS,
			&s1_bypass);
		if (s1_bypass)
			has_iommu = false;
		else
			has_iommu = true;
	} else {
		has_iommu = false;
	}

	has_catu = !!tmc_etr_get_catu_device(drvdata);

	has_sg = has_catu || has_etr_sg;