• Yong Wu's avatar
    iommu/mediatek: Add a new tlb_lock for tlb_flush · da3cc91b
    Yong Wu authored
    The commit 4d689b61 ("iommu/io-pgtable-arm-v7s: Convert to IOMMU API
    TLB sync") help move the tlb_sync of unmap from v7s into the iommu
    framework. It helps add a new function "mtk_iommu_iotlb_sync", But it
    lacked the lock, then it will cause the variable "tlb_flush_active"
    may be changed unexpectedly, we could see this warning log randomly:
    
    mtk-iommu 10205000.iommu: Partial TLB flush timed out, falling back to
    full flush
    
    The HW requires tlb_flush/tlb_sync in pairs strictly, this patch adds
    a new tlb_lock for tlb operations to fix this issue.
    
    Fixes: 4d689b61 ("iommu/io-pgtable-arm-v7s: Convert to IOMMU API TLB sync")
    Signed-off-by: default avatarYong Wu <yong.wu@mediatek.com>
    Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
    da3cc91b
mtk_iommu.c 24.2 KB