aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/sn
diff options
context:
space:
mode:
authorRobin Holt <holt@sgi.com>2006-02-02 12:30:21 -0600
committerTony Luck <tony.luck@intel.com>2006-02-02 13:37:46 -0800
commit7c6c66362941df847957766ad133ff5fde67579c (patch)
treed9f548837ca949603aef0d25739fff514e631e2f /arch/ia64/sn
parent[IA64-SGI] include/asm-ia64/sn/intr.h more sn2 housekeeping (diff)
downloadlinux-dev-7c6c66362941df847957766ad133ff5fde67579c.tar.xz
linux-dev-7c6c66362941df847957766ad133ff5fde67579c.zip
[IA64-SGI] Fix XPC code which sleeps with spin_lock_irqsave().
During some testing, we got a warning about trying to allocate memory while holding a lock. This fixes that problem. Signed-off-by: Robin Holt <holt@sgi.com> Acked-by: Dean Nelson <dcn@sgi.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/sn')
-rw-r--r--arch/ia64/sn/kernel/xpc_main.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/arch/ia64/sn/kernel/xpc_main.c b/arch/ia64/sn/kernel/xpc_main.c
index c75f8aeefc2b..9cd460dfe27e 100644
--- a/arch/ia64/sn/kernel/xpc_main.c
+++ b/arch/ia64/sn/kernel/xpc_main.c
@@ -575,18 +575,21 @@ xpc_activate_partition(struct xpc_partition *part)
spin_lock_irqsave(&part->act_lock, irq_flags);
- pid = kernel_thread(xpc_activating, (void *) ((u64) partid), 0);
-
DBUG_ON(part->act_state != XPC_P_INACTIVE);
- if (pid > 0) {
- part->act_state = XPC_P_ACTIVATION_REQ;
- XPC_SET_REASON(part, xpcCloneKThread, __LINE__);
- } else {
- XPC_SET_REASON(part, xpcCloneKThreadFailed, __LINE__);
- }
+ part->act_state = XPC_P_ACTIVATION_REQ;
+ XPC_SET_REASON(part, xpcCloneKThread, __LINE__);
spin_unlock_irqrestore(&part->act_lock, irq_flags);
+
+ pid = kernel_thread(xpc_activating, (void *) ((u64) partid), 0);
+
+ if (unlikely(pid <= 0)) {
+ spin_lock_irqsave(&part->act_lock, irq_flags);
+ part->act_state = XPC_P_INACTIVE;
+ XPC_SET_REASON(part, xpcCloneKThreadFailed, __LINE__);
+ spin_unlock_irqrestore(&part->act_lock, irq_flags);
+ }
}