Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3529382pxf; Mon, 15 Mar 2021 11:35:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4j9Y8SPvJGfuHlaruVda03EPfhkPAMhWXhDirZZhNbU0ZbDdxLE77xfyk8IXIIv/A+YH/ X-Received: by 2002:a17:906:405b:: with SMTP id y27mr25806504ejj.332.1615833321025; Mon, 15 Mar 2021 11:35:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833321; cv=none; d=google.com; s=arc-20160816; b=LHwnT0wfAfcu/3LvV6kueotswflFeHAmGBfMipcZNOpyfcGNwN/B05fOcsVbPScr+c 8Yp7dLMwAfREZUEs9HHZhe2FCouvEWKrIOPbELtcmzVQLHwufuvhrbHv66cxh2UjJdtT iDwPWojRT/E1xeRhg9AtQ/tbsMcl5R/3itdYHv9ERBNqQ1ZZclsNxPzSG6z3rGQvwDpT bLcyKGFfkQ4aQngWkkbTCmPV8I8QYGfANH4kyw5oHuk69/vktn99++uECWEJup/LztCd N5j9jow+yyu1O9U/HmJcQvwKb03Yp+rJs9Qia30B4+SxXSb8bhTIsZg0Okl0yvZHYPB3 x/8A== 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=NbVdJmZXQm9JA4+uD85VxaIAMIabx8mlrcGyj+n1UZs=; b=tBrzywyGI4tsUbQRyEtwMRSnM1miBG6i4JtL/2aoQtt3iQ9xz5+i1d+0maLXvy4nTu y5yipjBzwf9Hl6yqPnnORaiczhmFjzS0004G5PqdfpSaLbATPCW3VT2ev1ZK0KZzqz+t 3BFmsMaGMtcNNWtIU/38qgZLvqyNqECNCj7sbS42il1F/aW+pjfh65C0AdMuVwsu+vfz 67ANNw/PWllb9wguczDGWKuH0QamHlnyxW2PWkIgVnKZE0q+fV+MRMHjeC2CYcT1rl9O qlPGNhQDupTC+Y4uTHGKXiAxpPYo5Aax+tdDwgc1xwGchr7XtkYIVBQw4Rpix/EH4Vhu QiRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kzLAjk69; 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=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 n23si11623936ejr.458.2021.03.15.11.34.58; Mon, 15 Mar 2021 11:35:21 -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=@linuxfoundation.org header.s=korg header.b=kzLAjk69; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238572AbhCOOoq (ORCPT + 99 others); Mon, 15 Mar 2021 10:44:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:50636 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233409AbhCOOD7 (ORCPT ); Mon, 15 Mar 2021 10:03:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B802B601FD; Mon, 15 Mar 2021 14:03:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615817038; bh=jgDr7UFE95eDwhVGUY1fgFT5YLguv6+y7jJKzlTr5HI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kzLAjk69AYnfdI28rPLWS2ge7l/Cxg03XkXxXoMZvMgTjSEaelL/3ZNZJ5W6ttj/D vTtCEaNBI7/VBz5YWANyUdYBYxBeCHtw205ET4pSO4V0ya7PqWpyLop4xGcPsS2Yx+ zdHvx0NLqb2quLHR9+1ghvADfFs8Sw8usQSSVhKw= 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.10 258/290] stop_machine: mark helpers __always_inline Date: Mon, 15 Mar 2021 14:55:51 +0100 Message-Id: <20210315135550.728430645@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h index 76d8b09384a7..63ea9aff368f 100644 --- a/include/linux/stop_machine.h +++ b/include/linux/stop_machine.h @@ -123,7 +123,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; @@ -134,14 +134,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); } -- 2.30.1