]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.19/powerpc-wii-properly-disable-use-of-bats-when-requested.patch
Linux 4.14.108
[thirdparty/kernel/stable-queue.git] / queue-4.19 / powerpc-wii-properly-disable-use-of-bats-when-requested.patch
1 From 6d183ca8baec983dc4208ca45ece3c36763df912 Mon Sep 17 00:00:00 2001
2 From: Christophe Leroy <christophe.leroy@c-s.fr>
3 Date: Thu, 21 Feb 2019 19:08:37 +0000
4 Subject: powerpc/wii: properly disable use of BATs when requested.
5
6 From: Christophe Leroy <christophe.leroy@c-s.fr>
7
8 commit 6d183ca8baec983dc4208ca45ece3c36763df912 upstream.
9
10 'nobats' kernel parameter or some options like CONFIG_DEBUG_PAGEALLOC
11 deny the use of BATS for mapping memory.
12
13 This patch makes sure that the specific wii RAM mapping function
14 takes it into account as well.
15
16 Fixes: de32400dd26e ("wii: use both mem1 and mem2 as ram")
17 Cc: stable@vger.kernel.org
18 Reviewed-by: Jonathan Neuschafer <j.neuschaefer@gmx.net>
19 Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
20 Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22
23 ---
24 arch/powerpc/platforms/embedded6xx/wii.c | 4 ++++
25 1 file changed, 4 insertions(+)
26
27 --- a/arch/powerpc/platforms/embedded6xx/wii.c
28 +++ b/arch/powerpc/platforms/embedded6xx/wii.c
29 @@ -83,6 +83,10 @@ unsigned long __init wii_mmu_mapin_mem2(
30 /* MEM2 64MB@0x10000000 */
31 delta = wii_hole_start + wii_hole_size;
32 size = top - delta;
33 +
34 + if (__map_without_bats)
35 + return delta;
36 +
37 for (bl = 128<<10; bl < max_size; bl <<= 1) {
38 if (bl * 2 > size)
39 break;