MIPS: MAAR: Fix address alignment
authorJames Hogan <james.hogan@imgtec.com>
Tue, 9 Aug 2016 12:21:49 +0000 (13:21 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 13 Sep 2016 12:13:26 +0000 (14:13 +0200)
commitac7e385f2bf1c39615cf58f7e58246fdd9da5bb9
tree23454df4f634e61b06be3342ef4df0e798b3e7c8
parent58cae9b0f0c1d9cc55de018d927e65549b24cf5b
MIPS: MAAR: Fix address alignment

The alignment of MIPS MAAR region addresses isn't quite right.

- It rounds an already 64 KiB aligned start address up to the next
  64 KiB boundary, e.g. 0x80000000 is rounded up to 0x80010000.

- It assumes the end address is already on a 64 KiB boundary and doesn't
  round it down. Should that not be the case it will hit the second
  BUG_ON() in write_maar_pair().

Both cases are addressed by rounding up and down to 64 KiB boundaries in
the more traditional way of adding 0xffff (for rounding up) and masking
off the low 16 bits.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/13858/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/mm/init.c
This page took 0.026891 seconds and 5 git commands to generate.