From: John Keeping Date: Wed, 1 Jun 2016 15:46:10 +0000 (+0100) Subject: UPSTREAM: iommu/rockchip: Fix zap cache during device attach X-Git-Tag: firefly_0821_release~1214 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2c0c5d4368414c16f1ed2823b9b6fe15d0f979be;p=firefly-linux-kernel-4.4.55.git UPSTREAM: 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@vger.kernel.org Signed-off-by: John Keeping Tested-by: Heiko Stuebner Reviewed-by: Heiko Stuebner Signed-off-by: Joerg Roedel (cherry picked from commit ae8a7910fb0568531033bd6ebe65590f7a4fa6e2) Change-Id: I5d6f5dd49ad0f79facee8d345c5058af80226f83 Signed-off-by: Jeffy Chen --- diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index 0b7dbf1ae3ed..6c907698c9d1 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -822,7 +822,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); }