iommu/arm-smmu: Add support for map/unmap to be atomic
Certain clients need map and unmap operations to be in the atomic context. This currently doesn't work since we need to prepare clocks and enable regulators (for tlb invalidation), and take a mutex (to protect the smmu_domain->smmu instance), which are all sleeping operations. Fix this by introducing a domain attribute to indicate that map and unmap should be atomic. When this domain attribute is set we assume: (1) clocks are already prepared (2) regulators are already on (3) the domain is attached to an SMMU (1) and (2) allow us to skip preparing clocks and enabling regulators during map and unmap and are taken care of internally in the driver. (3) is a contract with clients that allows us to skip taking the mutex that protects smmu_domain->smmu since we assume that the SMMU instance is valid and will not be going away. If clients break this contract then there are race conditions all over the place that will eventually result in a NULL dereference (specifically, of smmu_domain->smmu). Change-Id: I3e21df02f7b0cd116fb558715eea16f2119f1d03 Signed-off-by:Neeti Desai <neetid@codeaurora.org> Signed-off-by:
Mitchel Humpherys <mitchelh@codeaurora.org> Signed-off-by:
Patrick Daly <pdaly@codeaurora.org>
Loading
Please register or sign in to comment