]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: fix off by one in max_zone_pfn initialization for ZONE_DMA
authorAndrea Arcangeli <aarcange@redhat.com>
Tue, 25 Jun 2019 14:17:27 +0000 (10:17 -0400)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 15 Jul 2019 04:55:58 +0000 (14:55 +1000)
commit14914d8a17c3427dd1f1506bf15bb5d07d4636f3
tree84ae3ecd08d32fcb55c7b63b01d7a61d7d074c21
parent0e7943d17aca3df026bfdf1f60b344b632f282ea
powerpc: fix off by one in max_zone_pfn initialization for ZONE_DMA

2599332e12f4c138c097f5d4d5281eab38b523b9 first introduced an off by
one error in the ZONE_DMA initialization of PPC_BOOK3E_64=y and since
1a645dd7f5b886307163171b31830ecf478b2fcb the off by one applies to
PPC32=y too. This simply corrects the off by one and should resolve
crashes like below:

[   65.179101] page 0x7fff outside node 0 zone DMA [ 0x0 - 0x7fff ]

Unfortunately in various MM places "max" means a non inclusive end of
range. free_area_init_nodes max_zone_pfn parameter is one case and
MAX_ORDER is another one (unrelated) that comes by memory.

Reported-by: Zorro Lang <zlang@redhat.com>
Fixes: 2599332e12f4 ("powerpc: use mm zones more sensibly")
Fixes: 1a645dd7f5b8 ("powerpc: enable a 30-bit ZONE_DMA for 32-bit pmac")
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190625141727.2883-1-aarcange@redhat.com
arch/powerpc/mm/mem.c