Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1051746ybg; Wed, 29 Jul 2020 04:43:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLll0jZT9i6VaYU4d6oHiA6YfsqHaCKSHwUVYBn9B+YsezioBfpAQwKXi6EQZrlbOf8nMD X-Received: by 2002:a17:906:3ac4:: with SMTP id z4mr28360210ejd.65.1596022980426; Wed, 29 Jul 2020 04:43:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596022980; cv=none; d=google.com; s=arc-20160816; b=Hc3WjiK615psY/WtrX1jZlCJwXW+qNFObeR8GEzcIbMEWmqB9FPwcxMD3Baktsgbg1 hBFLQUiwF4QXz/1HuftjQrEoDDsVzuyIxn+g62zZY+WDdaZ9eSUWVRAf8MTKuQ2wuN7K GEbgeA7kdRpcD1dvo5bK5QAgj8/CpLPjH4pZuPPU3RLtgDCcguVMxYOBa4DGyw3/69Vh jTlIRpJFGC7rrOtxviPJV0nDJbbqGBEoTmcjEiK/gCVl2vnw8RWxrt1oBqaWjAcRXf16 hpvPo7Hr2RxfeBYlThyAOpCm8h1T65wMk55TEDQo+/DFRTNuISavs10VJ7lZQOhH2YmY kkYw== 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=FyoxCr0A58f1XavZrIV1VkDI4AyZt3GTW0GxGRW15PU=; b=Yu7dNgGCDHH0ztSK1UCC+mCjRe/mb/8V859h7FQjQ/MjBA6hh1jIcqJXJjAanQvPK9 rFlQd4Plyrezxo8ldXIgYXSUyjZ25T6NWWsiY3UUX3SGoP0lJCqqPpG2oMhfWHEi6mko Cu4gGZhhXpjeGBG6H7bCvTPfnch6Q3yMdPBguFo7pIrpHGNPj2ZA9ZVXhbZDBgPDMG3A /p4L3Hzw8baKwWXMiUwxlbuBBKN7VP57mF5XCKt4TbT3hb97rq4w4Azi5qUCP2dIK7Zh aZffjkTMgpw4T4O3liurWGx5x2gqVK19PMPnrP6dDK9AIQ380lo113Y67+qKFdCdbEfL HXwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ErgMzYX2; 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 h22si887029ejj.363.2020.07.29.04.42.36; Wed, 29 Jul 2020 04:43:00 -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=ErgMzYX2; 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 S1726869AbgG2LmC (ORCPT + 99 others); Wed, 29 Jul 2020 07:42:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726341AbgG2LmC (ORCPT ); Wed, 29 Jul 2020 07:42:02 -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 1626AC061794; Wed, 29 Jul 2020 04:42:02 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id t6so14123109pgq.1; Wed, 29 Jul 2020 04:42:02 -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=FyoxCr0A58f1XavZrIV1VkDI4AyZt3GTW0GxGRW15PU=; b=ErgMzYX2rlBnfYHmvHv9Kb0jAk9sTy/cgwUC91LEM8hW88sSiXCtCju4DtSraYOdN6 Iz7cbIFHeP/OokbCsIndQn1W0/LL6legP5rUG8YuTLcO1oJBa0Q3JVGulGwjco0UElqI VvU/wz6i9utUjGjHa4JZVJYJZv72u/uWssFs8dC69IKpZ4vHIedaLdUQ404Jx+JIDGcj xtC8Sy1W9N1QM1A5lPVwWKGR7s1VkCc/Z0Han0x8lhUlPGexDzIucGIkbsBs70Eg0SOc poCa7kET1lEBIE2/zAVCwyCXmjvm7W2acmjhWVo6kPWsms3mfhSxEZ1uLiCnzlFIY+r2 7Ntw== 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=FyoxCr0A58f1XavZrIV1VkDI4AyZt3GTW0GxGRW15PU=; b=aKGPZfVcS1+8YeHIlXDnOaZ21M9aoBATKrSH2S8ZQIONrJ6YGEe89tREMIpf0QEbHA MRyQvfnYSU4r2pZxdJ2UetM7KQeXiIz7gOB6Qw/lhCvdmXtn0DK636+DitnIwFUs+v7F QJALWTs6HnJWu44GbOXqE9bMiee4I2CkgokJcJ3draASz4XaXAW87WZJB9r1UqzGV7dG XHGjz5M4LS1wi1RexBJ6eV85b8gOTChdP0jsLu388EX/h1oWjQ/PxDOqfb42fB4UnjzD hQAB8VxJH5+YEu54N3ejhpnbw6AOztAAsvwqrcCGneq4f2VszgAFpEazFWGrlY3kXTZw 5F9w== X-Gm-Message-State: AOAM5328wfOvR2sn/U+5e3sLu3NrRy0D/OTMDpk13UfZkqIJ8rdLx2/m /F1kkiczwpRpxIJYUDm7ZjY= X-Received: by 2002:a65:64c7:: with SMTP id t7mr27611626pgv.89.1596022921588; Wed, 29 Jul 2020 04:42:01 -0700 (PDT) Received: from localhost (g155.222-224-148.ppp.wakwak.ne.jp. [222.224.148.155]) by smtp.gmail.com with ESMTPSA id y18sm2097780pff.10.2020.07.29.04.42.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jul 2020 04:42:00 -0700 (PDT) Date: Wed, 29 Jul 2020 20:41:57 +0900 From: Stafford Horne To: Mike Rapoport Cc: Andrew Morton , Andy Lutomirski , Benjamin Herrenschmidt , Borislav Petkov , Catalin Marinas , Christoph Hellwig , Dave Hansen , Ingo Molnar , Marek Szyprowski , Max Filippov , Michael Ellerman , Michal Simek , Mike Rapoport , Palmer Dabbelt , Paul Mackerras , Paul Walmsley , Peter Zijlstra , Russell King , Thomas Gleixner , Will Deacon , Yoshinori Sato , clang-built-linux@googlegroups.com, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, openrisc@lists.librecores.org, sparclinux@vger.kernel.org, uclinux-h8-devel@lists.sourceforge.jp, x86@kernel.org Subject: Re: [PATCH 05/15] h8300, nds32, openrisc: simplify detection of memory extents Message-ID: <20200729114157.GF80756@lianli.shorne-pla.net> References: <20200728051153.1590-1-rppt@kernel.org> <20200728051153.1590-6-rppt@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200728051153.1590-6-rppt@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 28, 2020 at 08:11:43AM +0300, Mike Rapoport wrote: > From: Mike Rapoport > > Instead of traversing memblock.memory regions to find memory_start and > memory_end, simply query memblock_{start,end}_of_DRAM(). > > Signed-off-by: Mike Rapoport > --- > arch/h8300/kernel/setup.c | 8 +++----- > arch/nds32/kernel/setup.c | 8 ++------ > arch/openrisc/kernel/setup.c | 9 ++------- > 3 files changed, 7 insertions(+), 18 deletions(-) Hi Mike, For the openrisc part: Acked-by: Stafford Horne > --- a/arch/openrisc/kernel/setup.c > +++ b/arch/openrisc/kernel/setup.c > @@ -48,17 +48,12 @@ static void __init setup_memory(void) > unsigned long ram_start_pfn; > unsigned long ram_end_pfn; > phys_addr_t memory_start, memory_end; > - struct memblock_region *region; > > memory_end = memory_start = 0; > > /* Find main memory where is the kernel, we assume its the only one */ > - for_each_memblock(memory, region) { > - memory_start = region->base; > - memory_end = region->base + region->size; > - printk(KERN_INFO "%s: Memory: 0x%x-0x%x\n", __func__, > - memory_start, memory_end); > - } > + memory_start = memblock_start_of_DRAM(); > + memory_end = memblock_end_of_DRAM(); > > if (!memory_end) { > panic("No memory!"); > -- > 2.26.2 >