From patchwork Tue Jan 15 16:36:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 1025316 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43fGL16tc0z9sNr for ; Wed, 16 Jan 2019 03:40:41 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=c-s.fr Authentication-Results: ozlabs.org; dkim=fail reason="unknown key hash" (0-bit key; unprotected) header.d=c-s.fr header.i=@c-s.fr header.b="moSljRtR"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 43fGL10SjHzDqZw for ; Wed, 16 Jan 2019 03:40:41 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=c-s.fr (client-ip=93.17.236.30; helo=pegase1.c-s.fr; envelope-from=christophe.leroy@c-s.fr; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=c-s.fr Authentication-Results: lists.ozlabs.org; dkim=fail reason="unknown key hash" (0-bit key; unprotected) header.d=c-s.fr header.i=@c-s.fr header.b="moSljRtR"; dkim-atps=neutral Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 43fGFF654WzDqZ3 for ; Wed, 16 Jan 2019 03:36:33 +1100 (AEDT) Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 43fGF75H8Gz9v4gg; Tue, 15 Jan 2019 17:36:27 +0100 (CET) Authentication-Results: localhost; dkim=permerror reason="key not found" header.d=c-s.fr header.i=@c-s.fr header.b=moSljRtR; dkim-adsp=none (insecure policy); dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr X-Amavis-Alert: BAD HEADER SECTION, Non-encoded 8-bit data (char E4 hex): To: ....id.au>, "Jonathan Neusch\303\244fer" X-Virus-Scanned: amavisd-new at c-s.fr X-Amavis-Alert: BAD HEADER SECTION, Non-encoded 8-bit data (char E4 hex): To: ....id.au>, "Jonathan Neusch\303\244fer" From: Christophe Leroy Subject: [PATCH] powerpc/wii: properly disable use of BATs when requested. To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , "Jonathan Neusch?fer" Date: Tue, 15 Jan 2019 16:36:29 +0000 (UTC) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 'nobats' kernel parameter or some options like CONFIG_DEBUG_PAGEALLOC deny the use of BATS for mapping memory. This patch makes sure that the specific wii RAM mapping function takes it into account as well. Fixes: de32400dd26e ("wii: use both mem1 and mem2 as ram") Cc: stable@vger.kernel.org Signed-off-by: Christophe Leroy Reviewed-by: Jonathan Neuschäfer --- arch/powerpc/platforms/embedded6xx/wii.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/platforms/embedded6xx/wii.c b/arch/powerpc/platforms/embedded6xx/wii.c index ecf703ee3a76..bae843e32ae7 100644 --- a/arch/powerpc/platforms/embedded6xx/wii.c +++ b/arch/powerpc/platforms/embedded6xx/wii.c @@ -82,6 +82,9 @@ unsigned long __init wii_mmu_mapin_mem2(unsigned long top) /* MEM2 64MB@0x10000000 */ delta = wii_hole_start + wii_hole_size; + if (__map_without_bats) + return delta; + size = top - delta; for (bl = 128<<10; bl < max_size; bl <<= 1) { if (bl * 2 > size)