Received: by 10.213.65.68 with SMTP id h4csp654835imn; Fri, 6 Apr 2018 06:51:17 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+2ARVBj4EJF7B4e/qvQ7FQzhpf7lvJvZ2/pur717tp055f1LfJCHZ1+a79hSIc9dyMxhrK X-Received: by 2002:a17:902:6a88:: with SMTP id n8-v6mr27617914plk.131.1523022677254; Fri, 06 Apr 2018 06:51:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523022677; cv=none; d=google.com; s=arc-20160816; b=bVhycKoMKmyPBbGS8AHyer0Bkpj1ElZ+cSM1qhtlOwTS07YDI5Ravc/FrSRDy1zZX/ BZQa7oZ5MoJDg9YvZqoTz8kVE6P/NCwWlPlpOYBPsVDJyggoz6SSOFr4wq2TJzaZJj71 CTAFiK/521Ib2ot1HFhcpzUCrLSGoaDg0YKhfb1z6D9SSvs3y9wKZGxEILRgKKBDpQBD vQCa1Lx7fkBjf5OOKeP72Sq4kSnXF6KPHfakIV6ccsIKQekEJCRLRqk/v89TP24O8jkD vM6txReuKpswNVF0URpA6jJzxTBAeKCXvylgZMjZFIc2l5L8BjLpmJIQobi0GtQS4A7s v6Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=p2Z6DG5TVkPFJtgwuvkpWubTW+hwvqGZT0l6SB9wEGY=; b=ZAwwtjdqI0ggNbnApLC96MrwiPsFnkQh2zvaqB3TCkgblxaMX3J/5iCYhA4U3blGNI qIauUt6O7Y/ieCHxA9jUn27YkSMc1yfMS3tzA/7NsFvTQljsYO6oQMCHySRimvBz3I9I VzwuiMoWV4GyIi/rVfvEAvcwo+nlO39/aEqtL1nMs0IAvjN0SLAYeed/9DJFL79Rim0L kpXS75BgehZX/ilupImexEZfjPq3n7wJ3cvC6aZ/0zFX2+2hhCWVf0jOBzotyJc/ZmyB 95mEHQyPM3BU/Q8V4ThqKShuP49WGqnLkiwpkw4RP1r44fhs5PkLLY/OXtFJgaT3stOr 7jNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1-v6si8320512plo.421.2018.04.06.06.51.03; Fri, 06 Apr 2018 06:51:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933023AbeDFNpF (ORCPT + 99 others); Fri, 6 Apr 2018 09:45:05 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37962 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932996AbeDFNpB (ORCPT ); Fri, 6 Apr 2018 09:45:01 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 10A14E08; Fri, 6 Apr 2018 13:45:00 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gaku Inami , Dietmar Eggemann , Sudeep Holla Subject: [PATCH 4.16 25/31] Revert "base: arch_topology: fix section mismatch build warnings" Date: Fri, 6 Apr 2018 15:24:50 +0200 Message-Id: <20180406084344.454929769@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084340.999820380@linuxfoundation.org> References: <20180406084340.999820380@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gaku Inami commit 9de9a449482677a75f1edd2049268a7efc40fc96 upstream. This reverts commit 452562abb5b7 ("base: arch_topology: fix section mismatch build warnings"). It causes the notifier call hangs in some use-cases. In some cases with using maxcpus, some of cpus are booted first and then the remaining cpus are booted. As an example, some users who want to realize fast boot up often use the following procedure. 1) Define all CPUs on device tree (CA57x4 + CA53x4) 2) Add "maxcpus=4" in bootargs 3) Kernel boot up with CA57x4 4) After kernel boot up, CA53x4 is booted from user When kernel init was finished, CPUFREQ_POLICY_NOTIFIER was not still unregisterd. This means that "__init init_cpu_capacity_callback()" will be called after kernel init sequence. To avoid this problem, it needs to remove __init{,data} annotations by reverting this commit. Also, this commit was needed to fix kernel compile issue below. However, this issue was also fixed by another patch: commit 82d8ba717ccb ("arch_topology: Fix section miss match warning due to free_raw_capacity()") in v4.15 as well. Whereas commit 452562abb5b7 added all the missing __init annotations, commit 82d8ba717ccb removed it from free_raw_capacity(). WARNING: vmlinux.o(.text+0x548f24): Section mismatch in reference from the function init_cpu_capacity_callback() to the variable .init.text:$x The function init_cpu_capacity_callback() references the variable __init $x. This is often because init_cpu_capacity_callback lacks a __init annotation or the annotation of $x is wrong. Fixes: 82d8ba717ccb ("arch_topology: Fix section miss match warning due to free_raw_capacity()") Cc: stable Signed-off-by: Gaku Inami Reviewed-by: Dietmar Eggemann Tested-by: Dietmar Eggemann Acked-by: Sudeep Holla Signed-off-by: Greg Kroah-Hartman --- drivers/base/arch_topology.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -169,11 +169,11 @@ bool __init topology_parse_cpu_capacity( } #ifdef CONFIG_CPU_FREQ -static cpumask_var_t cpus_to_visit __initdata; -static void __init parsing_done_workfn(struct work_struct *work); -static __initdata DECLARE_WORK(parsing_done_work, parsing_done_workfn); +static cpumask_var_t cpus_to_visit; +static void parsing_done_workfn(struct work_struct *work); +static DECLARE_WORK(parsing_done_work, parsing_done_workfn); -static int __init +static int init_cpu_capacity_callback(struct notifier_block *nb, unsigned long val, void *data) @@ -209,7 +209,7 @@ init_cpu_capacity_callback(struct notifi return 0; } -static struct notifier_block init_cpu_capacity_notifier __initdata = { +static struct notifier_block init_cpu_capacity_notifier = { .notifier_call = init_cpu_capacity_callback, }; @@ -242,7 +242,7 @@ static int __init register_cpufreq_notif } core_initcall(register_cpufreq_notifier); -static void __init parsing_done_workfn(struct work_struct *work) +static void parsing_done_workfn(struct work_struct *work) { cpufreq_unregister_notifier(&init_cpu_capacity_notifier, CPUFREQ_POLICY_NOTIFIER);