iommu: avoid taking iova_rbtree_lock twice
authorCong Wang <xiyou.wangcong@gmail.com>
Tue, 17 Nov 2020 10:25:34 +0000 (18:25 +0800)
committerWill Deacon <will@kernel.org>
Tue, 1 Dec 2020 21:04:56 +0000 (21:04 +0000)
commit3a651b3a27a1ee35879499ead3942dc854a20968
tree01c83fe3814ff00104395810a62ee6ff74e5596d
parent6fa3525b455ae1fde5b424907141b33651f137b0
iommu: avoid taking iova_rbtree_lock twice

Both find_iova() and __free_iova() take iova_rbtree_lock,
there is no reason to take and release it twice inside
free_iova().

Fold them into one critical section by calling the unlock
versions instead.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Link: https://lore.kernel.org/r/1605608734-84416-5-git-send-email-john.garry@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/iova.c