Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2456670imd; Fri, 2 Nov 2018 11:43:25 -0700 (PDT) X-Google-Smtp-Source: AJdET5frYUukaXs0NdcXJWSDT8g6z/oyk7eqnzKL7ZCoiR0tXP9cDRd0dk6QlYS3NIP7jSA25t6F X-Received: by 2002:a17:902:a58c:: with SMTP id az12-v6mr12616744plb.266.1541184205070; Fri, 02 Nov 2018 11:43:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541184205; cv=none; d=google.com; s=arc-20160816; b=u5EBCnINOOWgvTJXSKm6rXI78GylICb1MUkns/9JADzO7HbjHvjkRJXQds32dNc+aV jHXcpHpbkPQBB4wk7l5IpughW7D8vJRYa80BBM0+J/g4y51EGhntN2JigMvS3XU0fgtP nf/QUb06OQda+GXfQ11NxxAlSTf1YYNWKG2/p48ZVM1EK73dy1OKH3HL4b+LHckczvuY KATLsrH/zVCLQVmxSNgxYFTNTgjASaROMCoNKDKyXE1HCPDM3APmHYZPzIcjqEVy53Iw c5ptc6avTSTHJOfN/dpH08AQOvPTMvobNEZaCTolEy02ENiTe1Gm4NQYWKEPdFSKslSb vF4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WQc3jBFry7stk0clcPycQdz39oEEEw8j/QIsi8PYqPI=; b=Zj9J0e5BbKmvg+jMoy81/xHpDqo5X+hW52Gh6KeHmUcLAcILMHrR9+lQ9Zax3YIzM9 XId4HEu+BYLkS+VoaM3M87u69p0J+AqYf3WjI1wgMPV/Qz+BDAQkq7TQH5vZxrNofop5 O7ShguB1P1xOfF0lgy6Pt5sK2OBqWeeNdcsBFNy8Azlc2rxNoN2OyJL3kpQfBYO4fKxP 75N7++SYlijcRparQeU/rI2MEhWLAEYnAzMX/bseNo+4u1hjWzNPlokJErOyOSmW52+M 1sQb+wi4+xlF+mv6rgiPddz6lS92RpNZqLHqvc+q9CX+f6eF/NdVSTR9nIRA6OJNm/B8 t1LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JWSurc95; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d17si533651pgl.484.2018.11.02.11.43.10; Fri, 02 Nov 2018 11:43:25 -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=pass header.i=@kernel.org header.s=default header.b=JWSurc95; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729738AbeKCDuQ (ORCPT + 99 others); Fri, 2 Nov 2018 23:50:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:45278 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728835AbeKCDuQ (ORCPT ); Fri, 2 Nov 2018 23:50:16 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9CB662085A; Fri, 2 Nov 2018 18:42:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541184124; bh=naJAsp572kRDO+2Et2M8cew5Pg2rqki044Zp+6cq16A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JWSurc950HWElm3NPLH+m5NHllPvHqSpFEvbTRzUCcpoQB//heOuRguWjwx5N5BFH vk3gIMgdN6gnLcQojiviKwFXIWXWd3oFYuAZOAaWrmBsWnJ/PuW1kUejD47r5CsIAB b2qiExnhlgA+EEA7Hgf3QEuI7YWTLsDOYHQMxrVw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Atish Patra , Palmer Dabbelt , Sasha Levin Subject: [PATCH 4.18 062/150] RISCV: Fix end PFN for low memory Date: Fri, 2 Nov 2018 19:33:44 +0100 Message-Id: <20181102182907.912692417@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182902.250560510@linuxfoundation.org> References: <20181102182902.250560510@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit ef1f2258748b675422ca0107e5bfb9ceeac675de ] 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 Signed-off-by: Sasha Levin --- 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 0efa5b29d0a3..dcff272aee06 100644 --- a/arch/riscv/kernel/setup.c +++ b/arch/riscv/kernel/setup.c @@ -165,7 +165,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.17.1