]> git.itanic.dy.fi Git - linux-stable/commit
iommu/arm-smmu: really fix page table locking
authorWill Deacon <will.deacon@arm.com>
Tue, 4 Feb 2014 22:12:42 +0000 (22:12 +0000)
committerJiri Slaby <jslaby@suse.cz>
Wed, 5 Mar 2014 16:13:51 +0000 (17:13 +0100)
commit011b7e12aeb92635e5ff3864f5ba6f388720f6ec
treebc71920dcbb6a45d0fe2e042f4a072713628b6c3
parentd56a968ff1cebf05b44273e7698d4bdf8acb3caf
iommu/arm-smmu: really fix page table locking

commit c9d09e2748eaa55cac2af274574baa6368189bc1 upstream.

Commit a44a9791e778 ("iommu/arm-smmu: use mutex instead of spinlock for
locking page tables") replaced the page table spinlock with a mutex, to
allow blocking allocations to satisfy lazy mapping requests.

Unfortunately, it turns out that IOMMU mappings are created from atomic
context (e.g. spinlock held during a dma_map), so this change doesn't
really help us in practice.

This patch is a partial revert of the offending commit, bringing back
the original spinlock but replacing our page table allocations for any
levels below the pgd (which is allocated during domain init) with
GFP_ATOMIC instead of GFP_KERNEL.

Reported-by: Andreas Herrmann <andreas.herrmann@calxeda.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/iommu/arm-smmu.c