From: Nathan Fontenot <nfont@austin.ibm.com>
To: linuxppc-dev@ozlabs.org
Cc: Andreas Schwab <schwab@linux-m68k.org>
Subject: [PATCH] Make cpu hotplug driver lock part of ppc_md
Date: Tue, 22 Dec 2009 08:45:31 -0600 [thread overview]
Message-ID: <4B30DB8B.3030305@austin.ibm.com> (raw)
The recently introduced cpu_hotplug_driver_lock used to serialize
cpu hotplug operations, namely for the pseries platform, causes a build
issue for other platforms. The base cpu hotplug code attempts
to take this lock, but it may not be needed for all platforms. This patch
moves the lock/unlock routines to be part of the ppc_md structure
so that platforms needing the lock can take it. This also makes the
previous cpu_hotplug_driver_lock, defined in pseries code, pseries specific.
The past failure without this patch was seen when building pmac and may
be present in other platform builds. The error is included below for reference.
drivers/built-in.o: In function `.store_online':
cpu.c:(.ref.text+0xf5c): undefined reference to `.cpu_hotplug_driver_lock'
cpu.c:(.ref.text+0xfc8): undefined reference to `.cpu_hotplug_driver_unlock'
make: *** [.tmp_vmlinux1] Error 1
Signed-of-by: Nathan Fontenot <nfont@austin.ibm.com>
---
arch/powerpc/include/asm/machdep.h | 2 ++
arch/powerpc/kernel/smp.c | 14 ++++++++++++++
arch/powerpc/platforms/pseries/dlpar.c | 6 ++++--
3 files changed, 20 insertions(+), 2 deletions(-)
Index: powerpc/arch/powerpc/include/asm/machdep.h
===================================================================
--- powerpc.orig/arch/powerpc/include/asm/machdep.h 2009-12-21 20:51:49.000000000 -0600
+++ powerpc/arch/powerpc/include/asm/machdep.h 2009-12-21 21:07:40.000000000 -0600
@@ -270,6 +270,8 @@
#ifdef CONFIG_ARCH_CPU_PROBE_RELEASE
ssize_t (*cpu_probe)(const char *, size_t);
ssize_t (*cpu_release)(const char *, size_t);
+ void (*cpu_hotplug_driver_lock)(void);
+ void (*cpu_hotplug_driver_unlock)(void);
#endif
};
Index: powerpc/arch/powerpc/platforms/pseries/dlpar.c
===================================================================
--- powerpc.orig/arch/powerpc/platforms/pseries/dlpar.c 2009-12-21 20:51:49.000000000 -0600
+++ powerpc/arch/powerpc/platforms/pseries/dlpar.c 2009-12-21 21:26:23.000000000 -0600
@@ -346,12 +346,12 @@
static DEFINE_MUTEX(pseries_cpu_hotplug_mutex);
-void cpu_hotplug_driver_lock()
+static void pseries_cpu_hotplug_driver_lock(void)
{
mutex_lock(&pseries_cpu_hotplug_mutex);
}
-void cpu_hotplug_driver_unlock()
+static void pseries_cpu_hotplug_driver_unlock(void)
{
mutex_unlock(&pseries_cpu_hotplug_mutex);
}
@@ -550,6 +550,8 @@
{
ppc_md.cpu_probe = dlpar_cpu_probe;
ppc_md.cpu_release = dlpar_cpu_release;
+ ppc_md.cpu_hotplug_driver_lock = pseries_cpu_hotplug_driver_lock;
+ ppc_md.cpu_hotplug_driver_unlock = pseries_cpu_hotplug_driver_unlock;
return 0;
}
Index: powerpc/arch/powerpc/kernel/smp.c
===================================================================
--- powerpc.orig/arch/powerpc/kernel/smp.c 2009-12-21 20:51:49.000000000 -0600
+++ powerpc/arch/powerpc/kernel/smp.c 2009-12-21 21:24:23.000000000 -0600
@@ -619,4 +619,18 @@
if (smp_ops->cpu_die)
smp_ops->cpu_die(cpu);
}
+
+#ifdef CONFIG_ARCH_CPU_PROBE_RELEASE
+void cpu_hotplug_driver_lock(void)
+{
+ if (ppc_md.cpu_hotplug_driver_lock)
+ ppc_md.cpu_hotplug_driver_lock();
+}
+
+void cpu_hotplug_driver_unlock(void)
+{
+ if (ppc_md.cpu_hotplug_driver_unlock)
+ ppc_md.cpu_hotplug_driver_unlock();
+}
#endif
+#endif /* CONFIG_HOTPLUG_CPU */
next reply other threads:[~2009-12-22 14:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-22 14:45 Nathan Fontenot [this message]
2009-12-22 22:29 ` [PATCH] Make cpu hotplug driver lock part of ppc_md Michael Ellerman
2009-12-23 14:48 ` Nathan Fontenot
2009-12-23 22:29 ` Michael Ellerman
2010-01-12 2:23 ` Benjamin Herrenschmidt
2010-01-12 19:34 ` Nathan Fontenot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B30DB8B.3030305@austin.ibm.com \
--to=nfont@austin.ibm.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=schwab@linux-m68k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.