ARM: 9069/1: NOMMU: Fix conversion for_each_membock() to for_each_mem_range()
authorVladimir Murzin <vladimir.murzin@arm.com>
Thu, 11 Mar 2021 12:32:16 +0000 (13:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Apr 2021 11:00:58 +0000 (13:00 +0200)
commit11a718ef953f7d175e26908f8d584257aa0af898
treede137aa8c6bc1b28a5d3f49ee94523e4b5a36de6
parenta13d4a1228abc42f05233f3212fdf139e2d720db
ARM: 9069/1: NOMMU: Fix conversion for_each_membock() to for_each_mem_range()

[ Upstream commit 45c2f70cba3a7eff34574103b2e2b901a5f771aa ]

for_each_mem_range() uses a loop variable, yet looking into code it is
not just iteration counter but more complex entity which encodes
information about memblock. Thus condition i == 0 looks fragile.
Indeed, it broke boot of R-class platforms since it never took i == 0
path (due to i was set to 1). Fix that with restoring original flag
check.

Fixes: b10d6bca8720 ("arch, drivers: replace for_each_membock() with for_each_mem_range()")
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm/mm/pmsa-v7.c
arch/arm/mm/pmsa-v8.c