Patch "stop_machine: mark helpers __always_inline" has been added to the 5.11-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    stop_machine: mark helpers __always_inline

to the 5.11-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     stop_machine-mark-helpers-__always_inline.patch
and it can be found in the queue-5.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 2ae64071e4d641845c0ed45f039e4772d77539a9
Author: Arnd Bergmann <arnd@xxxxxxxx>
Date:   Fri Mar 12 21:07:04 2021 -0800

    stop_machine: mark helpers __always_inline
    
    [ 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@xxxxxxxxxx
    Fixes: fe5595c07400 ("stop_machine: Provide stop_machine_cpuslocked()")
    Fixes: ee527cd3a20c ("Use stop_machine_run in the Intel RNG driver")
    Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
    Cc: Nathan Chancellor <nathan@xxxxxxxxxx>
    Cc: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
    Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
    Cc: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
    Cc: "Paul E. McKenney" <paulmck@xxxxxxxxxx>
    Cc: Ingo Molnar <mingo@xxxxxxxxxx>
    Cc: Prarit Bhargava <prarit@xxxxxxxxxx>
    Cc: Daniel Bristot de Oliveira <bristot@xxxxxxxxxx>
    Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
    Cc: Valentin Schneider <valentin.schneider@xxxxxxx>
    Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h
index 30577c3aecf8..46fb3ebdd16e 100644
--- a/include/linux/stop_machine.h
+++ b/include/linux/stop_machine.h
@@ -128,7 +128,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;
@@ -139,14 +139,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);
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux