Skip to content

Commit

Permalink
[S390] appldata_base: Misc cpuinit annotations and bugfix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Satyam Sharma authored and Martin Schwidefsky committed Oct 12, 2007
1 parent 2af4808 commit 11b8bf0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions arch/s390/appldata/appldata_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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:
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 11b8bf0

Please sign in to comment.