Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2032155pxk; Sat, 5 Sep 2020 06:21:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlHGJxzmPoOjwH3RrWuGkCfv/UGU3S9m6XjKJvJiNK76fhUdw5YAYU5Ub+7bb6utvG0Rsq X-Received: by 2002:a17:906:1243:: with SMTP id u3mr13141953eja.415.1599312075942; Sat, 05 Sep 2020 06:21:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599312075; cv=none; d=google.com; s=arc-20160816; b=KsgwcAITpb5vu3voVGlaMBrR3ycNNFFyvBBJNQRrAusP7r1gq+W4C6DPB6RlusgAbH AREIJ34ENI/zox62+tyZwivy+mh773skGFyiFbY3uziSVYX2+ooBuWpCpFGOBhdInNBY cuvn56AcGPy6BgDp+f1m15XFjxLbealetHof1BhMkAYO885FX8cXeyGTGhfMvWhcU9UN aX7hw8ZxgTekdKPJwNmI52NNNOfv5fsNUjUVABFDuCTD8Ndf4fUWaCHaKcdz2GGFwQNi 3ppaytR3o2XBydRCLV7T4NjC3cfNPBR7VycuLVag8/PHjDQ23axRY2wGRRo0V42PUrXW WJCQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=djsLOAj49I3V2rEQOLHM4U+3AfJWXtqzZzZwC5xLBeA=; b=JWBkqTR/IJTHbojZCAeat9wVhDLKepxYOGWTtsx8SAwrvZOzPSKsz5Wci5vB+4bkdS G4/zqfvXas1CCi0/BExpiwvah5vcMWMygMeKX2v79XoNmsh5y9Dse26w0tX5rW8Pdnf2 wd0f8l5+OdVlSdkzk5VCACJBpoZhVsHM4QcI4n3e4uE88NesjUfhyeC3YYEH/SL/GPYJ 1di1EnX0hmDqysxzn8XAQDgbf6yoblPQMe+Qkpp6r52Cw/vBU0cujToTZB2aTPyygmBn z+69bqs30fHVV2cclIkAi63/fsD8Vvl6qJ7kuwrM3NMBD8luHMPsQzeOwGPRIMYendQA RaMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nQIR8dUF; 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 j24si5998720edt.105.2020.09.05.06.20.53; Sat, 05 Sep 2020 06:21:15 -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=nQIR8dUF; 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 S1728561AbgIENUO (ORCPT + 99 others); Sat, 5 Sep 2020 09:20:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728314AbgIENUL (ORCPT ); Sat, 5 Sep 2020 09:20:11 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5704CC061244 for ; Sat, 5 Sep 2020 06:20:11 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id u3so1065000pjr.3 for ; Sat, 05 Sep 2020 06:20:11 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=djsLOAj49I3V2rEQOLHM4U+3AfJWXtqzZzZwC5xLBeA=; b=nQIR8dUFvevjZjwwDnA9GNxfMR0FcpxmEwiHHELuOnjDpHhFzg9q12KR8ID7CMxl4R z5UtyjDoZ+4hkT5Ux8Qs/fh/3XaqcPWszHLjb+KTobb6rcSb2/hWi9DaJSeIyVRctOPL dcVxYVWcnfjhvDtPzLHk89rYs7Cs5ZscUV49nu16nBcUCztHnGzc7xPiOm29zfgnTkFI vroFIjRRVnDs2rdhQSRk943rVPHsSeTZ0lNLLEM/KFhgY4aY/rshETTEPp6PYr3NSxTa PiPTe0D3JTN+AQBSuge4af3CbfsvTHr+0x44h11kutmOyXxB4nKach/ahLJ1QVEgSEPb ighw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=djsLOAj49I3V2rEQOLHM4U+3AfJWXtqzZzZwC5xLBeA=; b=T2nJdM90PIs8OY/soxN+5T5p0A0/c2tFLqIvKyzPzz2EUnl/MEjX8Ev7kIxQ7yClpA t8CIxeMM0D/mNXfykuSKVrbgCDvUdAGmK0K8Tnya9WdiY6pMr4bgp/jAeRbeLZRZMEcW nNlz3SrhWt6rneVZmHm9ek9hOZqFLHiSF57pqZC1Rlgm/xMFYMInsWGuhNUUZdJ7xWx4 tMv/ZjUyRBZAjU49A3q9O6Oy8p2pgqm8frOeI1zpq1lb3csID/H7fJr6yzh1dVDCqgRf RgGp7F/ZdzAUuudCPkpYjZ1warB3F9hfmiMh+Pk7KYkIqx+IkI3On0B00yd83lGmddhX 7eCQ== X-Gm-Message-State: AOAM530NeBKHEHD9SZ07RwKil5fFkrQyaethxST4Y70UtM+ZuYmoJXga 9Wv3nzjrDvLoyXbrNC4S8ckzynJfUFQ= X-Received: by 2002:a17:902:e789:: with SMTP id cp9mr12639308plb.215.1599312008821; Sat, 05 Sep 2020 06:20:08 -0700 (PDT) Received: from localhost (g223.115-65-55.ppp.wakwak.ne.jp. [115.65.55.223]) by smtp.gmail.com with ESMTPSA id q193sm10093224pfq.127.2020.09.05.06.20.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Sep 2020 06:20:07 -0700 (PDT) From: Stafford Horne To: LKML Cc: Stafford Horne , Jonas Bonn , Stefan Kristiansson , Mike Rapoport , Arvind Sankar , Greg Kroah-Hartman , Andrew Morton , openrisc@lists.librecores.org Subject: [PATCH v2 1/3] openrisc: Reserve memblock for initrd Date: Sat, 5 Sep 2020 22:19:33 +0900 Message-Id: <20200905131935.972386-2-shorne@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200905131935.972386-1-shorne@gmail.com> References: <20200905131935.972386-1-shorne@gmail.com> 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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c index b18e775f8be3..13c87f1f872b 100644 --- a/arch/openrisc/kernel/setup.c +++ b/arch/openrisc/kernel/setup.c @@ -80,6 +80,16 @@ 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)) { + unsigned long aligned_start = ALIGN_DOWN(initrd_start, PAGE_SIZE); + unsigned long aligned_end = ALIGN(initrd_end, PAGE_SIZE); + + memblock_reserve(__pa(aligned_start), aligned_end - aligned_start); + } +#endif /* CONFIG_BLK_DEV_INITRD */ + early_init_fdt_reserve_self(); early_init_fdt_scan_reserved_mem(); -- 2.26.2