mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-08 18:43:21 +01:00
xtensa/perf: Convert the hotplug notifier to state machine callbacks
Install the callbacks via the state machine and let the core invoke the callbacks on the already online CPUs. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Anna-Maria Gleixner <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Chris Zankel <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Max Filippov <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
1 parent
fdc15a36d8
commit
25a77b55e7
2 files changed
+10
-17
No files matched your search
@@ -404,7 +404,7 @@ static struct pmu xtensa_pmu = {
|
||||
.read = xtensa_pmu_read,
|
||||
};
|
||||
|
||||
static void xtensa_pmu_setup(void)
|
||||
static int xtensa_pmu_setup(int cpu)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
@@ -413,21 +413,7 @@ static void xtensa_pmu_setup(void)
|
||||
set_er(0, XTENSA_PMU_PMCTRL(i));
|
||||
set_er(get_er(XTENSA_PMU_PMSTAT(i)), XTENSA_PMU_PMSTAT(i));
|
||||
}
|
||||
}
|
||||
|
||||
static int xtensa_pmu_notifier(struct notifier_block *self,
|
||||
unsigned long action, void *data)
|
||||
{
|
||||
switch (action & ~CPU_TASKS_FROZEN) {
|
||||
case CPU_STARTING:
|
||||
xtensa_pmu_setup();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return NOTIFY_OK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __init xtensa_pmu_init(void)
|
||||
@@ -435,7 +421,13 @@ static int __init xtensa_pmu_init(void)
|
||||
int ret;
|
||||
int irq = irq_create_mapping(NULL, XCHAL_PROFILING_INTERRUPT);
|
||||
|
||||
perf_cpu_notifier(xtensa_pmu_notifier);
|
||||
ret = cpuhp_setup_state(CPUHP_AP_PERF_XTENSA_STARTING,
|
||||
"AP_PERF_XTENSA_STARTING", xtensa_pmu_setup,
|
||||
NULL);
|
||||
if (ret) {
|
||||
pr_err("xtensa_pmu: failed to register CPU-hotplug.\n");
|
||||
return ret;
|
||||
}
|
||||
#if XTENSA_FAKE_NMI
|
||||
enable_irq(irq);
|
||||
#else
|
||||
|
||||
@@ -30,6 +30,7 @@ enum cpuhp_state {
|
||||
CPUHP_AP_PERF_X86_AMD_IBS_STARTING,
|
||||
CPUHP_AP_PERF_X86_CQM_STARTING,
|
||||
CPUHP_AP_PERF_X86_CSTATE_STARTING,
|
||||
CPUHP_AP_PERF_XTENSA_STARTING,
|
||||
CPUHP_AP_NOTIFY_STARTING,
|
||||
CPUHP_AP_ONLINE,
|
||||
CPUHP_TEARDOWN_CPU,
|
||||
|
||||
Reference in new issue
Block a user