Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1488226pxk; Mon, 31 Aug 2020 23:01:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeXlJaA8j0RM4M63rYjKMJlV4NW/6A1P4che6DX7tndG3MXgpn7aVlqVZrB41L262w+6Dk X-Received: by 2002:a50:fa81:: with SMTP id w1mr348434edr.122.1598940082387; Mon, 31 Aug 2020 23:01:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598940082; cv=none; d=google.com; s=arc-20160816; b=V0KQRJqyYOXQzDA98RN1LNdpZtrjL7a7P4ioUO+Qqdgbt7R05Ryr1gNGlUVE1O2R0H aRPldD7Vx+QDbf637K8PcaUm1WOk1o6MLmHNrezWgOZF6qnFbGAWlmm0ep6sEcGlrmPR PYVVliN3LQB4aMz46KoRbtvwKmtdzm2VLP8SaWkzokzsQ/pOTGbvsgpmBVKa2QCUjX+b VysmIAv8wijVM4t1TFfqhK+9DRQK9Wrhyy05UCwnMYG90LaHwvNxuOAS6OojdwDu0Rft qZr2K9qrKUmrOC7WtNe35M10C3RDCa344/Xw57y6iX3meWeSF6w0shIkRHwD6xiRpjyj P1zA== 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=oLXX8gDnprKjdEtHE66sa3UBdane9eDbxMuJIFrGgvY=; b=N2nIwaFqWfbv8SKujPzfOkj/Legn295lkySyLvbbfAOLoAd5n8fTP8rHy8usOFJE/c ZqmREV2iwzGlCXgIjQ2x9d59+xDg69U2VdhxwjbZu+R97ZGlaUSrRB4yJQZ1C4kXtbel JK5YdbcQ+qAXGNZ9ySxIoHXINqHZUWk34Xi0rLu0hccRp5rdcnEHqPDww/y1rPdvUOBh eXJmLR9pNCZMuwYLY6Monkcvy5k78/u+FItK76hvWamvD/3qmrtI3yXUxOr1aW9W3IgT 27piRQ90YhJyoHY49EdsU7+kwNHNFwCWNQMDh6zpgxH0+mejHtRqRqCD+bkU+Blb/rMo qY4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nnLyZ5mD; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x15si127907eje.180.2020.08.31.23.00.58; Mon, 31 Aug 2020 23:01:22 -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=@kernel.org header.s=default header.b=nnLyZ5mD; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726122AbgIAF7d (ORCPT + 99 others); Tue, 1 Sep 2020 01:59:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:46248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725987AbgIAF7c (ORCPT ); Tue, 1 Sep 2020 01:59:32 -0400 Received: from kernel.org (unknown [87.70.91.42]) (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 75D9D2087D; Tue, 1 Sep 2020 05:59:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598939971; bh=BJfrClw+C5jaFYlYb2O3GY7/UQ3rsmmQs8RxMwdsSY4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nnLyZ5mDHRUIhha8dkmjwpA51hT6fthUo0yyY3VVOe1s7JbrSYsAlq8d6JAYO1DZN MZ++Rx2ECmGTFmGWOWCdO6SdR4ExDt62LEvpZTT9hx77PaIgfnwEnTUviPThaR8lwZ vX85aH1lrloWJDrbTGRVNz4jEyqkRQEM/0M5Ms7A= Date: Tue, 1 Sep 2020 08:59:24 +0300 From: Mike Rapoport To: Stafford Horne Cc: LKML , Jonas Bonn , Stefan Kristiansson , Greg Kroah-Hartman , Andrew Morton , Arvind Sankar , openrisc@lists.librecores.org Subject: Re: [PATCH] openrisc: Reserve memblock for initrd Message-ID: <20200901055924.GC432455@kernel.org> References: <20200831212102.4014642-1-shorne@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200831212102.4014642-1-shorne@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 01, 2020 at 06:21:01AM +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 > --- > 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)); > + } The core mm takes care of reserving the entrire pages for the memory reserved with memblock, so it is not necessary to do it here. > +#endif /* CONFIG_BLK_DEV_INITRD */ > + > early_init_fdt_reserve_self(); > early_init_fdt_scan_reserved_mem(); > > -- > 2.26.2 > -- Sincerely yours, Mike.