Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 7d31e0c3 authored by Sudarshan Rajagopalan's avatar Sudarshan Rajagopalan Committed by Gerrit - the friendly Code Review server
Browse files

iommu/arm-smmu: avoid possible deadlock during map_sg



A possible deadlock could occur with the following flow:

    arm_smmu_map_sg()
    -->arm_smmu_secure_domain_lock()
    -->ops->map_sg() //this returns an error with ret = 0
    -->size_to_unmap = iova + size - __saved_iova_start;
    -->goto out;
    -->arm_smmu_assign_table()
    -->arm_smmu_unmap()
    ---->arm_smmu_secure_domain_lock() //DEADLOCKed!!!!!
    -------->mutex_lock()

The secure domain lock is needed to protect hyp assign and unassign.
Hence, its safe to call arm_smmu_secure_domain_unlock() after the
map and assign is done. Do this to avoid any runtime deadlocks.

Change-Id: I35effc170d8432d32c0cab3081be4897830d9212
Signed-off-by: default avatarSudarshan Rajagopalan <sudaraja@codeaurora.org>
Signed-off-by: default avatarSrinivasarao P <spathi@codeaurora.org>
parent 8b6bb29f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment