Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3900356pxu; Mon, 30 Nov 2020 12:42:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJz1OGWqCzSV1xFx/iNO7ViDld9cUOpI3Z0IJfQQuvRK6ODdl+Sc2lqgz9UW9wEvod8OOcWy X-Received: by 2002:a17:906:cc15:: with SMTP id ml21mr16620653ejb.143.1606768977657; Mon, 30 Nov 2020 12:42:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606768977; cv=none; d=google.com; s=arc-20160816; b=KVXun4jtivJNn9ODPNJ5oornqneUfOhljaEYMAlVcZ0jU9HMQYol6vkFkhVFwpfpYU Oo/VUL7hxS/qt+WzmsNR+nyNacYsnBTloq9wybj3E8N/Ss0pWnlYhEC2jqdUQ2oBy3QO 4/NBgoqtSUfqXxuq4Cwc9GfcFf8PD7G2k8pDw5lBddojlekVU7FuvGcUf6BYjUwjgKN9 8pQFXjyoUokGGUY28WzM7mOcLXtSGJUICIkZynpfx5wqWNqo5rDpner3DidCgXNzy5V1 CIKN/c9fDoyNW68Z8I+MqZ0qYMdjV6YpZtJ8xnhpX873qmMuw7cLzhAKfcrGm5acp5tV Yl/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=I8qDHQ/jUJK0YpI0GEkFGscMHRpymFfegAxsOzmAN4o=; b=aq7BCohp/FNEgqpbiv/3HKd+NGzNnM/864lIdg8ChS1xjIOx9RSughnIGtbHGgHgeG UogrvaVKhlMxMUTlT9m8oGKRu7LstNHCsVZ7YJFC2Pp1BCMx6AOpNwSkTpW+lMa76RQC Uiu0j8UKML7PNKpIafqp/lBQulDqyMElA+IocXVayIJdkLkxLlpBMH+iWEG9DBDeb3Sv ZnALbjqKAid8BnZkeIJmx5ucAJgNArprq7LTJl57DLBAztR9hBFKOPbmseHd7YtwCl0/ LVv4Ue9MgFq8rvqOQwb+PYjrTaB39eXPJKOwTeWiFXWiwklH1P7SAFfucI+ZHvlW5ZAW ndZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=vKKvL0gS; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r23si6757759ejb.547.2020.11.30.12.42.34; Mon, 30 Nov 2020 12:42:57 -0800 (PST) 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=@google.com header.s=20161025 header.b=vKKvL0gS; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728826AbgK3Uk6 (ORCPT + 99 others); Mon, 30 Nov 2020 15:40:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727309AbgK3Uk5 (ORCPT ); Mon, 30 Nov 2020 15:40:57 -0500 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61ECAC0613CF for ; Mon, 30 Nov 2020 12:40:17 -0800 (PST) Received: by mail-pl1-x642.google.com with SMTP id x4so5419315pln.8 for ; Mon, 30 Nov 2020 12:40:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=I8qDHQ/jUJK0YpI0GEkFGscMHRpymFfegAxsOzmAN4o=; b=vKKvL0gSMSqXwlr7CWPakDN7FowAyRokdIheSsMlemhQVl6ts18545CislkpLSWysc sgYS2dBCHjC8OSmrGZd2P8cebt4X0r/HVzXh83fIgWpTjAGz2Zj79S4kQxGuKjkwv26d WtzZrOGUdUBGz/hAtog8jfPxxx4b63nZAY7RrL7gJ9KFqCZ/eDf16taoI7YaT3CR3FZ5 W8fqG5uo28c1P3UfqbMsKlXfazJJrHo76qowhMJ4ctW5xb6Csp4wZ9AeP0ApKOlkJqaV tRRdJkGrdYui/pFCpMKiWhHOfG8rfZ1SQ0k08+2AVKZxQ/dsO4Aa7RGc2I65Hp5snHsS itNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=I8qDHQ/jUJK0YpI0GEkFGscMHRpymFfegAxsOzmAN4o=; b=sV6PZz8Ff3Nam3GVALAkoyrhwz+zoVPzRkcszbDUXQzYZSw8tu9Jy59CK5ahfAItPi +O4UFYB7rdPtCnATsSyBBl0JP5RcnDAYd9WG4z+noK1hY0qLXUXDuwS8jRxdFO8qUaBT OXhVJSPCdlkElI6XisTJTnNFuqk7ImJcK7jcFa46ez4PDC/nx5bBFiwQnqViM8QfYtDh HXwe4C0axOe4fd5nljNKQ6OIGe6gR0PhyCF5FPKDzXcnc7lpanheuDWSMAGkK48lPMGm NHDhQN7NlKHWfog2Skbb/BlH3ZzRUF+kHbHZQn+WzF11cqDhuGUQmMgfXVdqc3wMJQ13 5j+A== X-Gm-Message-State: AOAM532FkwKWVDAiyxfuNYCR5f6E3YY7lOe4MmAO7IkmOLKoeg4Xpb0z 9yYlVRHA5Ajt/5+ykf3flhWdo+8GSg2uTHVC9OV8eg== X-Received: by 2002:a17:902:221:b029:d8:f938:b112 with SMTP id 30-20020a1709020221b02900d8f938b112mr20664724plc.10.1606768816582; Mon, 30 Nov 2020 12:40:16 -0800 (PST) MIME-Version: 1.0 References: <20201127083943.2666864-1-anders.roxell@linaro.org> In-Reply-To: <20201127083943.2666864-1-anders.roxell@linaro.org> From: Nick Desaulniers Date: Mon, 30 Nov 2020 12:40:05 -0800 Message-ID: Subject: Re: [PATCH] mips: fix Section mismatch in reference To: Anders Roxell Cc: Thomas Bogendoerfer , Nathan Chancellor , linux-mips@vger.kernel.org, LKML , clang-built-linux , chenhc@lemote.com, taohl@lemote.com, yanh@lemote.com, alex.smith@imgtec.com, zhangfx@lemote.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 27, 2020 at 12:39 AM Anders Roxell wrote: > > When building mips tinyconfig with clang the following error show up: > > WARNING: modpost: vmlinux.o(.text+0x1940c): Section mismatch in reference from the function r4k_cache_init() to the function .init.text:loongson3_sc_init() > The function r4k_cache_init() references > the function __init loongson3_sc_init(). Looks like loongson2_sc_init() might also have the same problem? (Both loongson2_sc_init and loongson3_sc_init are called from non-__init setup_scache). Trying to pinpoint a Fixes tag is tricky, it looks like setup_scache used to be marked __init, then __cpuinit? > This is often because r4k_cache_init lacks a __init > annotation or the annotation of loongson3_sc_init is wrong. > > Remove marked __init from function loongson3_sc_init(), > mips_sc_probe_cm3(), and mips_sc_probe(). mips_sc_probe_cm3() is only called from mips_sc_probe() which is marked as __init. mips_sc_probe is only called from mips_sc_init, which is not marked __init. So the patch is fine (and thanks for sending it): Reviewed-by: Nick Desaulniers though it looks like it might be worthwhile for the MIPS maintainer or Loongson folks to see if they can lower the kernel image size in memory post init by possibly re-adding __init to setup_scache()/r4k_cache_init()/cpu_cache_init() and friends. > > Signed-off-by: Anders Roxell > --- > arch/mips/mm/c-r4k.c | 2 +- > arch/mips/mm/sc-mips.c | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c > index 99521764c75b..4f976d687ab0 100644 > --- a/arch/mips/mm/c-r4k.c > +++ b/arch/mips/mm/c-r4k.c > @@ -1609,7 +1609,7 @@ static void __init loongson2_sc_init(void) > c->options |= MIPS_CPU_INCLUSIVE_CACHES; > } > > -static void __init loongson3_sc_init(void) > +static void loongson3_sc_init(void) > { > struct cpuinfo_mips *c = ¤t_cpu_data; > unsigned int config2, lsize; > diff --git a/arch/mips/mm/sc-mips.c b/arch/mips/mm/sc-mips.c > index dd0a5becaabd..06ec304ad4d1 100644 > --- a/arch/mips/mm/sc-mips.c > +++ b/arch/mips/mm/sc-mips.c > @@ -146,7 +146,7 @@ static inline int mips_sc_is_activated(struct cpuinfo_mips *c) > return 1; > } > > -static int __init mips_sc_probe_cm3(void) > +static int mips_sc_probe_cm3(void) > { > struct cpuinfo_mips *c = ¤t_cpu_data; > unsigned long cfg = read_gcr_l2_config(); > @@ -180,7 +180,7 @@ static int __init mips_sc_probe_cm3(void) > return 0; > } > > -static inline int __init mips_sc_probe(void) > +static inline int mips_sc_probe(void) > { > struct cpuinfo_mips *c = ¤t_cpu_data; > unsigned int config1, config2; > -- > 2.29.2 > -- Thanks, ~Nick Desaulniers