Skip to contentSkip to conversation

iommu/rockchip: fix zap cache during device attach

PATCH RESEND Applied John Keeping 3 participants 3 messages Jun 1, 2016 – Jun 15, 2016

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

PATCH RESEND 1/1 iommu/rockchip: fix zap cache during device attach

rk_iommu_command() takes a struct rk_iommu and iterates over the slave MMUs, so this is doubly wrong in that we're passing in the wrong pointer and talking to MMUs that we shouldn't be.

Fixes cd6438c5f844 ("iommu/rockchip: Reconstruct to support multi slaves")
Cc stable at vger.kernel.org

---
The original was sent just before the merge window [0]. The only changes are to the commit message:

* add Cc: stable
* add Heiko's {Tested,Reviewed}-by

[0] http://article.gmane.org/gmane.linux.kernel.iommu/13556

 drivers/iommu/rockchip-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/rockchip-iommu.c +1 -1
index c7d6156ff536..25b4627cb57f 100644
@@ -815,7 +815,7 @@ static int rk_iommu_attach_device(struct iommu_domain *domain,
 	dte_addr = virt_to_phys(rk_domain->dt);
 	for (i = 0; i < iommu->num_mmu; i++) {
 		rk_iommu_write(iommu->bases[i], RK_MMU_DTE_ADDR, dte_addr);
-		rk_iommu_command(iommu->bases[i], RK_MMU_CMD_ZAP_CACHE);
+		rk_iommu_base_command(iommu->bases[i], RK_MMU_CMD_ZAP_CACHE);
 		rk_iommu_write(iommu->bases[i], RK_MMU_INT_MASK, RK_MMU_IRQ_MASK);
 	}
 
Signature · 1 line
2.8.2.565.gdb84f68.dirty
maintainer
#1 lore raw

Hi Joerg,

Am Mittwoch, 1. Juni 2016, 16:46:10 schrieb John Keeping:

Quoted 9 lines

rk_iommu_command() takes a struct rk_iommu and iterates over the slave MMUs, so this is doubly wrong in that we're passing in the wrong pointer and talking to MMUs that we shouldn't be.

Fixes cd6438c5f844 ("iommu/rockchip: Reconstruct to support multi slaves")
Cc stable at vger.kernel.org

this definitly looks like material for 4.7-rc fixes to me. Could you take a look and maybe include it?

Thanks
Heiko

Quoted 24 lines

---
The original was sent just before the merge window [0]. The only changes are to the commit message:

* add Cc: stable
* add Heiko's {Tested,Reviewed}-by

[0] http://article.gmane.org/gmane.linux.kernel.iommu/13556

 drivers/iommu/rockchip-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/rockchip-iommu.c +1 -1
index c7d6156ff536..25b4627cb57f 100644
@@ -815,7 +815,7 @@ static int rk_iommu_attach_device(struct iommu_domain
 *domain, dte_addr = virt_to_phys(rk_domain->dt);
 	for (i = 0; i < iommu->num_mmu; i++) {
 		rk_iommu_write(iommu->bases[i], RK_MMU_DTE_ADDR, dte_addr);
-		rk_iommu_command(iommu->bases[i], RK_MMU_CMD_ZAP_CACHE);
+		rk_iommu_base_command(iommu->bases[i], RK_MMU_CMD_ZAP_CACHE);
 		rk_iommu_write(iommu->bases[i], RK_MMU_INT_MASK, RK_MMU_IRQ_MASK);
 	}
maintainer Applied
#2 lore raw
Quoted 2 lines · Heiko St?bner

this definitly looks like material for 4.7-rc fixes to me. Could you take a look and maybe include it?

Applied to my fixes branch, thanks.