Calculating the size and end of the test region as
end = PAGE_ALIGN_DOWN(bank->res->end) - 1;
size = end - start + 1;
is wrong. For an example resource of
start = 0x80000000, end = 0x8fffffff
end results in:
end = PAGE_ALIGN_DOWN(0x8fffffff) - 1 = 0x8fffefff
instead of 0x8fffffff. The size is then calculated to
size = end - start + 1 = 0x8fffefff - 0x80000000 + 1 = 0x0ffff000
instead of 0x10000000
The correct way to do this is to calculate the real size and apply a
PAGE_ALIGN_DOWN afterwards:
size = PAGE_ALIGN_DOWN(bank->res->end - start + 1) = 0x10000000
Fix this in three different places.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>