Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4414987imm; Tue, 11 Sep 2018 11:30:50 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZV7mIOsUBHD18DBAiYyR/cm8zaNH6cSACS/eOyeeevXOVGPgCdkBJ9ls7mpRo43X0dxHOS X-Received: by 2002:a63:6b03:: with SMTP id g3-v6mr29887939pgc.57.1536690650335; Tue, 11 Sep 2018 11:30:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536690650; cv=none; d=google.com; s=arc-20160816; b=c5UG5bWj9Ca4lIfoHTm+zoWcaWal/gBaPmNmdOOkrMoaw1Rgu/MdhIfXNw6ZPIWFE6 KOX4tZ7a8LMEG+egN+S3YMYz7bmU2BHz69xmHSK+JPkdHe5g7H5U8WO5GC+BzTaHJsuR y8JUZ+mgS6k9cWW16Sd23QzHAzyMGCwu6ThY/cAVDW7YN+COUticBS3166/x9QsIiFBT ox3IqXRVnuj8aEnXdqaHyO3d4rVoSQyVgwXKw4bGe/HfrromjM7CwJXpgqBZnSIDI8Hs rowArScsrCSK9YDDEouUj+11Ry5rAUaKS+ytGQbvMMfn+KK2U/1wKDtHHeqlkoA6WK3/ Bc4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=1S8E2++bJLOndNxd4j21VWwYbuR8uR14xFYCECM5Hpo=; b=AJrElzb619qpSRUY1Pv0svbjgTe7kfe7F6KkzbP70MyGmsOzn20jLOXnr+DKrY5z5B h42AkRgvRKRa/jgzlutRySkQvGsdry3T2NJUvNb9T7C2cuFolN9mv8JGvTNJzVMiOdxk 4+n/hglAE46TuvS8Wh7YAYvr8GQDxgUtIm6lnwEIuJnwC4IAXNE7bhFmMjjdzCF6Kw7F 4jBSPQvp5NLnNEurz1w2RcLO3+vwpK6ahPJDkA95F8ZQ/S0FWLyvaxXY85yTNulrZ6Mj 4PlReY72wEMvvkkxrtdx8B0UX97pmAxh129x2ZMfCVrkVGLahahttFukAlWy0+AWkF9/ B+UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=fkme21kW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k2-v6si22307354pgp.602.2018.09.11.11.30.33; Tue, 11 Sep 2018 11:30:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=fkme21kW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728046AbeIKXaw (ORCPT + 99 others); Tue, 11 Sep 2018 19:30:52 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:47038 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727007AbeIKXaw (ORCPT ); Tue, 11 Sep 2018 19:30:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1536690619; x=1568226619; h=from:to:cc:subject:date:message-id; bh=Lbt92zuZLscvpMeLYQK26pQ6esQna28Q4vKhJ3Hn2os=; b=fkme21kWUhmGYuqLb6OTpPqct0xPnx5bsXaqiXwVWqwJepCFHgV8O2H1 eyXNi9L6w1WIJRsl8hRYl/KCHof34Kqbe5Mg0wjxpdMjIjUoAZ427cYbM yCyWn/xx9pQFwIb7Hs/vYsPwTdp9y884TgRLnghkDI4HiQWcVWOFL7xhx YAqFxZT9b7u1hm1QWVanVtvigUjLKF/d+9X0iVxXiCUN0tSScIsndGnjH L0gZfXX2vI7OeFENtbUdiTiitT4LEi7+86D+CCIO6KT9CCx/StzJVxKAD tlwHyz1YjiRfXkjA7BwK8MDneAJ/t4TP3yhJ1I6XAalLDmONWLOAZF9KQ Q==; X-IronPort-AV: E=Sophos;i="5.53,361,1531756800"; d="scan'208";a="193724045" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 12 Sep 2018 02:30:18 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 11 Sep 2018 11:16:52 -0700 Received: from jedi-01.sdcorp.global.sandisk.com (HELO jedi-01.int.fusionio.com) ([10.11.143.218]) by uls-op-cesaip01.wdc.com with ESMTP; 11 Sep 2018 11:30:19 -0700 From: Atish Patra To: palmer@sifive.com, linux-riscv@lists.infradead.org Cc: hch@infradead.org, anup@brainfault.org, atish.patra@wdc.com, linux-kernel@vger.kernel.org, Damien.LeMoal@wdc.com, terpstra@sifive.com Subject: [PATCH] RISCV: Fix end PFN for low memory Date: Tue, 11 Sep 2018 11:30:18 -0700 Message-Id: <1536690618-9157-1-git-send-email-atish.patra@wdc.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use memblock_end_of_DRAM which provides correct last low memory PFN. Without that, DMA32 region becomes empty resulting in zero pages being allocated for DMA32. This patch is based on earlier patch from palmer which never merged into 4.19. I just edited the commit text to make more sense. Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt --- arch/riscv/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c index db20dc63..a192bf8a 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -193,7 +193,7 @@ static void __init setup_bootmem(void) BUG_ON(mem_size == 0); set_max_mapnr(PFN_DOWN(mem_size)); - max_low_pfn = pfn_base + PFN_DOWN(mem_size); + max_low_pfn = memblock_end_of_DRAM(); #ifdef CONFIG_BLK_DEV_INITRD setup_initrd(); -- 2.7.4