Re: [patch 22/66] bus: arm-ccn: convert to hotplug statemachine
From: Sebastian Andrzej Siewior
Date: Tue Jul 12 2016 - 07:22:12 EST
On 07/12/2016 01:16 PM, Pawel Moll wrote:
> On Mon, 2016-07-11 at 12:28 +0000, Anna-Maria Gleixner wrote:
>> @@ -1270,9 +1262,10 @@ static int arm_ccn_pmu_init(struct arm_c
>> * ... and change the selection when it goes offline.
>> Priority is
>> * picked to have a chance to migrate events before perf is
>> notified.
>> */
>> - ccn->dt.cpu_nb.notifier_call = arm_ccn_pmu_cpu_notifier;
>> - ccn->dt.cpu_nb.priority = CPU_PRI_PERF + 1,
>> - err = register_cpu_notifier(&ccn->dt.cpu_nb);
>> + cpuhp_armccn_dt = &ccn->dt;
>> + err = cpuhp_setup_state(CPUHP_AP_PERF_ARM_CCN_ONLINE,
>> + "AP_PERF_ARM_CCN_ONLINE", NULL,
>> + arm_ccn_pmu_offline_cpu);
>> if (err)
>> goto error_cpu_notifier;
>
> Also, unless I'm missing something obvious, it seems that the callback
> will be executed for CPUs going online? I'm definitely interested in my
> "current" CPU going down, in order to migrate my handlers somewhere
> else.
>
> Help?
cpuhp_setup_state() gets two callbacks, online followed by offline
(argument three and four). The online callback is NULL so you have only
one offline callback.
> Pawel
Sebastian