Revert "padata: validate cpumask without removed CPU during offline"

This reverts commit 2b1207801c which is
commit 6bd87eec23cbc9ed222bed0f5b5b02bf300e9a8d upstream.

It breaks the Android kernel abi and is not needed in this branch at
this point in time.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Idf0bfa987ca8fa7932e390ddc7ad4c8c020f40b2
This commit is contained in:
Greg Kroah-Hartman 2021-08-09 16:04:54 +02:00
parent 51aa764028
commit 79cb5d085a
2 changed files with 4 additions and 15 deletions

View File

@ -59,7 +59,6 @@ enum cpuhp_state {
CPUHP_IOMMU_INTEL_DEAD,
CPUHP_LUSTRE_CFS_DEAD,
CPUHP_AP_ARM_CACHE_B15_RAC_DEAD,
CPUHP_PADATA_DEAD,
CPUHP_WORKQUEUE_PREP,
CPUHP_POWER_NUMA_PREPARE,
CPUHP_HRTIMERS_PREPARE,

View File

@ -682,7 +682,7 @@ static int __padata_remove_cpu(struct padata_instance *pinst, int cpu)
{
struct parallel_data *pd = NULL;
if (!cpumask_test_cpu(cpu, cpu_online_mask)) {
if (cpumask_test_cpu(cpu, cpu_online_mask)) {
if (!padata_validate_cpumask(pinst, pinst->cpumask.pcpu) ||
!padata_validate_cpumask(pinst, pinst->cpumask.cbcpu))
@ -758,7 +758,7 @@ static int padata_cpu_online(unsigned int cpu, struct hlist_node *node)
return ret;
}
static int padata_cpu_dead(unsigned int cpu, struct hlist_node *node)
static int padata_cpu_prep_down(unsigned int cpu, struct hlist_node *node)
{
struct padata_instance *pinst;
int ret;
@ -779,7 +779,6 @@ static enum cpuhp_state hp_online;
static void __padata_free(struct padata_instance *pinst)
{
#ifdef CONFIG_HOTPLUG_CPU
cpuhp_state_remove_instance_nocalls(CPUHP_PADATA_DEAD, &pinst->node);
cpuhp_state_remove_instance_nocalls(hp_online, &pinst->node);
#endif
@ -965,8 +964,6 @@ static struct padata_instance *padata_alloc(struct workqueue_struct *wq,
#ifdef CONFIG_HOTPLUG_CPU
cpuhp_state_add_instance_nocalls_cpuslocked(hp_online, &pinst->node);
cpuhp_state_add_instance_nocalls_cpuslocked(CPUHP_PADATA_DEAD,
&pinst->node);
#endif
return pinst;
@ -1013,24 +1010,17 @@ static __init int padata_driver_init(void)
int ret;
ret = cpuhp_setup_state_multi(CPUHP_AP_ONLINE_DYN, "padata:online",
padata_cpu_online, NULL);
padata_cpu_online,
padata_cpu_prep_down);
if (ret < 0)
return ret;
hp_online = ret;
ret = cpuhp_setup_state_multi(CPUHP_PADATA_DEAD, "padata:dead",
NULL, padata_cpu_dead);
if (ret < 0) {
cpuhp_remove_multi_state(hp_online);
return ret;
}
return 0;
}
module_init(padata_driver_init);
static __exit void padata_driver_exit(void)
{
cpuhp_remove_multi_state(CPUHP_PADATA_DEAD);
cpuhp_remove_multi_state(hp_online);
}
module_exit(padata_driver_exit);