mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 06:03:36 -04:00
coresight: tmc: clear has_iommu flag when smmu is bypassed
When SMMU works in bypass mode, set has_iommu to false. ETR can use SG mode. Change-Id: Ic7a6814cace92098473e4b5302408034e662058d Signed-off-by: Tingwei Zhang <tingwei@codeaurora.org> Signed-off-by: Mao Jinlong <jinlmao@codeaurora.org>
This commit is contained in:
parent
c58342fceb
commit
d107ab8fbd
1 changed files with 14 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue