From patchwork Mon Mar 15 13:56:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 400477 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3469934jai; Mon, 15 Mar 2021 07:25:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3AU0eolyGCVfEi+mPB3dKjnHxSCCQ3NcKmlO8ySEmgn3SJuvwTL6SNhInkjLeoh0EdbJ9 X-Received: by 2002:a17:906:4d96:: with SMTP id s22mr23815027eju.189.1615817485705; Mon, 15 Mar 2021 07:11:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615817485; cv=none; d=google.com; s=arc-20160816; b=iCAjRZ6CGXas8UHzXQmmeOd7KrnkIHPFjuIdB5ccwowWD0CJhxm927F0bBIJ7yWu1u mZU8rNSBurJ5Qpz2oZvxM0MVXSNM/UoD4KDre8n5qhiTxs5Lc70dicIOSx+LK+v+Czhr 0A2VgwDe6Lx62fO2gXQhTFQ1j9P90WbzTbN4is8q0cgzqMJEgkkryRSIiVeT3sdKshqs rEdq0P+XMRt/iow80+8dBueA7O1JAvRQcyGPPbNTJw/1HEZb0a/KzsURGckcrkTYNk3r IVJGMpUdPtYKiSlKTcdain5gFlQB4ar6mFIhRHZv/cTiLww87ZDCE/bMoMaKHmsKMljd whnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=c3r/YFTwLpHVXnaCnf8ewvRR24N5reYKxHvrogfQuA8=; b=QC/4vsN4lt5NqN+GSfaKoic67sqlMllyDB0IKPaOPUrZwCEzTMzAVQwQTL9HBwDtci ojiAjv3MjwNhgaM843xHrpCiTjK/V+clzDrDkpeCV4DuAeHSEXoEZdrOR7Xh5RazgjOO hE/t7YRigcJGCg8v9/b4Gqqfn90NiMRI+lI2r93NlqkRwCpkDZ3Kuy6TBRC+S/zAxH3m /rQdPLdiMsDhxDRZPjGEnsJnYGa9vvHCZbtMwZmSuAPwRlkZgto2EomK67X53xWA2jgp YltgKeB0O0IXBCEBznOBc6O52pqYhvKn8XHeOU1mJh8VG6YrYaO/AfR1goYKUdtiCpkm /4Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JZAsTcUn; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h21si993553ede.37.2021.03.15.07.11.25; Mon, 15 Mar 2021 07:11:25 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=@linuxfoundation.org header.s=korg header.b=JZAsTcUn; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234833AbhCOOFs (ORCPT + 12 others); Mon, 15 Mar 2021 10:05:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:37522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233257AbhCOOBO (ORCPT ); Mon, 15 Mar 2021 10:01:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8858864FB9; Mon, 15 Mar 2021 14:00:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816854; bh=H5n6OzR0lRm0YBbszEc+OPLqs095ObveV2/p9M8bxBM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JZAsTcUnNcdoCCSOuFQt7PUYrhd6oGd60KSogpmeGk6oWzp+tjD3JFz2EzhPNyPPl rZ1G6sIKNXUbRBnXMAjzpohUhq9fd6TJBCCKhDZ/wriIrryLRSOx25+U4MYlO5X3Pg S/AyzUxoFZwpsI9+hucSvYhn1sAVePqy6dI6k2KM= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Thomas Gleixner , Sebastian Andrzej Siewior , "Paul E. McKenney" , Ingo Molnar , Prarit Bhargava , Daniel Bristot de Oliveira , Peter Zijlstra , Valentin Schneider , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 5.4 153/168] stop_machine: mark helpers __always_inline Date: Mon, 15 Mar 2021 14:56:25 +0100 Message-Id: <20210315135555.378287412@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135550.333963635@linuxfoundation.org> References: <20210315135550.333963635@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Greg Kroah-Hartman From: Arnd Bergmann [ Upstream commit cbf78d85079cee662c45749ef4f744d41be85d48 ] With clang-13, some functions only get partially inlined, with a specialized version referring to a global variable. This triggers a harmless build-time check for the intel-rng driver: WARNING: modpost: drivers/char/hw_random/intel-rng.o(.text+0xe): Section mismatch in reference from the function stop_machine() to the function .init.text:intel_rng_hw_init() The function stop_machine() references the function __init intel_rng_hw_init(). This is often because stop_machine lacks a __init annotation or the annotation of intel_rng_hw_init is wrong. In this instance, an easy workaround is to force the stop_machine() function to be inline, along with related interfaces that did not show the same behavior at the moment, but theoretically could. The combination of the two patches listed below triggers the behavior in clang-13, but individually these commits are correct. Link: https://lkml.kernel.org/r/20210225130153.1956990-1-arnd@kernel.org Fixes: fe5595c07400 ("stop_machine: Provide stop_machine_cpuslocked()") Fixes: ee527cd3a20c ("Use stop_machine_run in the Intel RNG driver") Signed-off-by: Arnd Bergmann Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Thomas Gleixner Cc: Sebastian Andrzej Siewior Cc: "Paul E. McKenney" Cc: Ingo Molnar Cc: Prarit Bhargava Cc: Daniel Bristot de Oliveira Cc: Peter Zijlstra Cc: Valentin Schneider Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- include/linux/stop_machine.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- 2.30.1 diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h index f9a0c6189852..69998fc5ffe9 100644 --- a/include/linux/stop_machine.h +++ b/include/linux/stop_machine.h @@ -139,7 +139,7 @@ int stop_machine_from_inactive_cpu(cpu_stop_fn_t fn, void *data, const struct cpumask *cpus); #else /* CONFIG_SMP || CONFIG_HOTPLUG_CPU */ -static inline int stop_machine_cpuslocked(cpu_stop_fn_t fn, void *data, +static __always_inline int stop_machine_cpuslocked(cpu_stop_fn_t fn, void *data, const struct cpumask *cpus) { unsigned long flags; @@ -150,14 +150,15 @@ static inline int stop_machine_cpuslocked(cpu_stop_fn_t fn, void *data, return ret; } -static inline int stop_machine(cpu_stop_fn_t fn, void *data, - const struct cpumask *cpus) +static __always_inline int +stop_machine(cpu_stop_fn_t fn, void *data, const struct cpumask *cpus) { return stop_machine_cpuslocked(fn, data, cpus); } -static inline int stop_machine_from_inactive_cpu(cpu_stop_fn_t fn, void *data, - const struct cpumask *cpus) +static __always_inline int +stop_machine_from_inactive_cpu(cpu_stop_fn_t fn, void *data, + const struct cpumask *cpus) { return stop_machine(fn, data, cpus); }