Skip to contentSkip to conversation

iommu/tegra: smmu: Remove unnecessary PTC/TLB flush all

PATCH Applied Hiroshi Doyu 3 participants 5 messages Nov 28, 2012 – Nov 30, 2012 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 iommu/tegra: smmu: Remove unnecessary PTC/TLB flush all

smmu_flush_regs() does TLB/PTC flush all when freeing a second level page table. This isn't necessay at all since each pte entry has been already maintained by address in the above flush_ptc_and_tlb().

---
 drivers/iommu/tegra-smmu.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iommu/tegra-smmu.c +1 -3
index 4167863..46f5712 100644
@@ -694,10 +694,8 @@ static void __smmu_iommu_unmap(struct smmu_as *as, dma_addr_t iova)
 	*pte = _PTE_VACANT(iova);
 	FLUSH_CPU_DCACHE(pte, page, sizeof(*pte));
 	flush_ptc_and_tlb(as->smmu, as, iova, pte, page, 0);
-	if (!--(*count)) {
+	if (!--(*count))
 		free_ptbl(as, iova);
-		smmu_flush_regs(as->smmu, 0);
-	}
 }
 
 static void __smmu_iommu_map_pfn(struct smmu_as *as, dma_addr_t iova,
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/3 iommu/tegra: gart: Move bus_set_iommu after probe for multi arch

In reply to a message not in the archive

For a single image to support multiple SoCs(GART/SMMU).

---
 drivers/iommu/tegra-gart.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/tegra-gart.c +1 -1
index c16e8fc..4c9db62 100644
@@ -398,6 +398,7 @@ static int tegra_gart_probe(struct platform_device *pdev)
 	do_gart_setup(gart, NULL);
 
 	gart_handle = gart;
+	bus_set_iommu(&platform_bus_type, &gart_iommu_ops);
 	return 0;
 
 fail:
@@ -450,7 +451,6 @@ static struct platform_driver tegra_gart_driver = {
 
 static int __devinit tegra_gart_init(void)
 {
-	bus_set_iommu(&platform_bus_type, &gart_iommu_ops);
 	return platform_driver_register(&tegra_gart_driver);
 }
 
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 3/3 iommu/tegra: smmu: Move bus_set_iommu after probe for multi arch

In reply to a message not in the archive

For a single image to support multiple SoCs(GART/SMMU).

---
 drivers/iommu/tegra-smmu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/tegra-smmu.c +1 -1
index 46f5712..608185b 100644
@@ -1229,6 +1229,7 @@ static int tegra_smmu_probe(struct platform_device *pdev)
 
 	smmu_debugfs_create(smmu);
 	smmu_handle = smmu;
+	bus_set_iommu(&platform_bus_type, &smmu_iommu_ops);
 	return 0;
 }
 
@@ -1273,7 +1274,6 @@ static struct platform_driver tegra_smmu_driver = {
 
 static int __devinit tegra_smmu_init(void)
 {
-	bus_set_iommu(&platform_bus_type, &smmu_iommu_ops);
 	return platform_driver_register(&tegra_smmu_driver);
 }
 
Signature · 1 line
1.7.9.5
#5 lore raw

Re: [PATCH 3/3] iommu/tegra: smmu: Move bus_set_iommu after probe for multi arch

In reply to a message not in the archive
Quoted 2 lines · Hiroshi Doyu

For a single image to support multiple SoCs(GART/SMMU).

To be honest, I didn't get why we need to move "bus_set_iommu" to probe func. So could you add more words in the commit message? Same with tegra-gart.c.

Mark

Quoted 27 lines
---
 drivers/iommu/tegra-smmu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/tegra-smmu.c +1 -1
index 46f5712..608185b 100644
@@ -1229,6 +1229,7 @@ static int tegra_smmu_probe(struct platform_device *pdev)
 
 	smmu_debugfs_create(smmu);
 	smmu_handle = smmu;
+	bus_set_iommu(&platform_bus_type, &smmu_iommu_ops);
 	return 0;
 }
 
@@ -1273,7 +1274,6 @@ static struct platform_driver tegra_smmu_driver = {
 
 static int __devinit tegra_smmu_init(void)
 {
-	bus_set_iommu(&platform_bus_type, &smmu_iommu_ops);
 	return platform_driver_register(&tegra_smmu_driver);
 }