diff options
author | Joerg Roedel <jroedel@suse.de> | 2017-08-22 16:35:15 +0200 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2017-08-22 16:35:15 +0200 |
commit | 894901b5c9433c6cdc2b997e4d35c1807572bd77 (patch) | |
tree | 4ad07e426c473e5cd7553421d5a0beb0f551cf70 /drivers/iommu/mtk_iommu.c | |
parent | memory: mtk-smi: Handle return value of clk_prepare_enable (diff) | |
parent | iommu: Fix wrong freeing of iommu_device->dev (diff) | |
download | linux-dev-894901b5c9433c6cdc2b997e4d35c1807572bd77.tar.xz linux-dev-894901b5c9433c6cdc2b997e4d35c1807572bd77.zip |
Merge branch 'iommu/fixes' into arm/mediatek
Diffstat (limited to 'drivers/iommu/mtk_iommu.c')
-rw-r--r-- | drivers/iommu/mtk_iommu.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 5d14cd15198d..91c6d367ab35 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -129,6 +129,7 @@ static void mtk_iommu_tlb_add_flush_nosync(unsigned long iova, size_t size, writel_relaxed(iova, data->base + REG_MMU_INVLD_START_A); writel_relaxed(iova + size - 1, data->base + REG_MMU_INVLD_END_A); writel_relaxed(F_MMU_INV_RANGE, data->base + REG_MMU_INVALIDATE); + data->tlb_flush_active = true; } static void mtk_iommu_tlb_sync(void *cookie) @@ -137,6 +138,10 @@ static void mtk_iommu_tlb_sync(void *cookie) int ret; u32 tmp; + /* Avoid timing out if there's nothing to wait for */ + if (!data->tlb_flush_active) + return; + ret = readl_poll_timeout_atomic(data->base + REG_MMU_CPE_DONE, tmp, tmp != 0, 10, 100000); if (ret) { @@ -146,6 +151,7 @@ static void mtk_iommu_tlb_sync(void *cookie) } /* Clear the CPE status */ writel_relaxed(0, data->base + REG_MMU_CPE_DONE); + data->tlb_flush_active = false; } static const struct iommu_gather_ops mtk_iommu_gather_ops = { |