Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2105689pxf; Sat, 27 Mar 2021 02:48:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZ0TbQxXj0pLQ3W8igl6r1TB1dx+K7LwmF/oNMwZpp1Y1ujGtjR3OsAn5uAMC4fS7vCZ+i X-Received: by 2002:aa7:c74a:: with SMTP id c10mr19230977eds.332.1616838498547; Sat, 27 Mar 2021 02:48:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616838498; cv=none; d=google.com; s=arc-20160816; b=Jr3YL1f1NUqvZYAaUa/F9oHomah4gmugkeLoHxnYbapunytjmycbZhc7m/EN/izNGH AsYiGukjKlFhbCR0M56LrFOOytufL42wf63j97GAy2fW3I4q+kjo7Sr5ul2zmV7bTxlf hKDPpWKRuee4MWsAr9S2PRkB7oeFoQ7BSjXOhGq8YgZMI7eVY7Vk029n7pUEIJ/fyE+J 2+HiNjQzzgmnj8WqfwTPkRysg9Go+YJWKe5l614J41UuPU3IoAt8myER/3/g0K6pEqqT c3MgTsSrJDh3gzTH6GY1yuYKyNIkhj5SBBTEUEOYUd9EGaMXkmH3n4YRNvTrue3BcSoE QwnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ISSexxgenQarn1RkYFGlBUK1Az8i7n480UCuQrbruxA=; b=1Ge2JzqXhFuO5AMTcC+sEqD5yhvzNu4kjns1DDkOVNFOT+KeBUjJ3ptMhChOu9C6mS 1N0kOhI1twT/UOAtnkWpw+quJ8Ebc029T9/7QBdjhYMZdJ2zGQXzEZmlclsiV/7RL29B nsYsytDoH2yb2rS+v/x3Wq/7D+ANmDB51duEGUYEl3kL0nq40AEHTBLa1qU/r99oO2e1 2bNo0IJzlLxMd/uTRU16Bs/0D37zN6dJImgYr96wRdGpLwp7d8Uw3qS+HTK7QMcqvWCP +GhLJJbBRaGMRncJ+4fDBAZPsCU4rag75fsFaXCZBUKvKBlvmYSFoW4+tVeHseeeNeHi v6SA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si8866379edw.236.2021.03.27.02.47.56; Sat, 27 Mar 2021 02:48:18 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231240AbhC0JrA (ORCPT + 99 others); Sat, 27 Mar 2021 05:47:00 -0400 Received: from elvis.franken.de ([193.175.24.41]:53073 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230415AbhC0Jqg (ORCPT ); Sat, 27 Mar 2021 05:46:36 -0400 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1lQ5Wa-0005A7-00; Sat, 27 Mar 2021 10:46:32 +0100 Received: by alpha.franken.de (Postfix, from userid 1000) id 8B16FC1D8B; Sat, 27 Mar 2021 10:46:20 +0100 (CET) Date: Sat, 27 Mar 2021 10:46:20 +0100 From: Thomas Bogendoerfer To: Ilya Lipnitskiy Cc: Matthias Brugger , John Crispin , Chuanhong Guo , Jiaxun Yang , linux-mips@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Linux Kernel Mailing List Subject: Re: [PATCH] MIPS: ralink: mt7621: add memory detection support Message-ID: <20210327094620.GA4320@alpha.franken.de> References: <20210317055902.506773-1-ilya.lipnitskiy@gmail.com> <20210325095529.GA5775@alpha.franken.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 25, 2021 at 07:45:23PM -0700, Ilya Lipnitskiy wrote: > On Thu, Mar 25, 2021 at 3:01 AM Thomas Bogendoerfer > wrote: > > > > On Tue, Mar 16, 2021 at 10:59:02PM -0700, Ilya Lipnitskiy wrote: > > > From: Chuanhong Guo > > > > > > mt7621 has the following memory map: > > > 0x0-0x1c000000: lower 448m memory > > > 0x1c000000-0x2000000: peripheral registers > > > 0x20000000-0x2400000: higher 64m memory > > > > > > detect_memory_region in arch/mips/kernel/setup.c only adds the first > > > memory region and isn't suitable for 512m memory detection because > > > it may accidentally read the memory area for peripheral registers. > > > > > > This commit adds memory detection capability for mt7621: > > > 1. Add the highmem area when 512m is detected. > > > 2. Guard memcmp from accessing peripheral registers: > > > This only happens when a user decided to change kernel load address > > > to 256m or higher address. Since this is a quite unusual case, we > > > just skip 512m testing and return 256m as memory size. > > > > > > [...] > > > > I get > > > > WARNING: modpost: vmlinux.o(.text+0x132c): Section mismatch in reference from the function prom_soc_init() to the function .init.text:mt7621_memory_detect() > > The function prom_soc_init() references > > the function __init mt7621_memory_detect(). > > This is often because prom_soc_init lacks a __init > > annotation or the annotation of mt7621_memory_detect is wrong. > > > > Can you please fix this ? > Thanks, I will fix it. Having trouble reproducing the error, but I > clearly see the issue. Are you building on a MIPS target or > cross-compiling (I'm cross-compiling and no errors). I'm cross compiling, I can provide you the .config, if you want. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]