Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1b338b75 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "cpu-hotplug: Keep atleast 1 online and un-isolated CPU"

parents 2f97bb4d 68435b04
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -103,6 +103,13 @@ extern struct cpumask __cpu_isolated_mask;
#define num_present_cpus()	cpumask_weight(cpu_present_mask)
#define num_active_cpus()	cpumask_weight(cpu_active_mask)
#define num_isolated_cpus()	cpumask_weight(cpu_isolated_mask)
#define num_online_uniso_cpus()						\
({									\
	cpumask_t mask;							\
									\
	cpumask_andnot(&mask, cpu_online_mask, cpu_isolated_mask);	\
	cpumask_weight(&mask);						\
})
#define cpu_online(cpu)		cpumask_test_cpu((cpu), cpu_online_mask)
#define cpu_possible(cpu)	cpumask_test_cpu((cpu), cpu_possible_mask)
#define cpu_present(cpu)	cpumask_test_cpu((cpu), cpu_present_mask)
@@ -114,6 +121,7 @@ extern struct cpumask __cpu_isolated_mask;
#define num_present_cpus()	1U
#define num_active_cpus()	1U
#define num_isolated_cpus()	0U
#define num_online_uniso_cpus()	1U
#define cpu_online(cpu)		((cpu) == 0)
#define cpu_possible(cpu)	((cpu) == 0)
#define cpu_present(cpu)	((cpu) == 0)
+3 −0
Original line number Diff line number Diff line
@@ -886,6 +886,9 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen,
	if (!cpu_present(cpu))
		return -EINVAL;

	if (!tasks_frozen && !cpu_isolated(cpu) && num_online_uniso_cpus() == 1)
		return -EBUSY;

	cpu_hotplug_begin();

	cpuhp_tasks_frozen = tasks_frozen;