Commit f306b90c authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'smp-urgent-2021-09-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull CPU hotplug updates from Thomas Gleixner:
 "Updates for the SMP and CPU hotplug:

   - Remove DEFINE_SMP_CALL_CACHE_FUNCTION() which is a left over of the
     original hotplug code and now causing trouble with the ARM64 cache
     topology setup due to the pointless SMP function call.

     It's not longer required as the hotplug callbacks are guaranteed to
     be invoked on the upcoming CPU.

   - Remove the deprecated and now unused CPU hotplug functions

   - Rewrite the CPU hotplug API documentation"

* tag 'smp-urgent-2021-09-12' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  Documentation: core-api/cpuhotplug: Rewrite the API section
  cpu/hotplug: Remove deprecated CPU-hotplug functions.
  thermal: Replace deprecated CPU-hotplug functions.
  drivers: base: cacheinfo: Get rid of DEFINE_SMP_CALL_CACHE_FUNCTION()
parents d8e988b6 c9871c80
This diff is collapsed.
...@@ -43,7 +43,7 @@ static void ci_leaf_init(struct cacheinfo *this_leaf, ...@@ -43,7 +43,7 @@ static void ci_leaf_init(struct cacheinfo *this_leaf,
this_leaf->type = type; this_leaf->type = type;
} }
static int __init_cache_level(unsigned int cpu) int init_cache_level(unsigned int cpu)
{ {
unsigned int ctype, level, leaves, fw_level; unsigned int ctype, level, leaves, fw_level;
struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
...@@ -78,7 +78,7 @@ static int __init_cache_level(unsigned int cpu) ...@@ -78,7 +78,7 @@ static int __init_cache_level(unsigned int cpu)
return 0; return 0;
} }
static int __populate_cache_leaves(unsigned int cpu) int populate_cache_leaves(unsigned int cpu)
{ {
unsigned int level, idx; unsigned int level, idx;
enum cache_type type; enum cache_type type;
...@@ -97,6 +97,3 @@ static int __populate_cache_leaves(unsigned int cpu) ...@@ -97,6 +97,3 @@ static int __populate_cache_leaves(unsigned int cpu)
} }
return 0; return 0;
} }
DEFINE_SMP_CALL_CACHE_FUNCTION(init_cache_level)
DEFINE_SMP_CALL_CACHE_FUNCTION(populate_cache_leaves)
...@@ -17,7 +17,7 @@ do { \ ...@@ -17,7 +17,7 @@ do { \
leaf++; \ leaf++; \
} while (0) } while (0)
static int __init_cache_level(unsigned int cpu) int init_cache_level(unsigned int cpu)
{ {
struct cpuinfo_mips *c = &current_cpu_data; struct cpuinfo_mips *c = &current_cpu_data;
struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
...@@ -74,7 +74,7 @@ static void fill_cpumask_cluster(int cpu, cpumask_t *cpu_map) ...@@ -74,7 +74,7 @@ static void fill_cpumask_cluster(int cpu, cpumask_t *cpu_map)
cpumask_set_cpu(cpu1, cpu_map); cpumask_set_cpu(cpu1, cpu_map);
} }
static int __populate_cache_leaves(unsigned int cpu) int populate_cache_leaves(unsigned int cpu)
{ {
struct cpuinfo_mips *c = &current_cpu_data; struct cpuinfo_mips *c = &current_cpu_data;
struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
...@@ -114,6 +114,3 @@ static int __populate_cache_leaves(unsigned int cpu) ...@@ -114,6 +114,3 @@ static int __populate_cache_leaves(unsigned int cpu)
return 0; return 0;
} }
DEFINE_SMP_CALL_CACHE_FUNCTION(init_cache_level)
DEFINE_SMP_CALL_CACHE_FUNCTION(populate_cache_leaves)
...@@ -113,7 +113,7 @@ static void fill_cacheinfo(struct cacheinfo **this_leaf, ...@@ -113,7 +113,7 @@ static void fill_cacheinfo(struct cacheinfo **this_leaf,
} }
} }
static int __init_cache_level(unsigned int cpu) int init_cache_level(unsigned int cpu)
{ {
struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
struct device_node *np = of_cpu_device_node_get(cpu); struct device_node *np = of_cpu_device_node_get(cpu);
...@@ -155,7 +155,7 @@ static int __init_cache_level(unsigned int cpu) ...@@ -155,7 +155,7 @@ static int __init_cache_level(unsigned int cpu)
return 0; return 0;
} }
static int __populate_cache_leaves(unsigned int cpu) int populate_cache_leaves(unsigned int cpu)
{ {
struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
struct cacheinfo *this_leaf = this_cpu_ci->info_list; struct cacheinfo *this_leaf = this_cpu_ci->info_list;
...@@ -187,6 +187,3 @@ static int __populate_cache_leaves(unsigned int cpu) ...@@ -187,6 +187,3 @@ static int __populate_cache_leaves(unsigned int cpu)
return 0; return 0;
} }
DEFINE_SMP_CALL_CACHE_FUNCTION(init_cache_level)
DEFINE_SMP_CALL_CACHE_FUNCTION(populate_cache_leaves)
...@@ -985,7 +985,7 @@ static void ci_leaf_init(struct cacheinfo *this_leaf, ...@@ -985,7 +985,7 @@ static void ci_leaf_init(struct cacheinfo *this_leaf,
this_leaf->priv = base->nb; this_leaf->priv = base->nb;
} }
static int __init_cache_level(unsigned int cpu) int init_cache_level(unsigned int cpu)
{ {
struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
...@@ -1014,7 +1014,7 @@ static void get_cache_id(int cpu, struct _cpuid4_info_regs *id4_regs) ...@@ -1014,7 +1014,7 @@ static void get_cache_id(int cpu, struct _cpuid4_info_regs *id4_regs)
id4_regs->id = c->apicid >> index_msb; id4_regs->id = c->apicid >> index_msb;
} }
static int __populate_cache_leaves(unsigned int cpu) int populate_cache_leaves(unsigned int cpu)
{ {
unsigned int idx, ret; unsigned int idx, ret;
struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu);
...@@ -1033,6 +1033,3 @@ static int __populate_cache_leaves(unsigned int cpu) ...@@ -1033,6 +1033,3 @@ static int __populate_cache_leaves(unsigned int cpu)
return 0; return 0;
} }
DEFINE_SMP_CALL_CACHE_FUNCTION(init_cache_level)
DEFINE_SMP_CALL_CACHE_FUNCTION(populate_cache_leaves)
...@@ -79,24 +79,6 @@ struct cpu_cacheinfo { ...@@ -79,24 +79,6 @@ struct cpu_cacheinfo {
bool cpu_map_populated; bool cpu_map_populated;
}; };
/*
* Helpers to make sure "func" is executed on the cpu whose cache
* attributes are being detected
*/
#define DEFINE_SMP_CALL_CACHE_FUNCTION(func) \
static inline void _##func(void *ret) \
{ \
int cpu = smp_processor_id(); \
*(int *)ret = __##func(cpu); \
} \
\
int func(unsigned int cpu) \
{ \
int ret; \
smp_call_function_single(cpu, _##func, &ret, true); \
return ret; \
}
struct cpu_cacheinfo *get_cpu_cacheinfo(unsigned int cpu); struct cpu_cacheinfo *get_cpu_cacheinfo(unsigned int cpu);
int init_cache_level(unsigned int cpu); int init_cache_level(unsigned int cpu);
int populate_cache_leaves(unsigned int cpu); int populate_cache_leaves(unsigned int cpu);
......
...@@ -143,12 +143,6 @@ static inline int remove_cpu(unsigned int cpu) { return -EPERM; } ...@@ -143,12 +143,6 @@ static inline int remove_cpu(unsigned int cpu) { return -EPERM; }
static inline void smp_shutdown_nonboot_cpus(unsigned int primary_cpu) { } static inline void smp_shutdown_nonboot_cpus(unsigned int primary_cpu) { }
#endif /* !CONFIG_HOTPLUG_CPU */ #endif /* !CONFIG_HOTPLUG_CPU */
/* Wrappers which go away once all code is converted */
static inline void cpu_hotplug_begin(void) { cpus_write_lock(); }
static inline void cpu_hotplug_done(void) { cpus_write_unlock(); }
static inline void get_online_cpus(void) { cpus_read_lock(); }
static inline void put_online_cpus(void) { cpus_read_unlock(); }
#ifdef CONFIG_PM_SLEEP_SMP #ifdef CONFIG_PM_SLEEP_SMP
extern int freeze_secondary_cpus(int primary); extern int freeze_secondary_cpus(int primary);
extern void thaw_secondary_cpus(void); extern void thaw_secondary_cpus(void);
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment