Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1307890pxk; Mon, 31 Aug 2020 15:58:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/T5RI/B0wTXmJGFTBcYxvf+V42TC3dWlckJHT7dSmlt9Awydqehy7sAOg4psHLA2N+OQH X-Received: by 2002:a17:906:4111:: with SMTP id j17mr3163721ejk.467.1598914716826; Mon, 31 Aug 2020 15:58:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598914716; cv=none; d=google.com; s=arc-20160816; b=dvMBxkKvJCOkXB/wyVS59JuSnLvEIeqsZrTYaIcBGkUrC7huHPGlqm17MC0hhSZqNc pO96CljzAcFbv7Y+6z8uVhrKYsvunDXI1elm6dcYIcR0cSwzYwodJT5wFoSVfITkicfw rH7uRoKAIy2Sz2UPUpSnQK1WQSZQvnfxbIRtcupU6haluy1LjMo3poyeO40h0aLAxSIk F4DlBpvzxBJSPWovtIwM2unw+UQn5dGfUiCDIWPZliUNLqQnUWYs4AvknaWzC5cko+Ew Lqo1QsSd1HO5jCRYhpLAN3eo4fNMxC++rqEimlBJdaZb04TRLHtC1EZSUnJRNKELX79k lqTw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=bcxQD2Sn/2bUGUgYSdbw9/nm0Vv2nDYXnd0y7jH8pec=; b=Fw4tFlZdhY5EYXnNA7GI65pDkv1Vyu4Tk7XJAM7rFXmEkP2YkDGYkAyiWRz9L+Raqp acm9JMflIpjF/la9ytwZuFkJXV0BOFub70jrB3X2BumEVg7WO6usFZ9nmYuMBMqVU0sW wW75kuuOox21puSv9oiIp3uV8zkJFtubMNJJlMVTRbC8i0+StmXwHZjG+CdZ/yypuSwa pQ7VfaGtK5B+P51kbPCHbQcMgB4gRf8cVL16l4yIcH2bE1S7/yitasceb5lVlaqoIsNL doJShJIBgHuiGRR26xgtRWSuZ/j4mFVn8WayzwA+WPlnlvJtFl1GB25xMNy2kGEnd4n9 4xdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RnCAH4XI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rk18si1630601ejb.599.2020.08.31.15.58.14; Mon, 31 Aug 2020 15:58:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RnCAH4XI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730222AbgHaVVV (ORCPT + 99 others); Mon, 31 Aug 2020 17:21:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728649AbgHaVVU (ORCPT ); Mon, 31 Aug 2020 17:21:20 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F30F7C061573 for ; Mon, 31 Aug 2020 14:21:19 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id f18so1389987pfa.10 for ; Mon, 31 Aug 2020 14:21:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bcxQD2Sn/2bUGUgYSdbw9/nm0Vv2nDYXnd0y7jH8pec=; b=RnCAH4XIYXFutKK+MrfQTe25TGSO7ZeTBeo27ijs0y0ym14WJ4YUkp0Qa0tlOfZrfu d6h8HxDPQsjvBIZbtjC0KFDIPPae741UZABCuIJHLMLsW20MseA4EdHjL/MndQKvwGvZ y6kV5POE49Bu+TO7Oy3cfmEQXv9t/k5j7OmmxhmW5zkdDAcrPjIBPlwX55xMSJd4nh7B mjqv/YBlp98PD7WXqcswgqhg+21wLH98QUcfMidWgacAxa0or2nKjdtmnUJNJVHKmRh6 JsxUOsI9IGZ19tl3jhSP8+quIUalEQt2j3ur1ExOdLdFIwDZ6HJ1L9gRqojTCQBBpXwK rdTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bcxQD2Sn/2bUGUgYSdbw9/nm0Vv2nDYXnd0y7jH8pec=; b=BcgTqvWc3sf8FPm+PUFfUMRschiZrlw6DwFT4O3sLuwhIM8bNuMPmd2t/tdA0vVU/y nIMGnc7m55zb9HB2eKUeWPXLIpD2xtxZ1ph+reTodRQczoOSfYtVx4BL01o7DlEzK/Im PUqFRuTg97hBTG4dogo4StyaU6x66Fm3tQvQMCl6makDB+cgxCaoAVTdBReKAh+ssS3V 6ddKK8pgetNE0da5RCjystK91OK4L+A6gi9YdXmppuH5K9Zqm0EAp4B+GzEPSQHNoglp O5ZuZdMNGwygsj9OTIJu9uRpI9iAmESNWV4x9YAIw5HZevM8tnXSLeQoKl/yDVBaCMH0 bsrQ== X-Gm-Message-State: AOAM530KHdtz+0WOQaTVukWu0CX0jrHAFrMIzJttyKee5Pw8BAtIPlsw cg/Z5KMWhms0ndmb6sCk50OJZJtxVHM= X-Received: by 2002:aa7:9569:: with SMTP id x9mr2815283pfq.16.1598908878426; Mon, 31 Aug 2020 14:21:18 -0700 (PDT) Received: from localhost (g223.115-65-55.ppp.wakwak.ne.jp. [115.65.55.223]) by smtp.gmail.com with ESMTPSA id y7sm540803pjm.3.2020.08.31.14.21.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2020 14:21:17 -0700 (PDT) From: Stafford Horne To: LKML Cc: Stafford Horne , Jonas Bonn , Stefan Kristiansson , Mike Rapoport , Greg Kroah-Hartman , Andrew Morton , Arvind Sankar , openrisc@lists.librecores.org Subject: [PATCH] openrisc: Reserve memblock for initrd Date: Tue, 1 Sep 2020 06:21:01 +0900 Message-Id: <20200831212102.4014642-1-shorne@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Recently OpenRISC added support for external initrd images, but I found some instability when using larger buildroot initrd images. It turned out that I forgot to reserve the memblock space for the initrd image. This patch fixes the instability issue by reserving memblock space. Fixes: ff6c923dbec3 ("openrisc: Add support for external initrd images") Signed-off-by: Stafford Horne --- arch/openrisc/kernel/setup.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c index b18e775f8be3..2c8aa53cc7ba 100644 --- a/arch/openrisc/kernel/setup.c +++ b/arch/openrisc/kernel/setup.c @@ -80,6 +80,15 @@ static void __init setup_memory(void) */ memblock_reserve(__pa(_stext), _end - _stext); +#ifdef CONFIG_BLK_DEV_INITRD + /* Then reserve the initrd, if any */ + if (initrd_start && (initrd_end > initrd_start)) { + memblock_reserve(ALIGN_DOWN(__pa(initrd_start), PAGE_SIZE), + ALIGN(initrd_end, PAGE_SIZE) - + ALIGN_DOWN(initrd_start, PAGE_SIZE)); + } +#endif /* CONFIG_BLK_DEV_INITRD */ + early_init_fdt_reserve_self(); early_init_fdt_scan_reserved_mem(); -- 2.26.2