Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760507AbXJDLel (ORCPT ); Thu, 4 Oct 2007 07:34:41 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757517AbXJDL25 (ORCPT ); Thu, 4 Oct 2007 07:28:57 -0400 Received: from mtagate6.de.ibm.com ([195.212.29.155]:53246 "EHLO mtagate6.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755812AbXJDL23 (ORCPT ); Thu, 4 Oct 2007 07:28:29 -0400 Message-Id: <20071004112829.257682953@de.ibm.com> References: <20071004112706.574737175@de.ibm.com> User-Agent: quilt/0.46-1 Date: Thu, 04 Oct 2007 13:27:23 +0200 From: Martin Schwidefsky To: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Cc: Satyam Sharma , Heiko Carstens , Andrew Morton , Martin Schwidefsky Subject: [patch 17/34] appldata_base: Misc cpuinit annotations and bugfix Content-Disposition: inline; filename=017-appldata-cpuinit.diff Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2335 Lines: 70 From: Satyam Sharma appldata_offline_cpu() is only called from __cpuinit-marked hotplug notifier callback and from the __exit-marked module_exit function, therefore candidate for __cpuexit. BTW the __exit module_exit function appldata_exit() of this driver fails to unregister_hotcpu_notifier() the notifier_block that was registered by appldata_init() during module startup. This will lead to oops if hotplug notification comes after module has been unloaded. Let's fix this by unregistering the notifier appropriately (before appldata_offline_cpu()'ing the CPUs). Signed-off-by: Satyam Sharma Cc: Heiko Carstens Signed-off-by: Andrew Morton Signed-off-by: Martin Schwidefsky --- arch/s390/appldata/appldata_base.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) Index: quilt-2.6/arch/s390/appldata/appldata_base.c =================================================================== --- quilt-2.6.orig/arch/s390/appldata/appldata_base.c +++ quilt-2.6/arch/s390/appldata/appldata_base.c @@ -547,8 +547,7 @@ static void __cpuinit appldata_online_cp spin_unlock(&appldata_timer_lock); } -static void -appldata_offline_cpu(int cpu) +static void __cpuexit appldata_offline_cpu(int cpu) { del_virt_timer(&per_cpu(appldata_timer, cpu)); if (atomic_dec_and_test(&appldata_expire_count)) { @@ -560,9 +559,9 @@ appldata_offline_cpu(int cpu) spin_unlock(&appldata_timer_lock); } -static int __cpuinit -appldata_cpu_notify(struct notifier_block *self, - unsigned long action, void *hcpu) +static int __cpuinit appldata_cpu_notify(struct notifier_block *self, + unsigned long action, + void *hcpu) { switch (action) { case CPU_ONLINE: @@ -646,6 +645,8 @@ static void __exit appldata_exit(void) } spin_unlock(&appldata_ops_lock); + unregister_hotcpu_notifier(&appldata_nb); + for_each_online_cpu(i) appldata_offline_cpu(i); -- blue skies, Martin. "Reality continues to ruin my life." - Calvin. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/