Skip to content

Commit b272f73

Browse files
committed
Merge branch 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull SMP hotplug notifier removal from Thomas Gleixner: "This is the final cleanup of the hotplug notifier infrastructure. The series has been reintgrated in the last two days because there came a new driver using the old infrastructure via the SCSI tree. Summary: - convert the last leftover drivers utilizing notifiers - fixup for a completely broken hotplug user - prevent setup of already used states - removal of the notifiers - treewide cleanup of hotplug state names - consolidation of state space There is a sphinx based documentation pending, but that needs review from the documentation folks" * 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/armada-xp: Consolidate hotplug state space irqchip/gic: Consolidate hotplug state space coresight/etm3/4x: Consolidate hotplug state space cpu/hotplug: Cleanup state names cpu/hotplug: Remove obsolete cpu hotplug register/unregister functions staging/lustre/libcfs: Convert to hotplug state machine scsi/bnx2i: Convert to hotplug state machine scsi/bnx2fc: Convert to hotplug state machine cpu/hotplug: Prevent overwriting of callbacks x86/msr: Remove bogus cleanup from the error path bus: arm-ccn: Prevent hotplug callback leak perf/x86/intel/cstate: Prevent hotplug callback leak ARM/imx/mmcd: Fix broken cpu hotplug handling scsi: qedi: Convert to hotplug state machine
2 parents 10bbe75 + 008b69e commit b272f73

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+308
-689
lines changed

arch/arm/kernel/smp_twd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ static int __init twd_local_timer_common_register(struct device_node *np)
339339
}
340340

341341
cpuhp_setup_state_nocalls(CPUHP_AP_ARM_TWD_STARTING,
342-
"AP_ARM_TWD_STARTING",
342+
"arm/timer/twd:starting",
343343
twd_timer_starting_cpu, twd_timer_dying_cpu);
344344

345345
twd_get_clock(np);

arch/arm/mach-imx/mmdc.c

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060

6161
#define to_mmdc_pmu(p) container_of(p, struct mmdc_pmu, pmu)
6262

63+
static enum cpuhp_state cpuhp_mmdc_state;
6364
static int ddr_type;
6465

6566
struct fsl_mmdc_devtype_data {
@@ -451,8 +452,8 @@ static int imx_mmdc_remove(struct platform_device *pdev)
451452
{
452453
struct mmdc_pmu *pmu_mmdc = platform_get_drvdata(pdev);
453454

455+
cpuhp_state_remove_instance_nocalls(cpuhp_mmdc_state, &pmu_mmdc->node);
454456
perf_pmu_unregister(&pmu_mmdc->pmu);
455-
cpuhp_remove_state_nocalls(CPUHP_ONLINE);
456457
kfree(pmu_mmdc);
457458
return 0;
458459
}
@@ -472,6 +473,18 @@ static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_b
472473
return -ENOMEM;
473474
}
474475

476+
/* The first instance registers the hotplug state */
477+
if (!cpuhp_mmdc_state) {
478+
ret = cpuhp_setup_state_multi(CPUHP_AP_ONLINE_DYN,
479+
"perf/arm/mmdc:online", NULL,
480+
mmdc_pmu_offline_cpu);
481+
if (ret < 0) {
482+
pr_err("cpuhp_setup_state_multi failed\n");
483+
goto pmu_free;
484+
}
485+
cpuhp_mmdc_state = ret;
486+
}
487+
475488
mmdc_num = mmdc_pmu_init(pmu_mmdc, mmdc_base, &pdev->dev);
476489
if (mmdc_num == 0)
477490
name = "mmdc";
@@ -485,26 +498,23 @@ static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_b
485498
HRTIMER_MODE_REL);
486499
pmu_mmdc->hrtimer.function = mmdc_pmu_timer_handler;
487500

488-
cpuhp_state_add_instance_nocalls(CPUHP_ONLINE,
489-
&pmu_mmdc->node);
490-
cpumask_set_cpu(smp_processor_id(), &pmu_mmdc->cpu);
491-
ret = cpuhp_setup_state_multi(CPUHP_AP_NOTIFY_ONLINE,
492-
"MMDC_ONLINE", NULL,
493-
mmdc_pmu_offline_cpu);
494-
if (ret) {
495-
pr_err("cpuhp_setup_state_multi failure\n");
496-
goto pmu_register_err;
497-
}
501+
cpumask_set_cpu(raw_smp_processor_id(), &pmu_mmdc->cpu);
502+
503+
/* Register the pmu instance for cpu hotplug */
504+
cpuhp_state_add_instance_nocalls(cpuhp_mmdc_state, &pmu_mmdc->node);
498505

