iommu/arm-smmu: fix pud/pmd entry fill sequence
authorYifan Zhang <zhangyf@marvell.com>
Fri, 3 Jan 2014 12:01:26 +0000 (12:01 +0000)
committerJiri Slaby <jslaby@suse.cz>
Wed, 5 Mar 2014 16:13:51 +0000 (17:13 +0100)
commitd56a968ff1cebf05b44273e7698d4bdf8acb3caf
tree6bb8078dab945dd4b0e0d85ecf787159aa838a09
parent4d1f2e2fa267b3196ccaa7b08419fc567391b28b
iommu/arm-smmu: fix pud/pmd entry fill sequence

commit 97a644208d1a08b7104d1fe2ace8cef011222711 upstream.

The ARM SMMU driver's population of puds and pmds is broken, since we
iterate over the next level of table repeatedly setting the current
level descriptor to point at the pmd being initialised. This is clearly
wrong when dealing with multiple pmds/puds.

This patch fixes the problem by moving the pud/pmd population out of the
loop and instead performing it when we allocate the next level (like we
correctly do for ptes already). The starting address for the next level
is then calculated prior to entering the loop.

Signed-off-by: Yifan Zhang <zhangyf@marvell.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/iommu/arm-smmu.c