summaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorSatyam Sharma <satyam@infradead.org>2007-10-12 16:11:31 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2007-10-12 16:13:05 +0200
commit11b8bf0107e688434b9e0570fd05e7c715534f3b (patch)
treea20866c1fbc638fa9026c4ea1919ed13f3f6d685 /arch/s390
parent[S390] zcrypt: fix PCIXCC/CEX2C error recovery (diff)
downloadlinux-11b8bf0107e688434b9e0570fd05e7c715534f3b.tar.xz
linux-11b8bf0107e688434b9e0570fd05e7c715534f3b.zip
[S390] appldata_base: Misc cpuinit annotations and bugfix
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 <satyam@infradead.org> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/appldata/appldata_base.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index 62391fb1f61f..a355d8133261 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -547,8 +547,7 @@ static void __cpuinit appldata_online_cpu(int cpu)
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);