499506
ret = perf_pmu_register(&(pmu_mmdc->pmu), name, -1);
500-
platform_set_drvdata(pdev, pmu_mmdc);
501507
if (ret)
502508
goto pmu_register_err;
509+
510+
platform_set_drvdata(pdev, pmu_mmdc);
503511
return 0;
504512

505513
pmu_register_err:
506514
pr_warn("MMDC Perf PMU failed (%d), disabled\n", ret);
515+
cpuhp_state_remove_instance_nocalls(cpuhp_mmdc_state, &pmu_mmdc->node);
507516
hrtimer_cancel(&pmu_mmdc->hrtimer);
517+
pmu_free:
508518
kfree(pmu_mmdc);
509519
return ret;
510520
}

arch/arm/mach-mvebu/coherency.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ static void __init armada_370_coherency_init(struct device_node *np)
148148
of_node_put(cpu_config_np);
149149

150150
cpuhp_setup_state_nocalls(CPUHP_AP_ARM_MVEBU_COHERENCY,
151-
"AP_ARM_MVEBU_COHERENCY",
151+
"arm/mvebu/coherency:starting",
152152
armada_xp_clear_l2_starting, NULL);
153153
exit:
154154
set_cpu_coherent();

arch/arm/mm/cache-l2x0-pmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ static __init int l2x0_pmu_init(void)
563563

564564
cpumask_set_cpu(0, &pmu_cpu);
565565
ret = cpuhp_setup_state_nocalls(CPUHP_AP_PERF_ARM_L2X0_ONLINE,
566-
"AP_PERF_ARM_L2X0_ONLINE", NULL,
566+
"perf/arm/l2x0:online", NULL,
567567
l2x0_pmu_offline_cpu);
568568
if (ret)
569569
goto out_pmu;

arch/arm/mm/cache-l2x0.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ static void __init l2c310_enable(void __iomem *base, unsigned num_lock)
683683

684684
if (aux & L310_AUX_CTRL_FULL_LINE_ZERO)
685685
cpuhp_setup_state(CPUHP_AP_ARM_L2X0_STARTING,
686-
"AP_ARM_L2X0_STARTING", l2c310_starting_cpu,
686+
"arm/l2x0:starting", l2c310_starting_cpu,
687687
l2c310_dying_cpu);
688688
}
689689

arch/arm/vfp/vfpmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ static int __init vfp_init(void)
799799
}
800800

801801
cpuhp_setup_state_nocalls(CPUHP_AP_ARM_VFP_STARTING,
802-
"AP_ARM_VFP_STARTING", vfp_starting_cpu,
802+
"arm/vfp:starting", vfp_starting_cpu,
803803
vfp_dying_cpu);
804804

805805
vfp_vector = vfp_support_entry;

arch/arm/xen/enlighten.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ static int __init xen_guest_init(void)
412412
pvclock_gtod_register_notifier(&xen_pvclock_gtod_notifier);
413413

414414
return cpuhp_setup_state(CPUHP_AP_ARM_XEN_STARTING,
415-
"AP_ARM_XEN_STARTING", xen_starting_cpu,
415+
"arm/xen:starting", xen_starting_cpu,
416416
xen_dying_cpu);
417417
}
418418
early_initcall(xen_guest_init);

arch/arm64/kernel/armv8_deprecated.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ static int __init armv8_deprecated_init(void)
640640
}
641641

642642
cpuhp_setup_state_nocalls(CPUHP_AP_ARM64_ISNDEP_STARTING,
643-
"AP_ARM64_ISNDEP_STARTING",
643+
"arm64/isndep:starting",
644644
run_all_insn_set_hw_mode, NULL);
645645
register_insn_emulation_sysctl(ctl_abi);
646646

arch/arm64/kernel/debug-monitors.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static int clear_os_lock(unsigned int cpu)
140140
static int debug_monitors_init(void)
141141
{
142142
return cpuhp_setup_state(CPUHP_AP_ARM64_DEBUG_MONITORS_STARTING,
143-
"CPUHP_AP_ARM64_DEBUG_MONITORS_STARTING",
143+
"arm64/debug_monitors:starting",
144144
clear_os_lock, NULL);
145145
}
146146
postcore_initcall(debug_monitors_init);

arch/arm64/kernel/hw_breakpoint.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ static int __init arch_hw_breakpoint_init(void)
10011001
* debugger will leave the world in a nice state for us.
10021002
*/
10031003
ret = cpuhp_setup_state(CPUHP_AP_PERF_ARM_HW_BREAKPOINT_STARTING,
1004-
"CPUHP_AP_PERF_ARM_HW_BREAKPOINT_STARTING",
1004+
"perf/arm64/hw_breakpoint:starting",
10051005
hw_breakpoint_reset, NULL);
10061006
if (ret)
10071007
pr_err("failed to register CPU hotplug notifier: %d\n", ret);

0 commit comments

Comments
 (0)