Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2035008pxk; Sat, 5 Sep 2020 06:26:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6nfy4Hl8U+6FNfb1rnVUox+4hOJdh5wcgxRrLNUJT5mCZWu6g1RwYpeZ4k+Mh9ZOIgvFS X-Received: by 2002:a17:906:d1d9:: with SMTP id bs25mr7867811ejb.408.1599312407452; Sat, 05 Sep 2020 06:26:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599312407; cv=none; d=google.com; s=arc-20160816; b=GWvsb4W0qwTHsn5+fw2b9FMDgYE34/FTyjEII9VCAqcpfzFspuygKQzVOE28J0CTb0 HpYYlraj1fH5a7GIGI2Bg+yI/1FvfMnhp22ji+ULnc1PRLhKcMCtSN60HPo0BySQTVos To/FuVLvKLz+PSyua5a6Eg5jXUn4mq1aQO7gfm5g2mrjgR4dl7/00h9zkxTYw8mKwRn/ idlyN1iALI3GhCEWOrSUc4MOHDemOXhCELVI91LHfRLvhxitpYdTZAwHuWkGVPW24YIE 5Meu31fxDJSm5xKdNIL2yINK/IaHzMjxRNaFLSUwq1vH/iJLeIm1eazvU2AwitUDyt7Q vHGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=RpTYqJDfCzMfPyaa3uIZG/zj/iG+ilw7s8rADz0kWtk=; b=X+qKMtRwq2i0twnyc/Zt5c5z/guCddbXT5OahljY4dGlVc60n+o5IjuWg8jfGGuHa1 AiQelRRr9aFfCreovwIugWLbIaPmGdygLgxPkeytoVeO0+lPu5roywf+YhqzARCO9kE8 GXuAQsAfdRWikHuiHFlyu4/uuXiLZXVHVO+MOnyhQNXeDwQflrH/X3b6H7/52uIo9At9 TG9gapxdFeXNvcc+0onkSyfTW1s9EVu0TtgIBvezdoQt8HFgrxn82Z272vp3+f5ueqDy 8zXh3l2U0SAURQpwbE9TmLWKl5esck7ub3kVcutPXmAbfE9QPJBB/tZrhOucvQyehXHH j96w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SfHARBM3; 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 f2si6063508edy.125.2020.09.05.06.26.24; Sat, 05 Sep 2020 06:26:47 -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=SfHARBM3; 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 S1728556AbgIENZj (ORCPT + 99 others); Sat, 5 Sep 2020 09:25:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726591AbgIENZi (ORCPT ); Sat, 5 Sep 2020 09:25:38 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E52CC061244 for ; Sat, 5 Sep 2020 06:25:38 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id 7so5746703pgm.11 for ; Sat, 05 Sep 2020 06:25:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=RpTYqJDfCzMfPyaa3uIZG/zj/iG+ilw7s8rADz0kWtk=; b=SfHARBM3j8jhbV/5LA1/aP7kB9hdvJOSeRFtFowLgNAgQBaynONoaFZwb9HUjHEVfC wcmY7jTzvISdB3K+kKP5J4+t5d/nQ8ru0OERRUs2DsqodpY0rGZu+Om5ZnsTvEM4QjVD kvDB/rT7URWrZf61T1OSCS8+FZen8oVEFqHwdfNChGnbwy36AGdeu8pM2kyTZO7YPiSQ hL2KzX39FTZutU3lXDywSWHc6ojkUH2SPFaEZrwTf2gMPUCKIVdheQX2LwqxjUn3E1L1 6zxhPanhEQGuMgrvvE2+AFDF0yo+4I3Rh3J/+mYwX/ho9TkN7lwzN73njlATavMqkEoi m4Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=RpTYqJDfCzMfPyaa3uIZG/zj/iG+ilw7s8rADz0kWtk=; b=uEbXkJHdNMD51Yo5Ydu2jsW19zVI6UEH6Rvi1GCrsXTnpOZljOMbPfYmGKXeixlxw/ f3jVnPEwvMrpkM12rubRdn2BsochF7WaIFjakGCjAErVSkx57x3E8LQsIkvA0fHlQTyt sJtK4enoESCxk7b6b+tO8jo4Rua+3OAkQ6pW3qDzU6E7hMtfMzbz2LlF2zMc6ojLlzjA 6jSrOPkIqSRZVo0tc2HJ0bKHMN+qDEE9DQy/eYEeOkCJ+DwQAO8CmnAjEJpLSNQlXbVf /yTgLXJwNFVURD426aQCrfLy4FM4YH+LtBqVaFpY/DJbHSz4B1nOlKcV4lFF2+pAIM6Z JaXw== X-Gm-Message-State: AOAM532zG3sh8c6DEc8yiN8GqBfuXl9iM0QCYRwmHtVYK7AO+anB8wb0 56iLVv/3QM/1IGNyG0Bn5sWC/oo1eunOYQ== X-Received: by 2002:a63:1226:: with SMTP id h38mr10662767pgl.196.1599312337504; Sat, 05 Sep 2020 06:25:37 -0700 (PDT) Received: from localhost (g223.115-65-55.ppp.wakwak.ne.jp. [115.65.55.223]) by smtp.gmail.com with ESMTPSA id j14sm5414362pjz.21.2020.09.05.06.25.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Sep 2020 06:25:36 -0700 (PDT) Date: Sat, 5 Sep 2020 22:25:34 +0900 From: Stafford Horne To: LKML Cc: Jonas Bonn , Stefan Kristiansson , Mike Rapoport , Arvind Sankar , Greg Kroah-Hartman , Andrew Morton , openrisc@lists.librecores.org Subject: Re: [PATCH v2 1/3] openrisc: Reserve memblock for initrd Message-ID: <20200905132534.GH3562056@lianli.shorne-pla.net> References: <20200905131935.972386-1-shorne@gmail.com> <20200905131935.972386-2-shorne@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200905131935.972386-2-shorne@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 05, 2020 at 10:19:33PM +0900, Stafford Horne wrote: > 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 > --- Forgot to mention: Changes since v1: - Updated to use separate variables as suggested by Mike. > 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 >