View | Details | Raw Unified | Return to bug 106371 | Differences between
and this patch

Collapse All | Expand All

(-)linux/arch/x86/kernel/smpboot.c (+15 lines)
Lines 53-58 Link Here
53
#include <linux/stackprotector.h>
53
#include <linux/stackprotector.h>
54
#include <linux/gfp.h>
54
#include <linux/gfp.h>
55
#include <linux/cpuidle.h>
55
#include <linux/cpuidle.h>
56
#include <linux/suspend.h>
56
57
57
#include <asm/acpi.h>
58
#include <asm/acpi.h>
58
#include <asm/desc.h>
59
#include <asm/desc.h>
Lines 1341-1346 void arch_enable_nonboot_cpus_end(void) Link Here
1341
	mtrr_aps_init();
1342
	mtrr_aps_init();
1342
}
1343
}
1343
1344
1345
void arch_disable_nonboot_cpus_pre(void)
1346
{
1347
	if (!hibernation_in_resume())
1348
		return;
1349
	kick_offline_cpus(1);
1350
}
1351
1352
void arch_enable_nonboot_cpus_prev(void)
1353
{
1354
	kick_offline_cpus(0);
1355
}
1356
1344
/*
1357
/*
1345
 * Early setup to make printk work.
1358
 * Early setup to make printk work.
1346
 */
1359
 */
Lines 1642-1647 void native_play_dead(void) Link Here
1642
	play_dead_common();
1655
	play_dead_common();
1643
	tboot_shutdown(TB_SHUTDOWN_WFS);
1656
	tboot_shutdown(TB_SHUTDOWN_WFS);
1644
1657
1658
	if (hibernation_in_resume())
1659
		hlt_play_dead();
1645
	mwait_play_dead();	/* Only returns on failure */
1660
	mwait_play_dead();	/* Only returns on failure */
1646
	if (cpuidle_play_dead())
1661
	if (cpuidle_play_dead())
1647
		hlt_play_dead();
1662
		hlt_play_dead();
(-)linux/kernel/cpu.c (+22 lines)
Lines 1016-1021 EXPORT_SYMBOL_GPL(cpu_up); Link Here
1016
1016
1017
#ifdef CONFIG_PM_SLEEP_SMP
1017
#ifdef CONFIG_PM_SLEEP_SMP
1018
static cpumask_var_t frozen_cpus;
1018
static cpumask_var_t frozen_cpus;
1019
static cpumask_var_t offline_cpus;
1020
1021
int kick_offline_cpus(int first)
1022
{
1023
	int cpu;
1024
1025
	if (offline_cpus == NULL)
1026
		return -ENOMEM;
1027
1028
	if (first)
1029
		cpumask_andnot(offline_cpus, cpu_possible_mask, cpu_online_mask);
1030
1031
	for_each_cpu(cpu, offline_cpus) {
1032
		_cpu_up(cpu, 1, CPUHP_ONLINE);
1033
		_cpu_down(cpu, 1, CPUHP_OFFLINE);
1034
	}
1035
1036
	return 0;
1037
}
1019
1038
1020
void __weak arch_disable_nonboot_cpus_pre(void)
1039
void __weak arch_disable_nonboot_cpus_pre(void)
1021
{
1040
{
Lines 1120-1125 static int __init alloc_frozen_cpus(void Link Here
1120
{
1139
{
1121
	if (!alloc_cpumask_var(&frozen_cpus, GFP_KERNEL|__GFP_ZERO))
1140
	if (!alloc_cpumask_var(&frozen_cpus, GFP_KERNEL|__GFP_ZERO))
1122
		return -ENOMEM;
1141
		return -ENOMEM;
1142
	/* No need to free frozen_cpus if failed. */
1143
	if (!alloc_cpumask_var(&offline_cpus, GFP_KERNEL|__GFP_ZERO))
1144
		return -ENOMEM;
1123
	return 0;
1145
	return 0;
1124
}
1146
}
1125
core_initcall(alloc_frozen_cpus);
1147
core_initcall(alloc_frozen_cpus);
(-)linux/include/linux/cpu.h (+2 lines)
Lines 241-249 static inline void cpu_hotplug_done(void Link Here
241
#ifdef CONFIG_PM_SLEEP_SMP
241
#ifdef CONFIG_PM_SLEEP_SMP
242
extern int disable_nonboot_cpus(void);
242
extern int disable_nonboot_cpus(void);
243
extern void enable_nonboot_cpus(void);
243
extern void enable_nonboot_cpus(void);
244
extern int kick_offline_cpus(int first);
244
#else /* !CONFIG_PM_SLEEP_SMP */
245
#else /* !CONFIG_PM_SLEEP_SMP */
245
static inline int disable_nonboot_cpus(void) { return 0; }
246
static inline int disable_nonboot_cpus(void) { return 0; }
246
static inline void enable_nonboot_cpus(void) {}
247
static inline void enable_nonboot_cpus(void) {}
248
static inline int kick_offline_cpus(int first) { return 0; }
247
#endif /* !CONFIG_PM_SLEEP_SMP */
249
#endif /* !CONFIG_PM_SLEEP_SMP */
248
250
249
void cpu_startup_entry(enum cpuhp_state state);
251
void cpu_startup_entry(enum cpuhp_state state);

Return to bug 106371