From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933026AbcGLLWJ (ORCPT ); Tue, 12 Jul 2016 07:22:09 -0400 Received: from www.linutronix.de ([62.245.132.108]:33517 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932998AbcGLLWH (ORCPT ); Tue, 12 Jul 2016 07:22:07 -0400 Subject: Re: [patch 22/66] bus: arm-ccn: convert to hotplug statemachine To: Pawel Moll , Anna-Maria Gleixner , LKML References: <20160711122450.923603742@linutronix.de> <20160711122532.465002883@linutronix.de> <1468322171.10213.281.camel@arm.com> Cc: Peter Zijlstra , Ingo Molnar From: Sebastian Andrzej Siewior Message-ID: Date: Tue, 12 Jul 2016 13:21:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.1.0 MIME-Version: 1.0 In-Reply-To: <1468322171.10213.281.camel@arm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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