msm: kgsl: Fix race condition in iommu secure context attach check
IOMMU secure context attach check should be guarded by device mutex.
In iommu map and unmap functions we are doing the attach check without
taking device mutex. This can lead to race condition where attach
check in iommu map/unmap succeeds and just after it iommu is detached
before iommu map/unmap is called leading to a case where we could be
mapping/unmapping to a secure pagetable with no iommu context attached.
Fix this by unconditionally taking an active count while mapping
and unmapping from secure context bank.
CRs-fixed: 719744
Change-Id: I372a70e7aa935676cf9adc01b0464d39b52262b6
Signed-off-by:
Tarun Karra <tkarra@codeaurora.org>
Loading
Please register or sign in to comment