aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/sn
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64/sn')
-rw-r--r--arch/ia64/sn/kernel/sn2/sn_hwperf.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
index ca882744d75..4b0d1538e7e 100644
--- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c
+++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
@@ -33,6 +33,7 @@
33#include <linux/smp_lock.h> 33#include <linux/smp_lock.h>
34#include <linux/nodemask.h> 34#include <linux/nodemask.h>
35#include <linux/smp.h> 35#include <linux/smp.h>
36#include <linux/mutex.h>
36 37
37#include <asm/processor.h> 38#include <asm/processor.h>
38#include <asm/topology.h> 39#include <asm/topology.h>
@@ -50,7 +51,7 @@ static void *sn_hwperf_salheap = NULL;
50static int sn_hwperf_obj_cnt = 0; 51static int sn_hwperf_obj_cnt = 0;
51static nasid_t sn_hwperf_master_nasid = INVALID_NASID; 52static nasid_t sn_hwperf_master_nasid = INVALID_NASID;
52static int sn_hwperf_init(void); 53static int sn_hwperf_init(void);
53static DECLARE_MUTEX(sn_hwperf_init_mutex); 54static DEFINE_MUTEX(sn_hwperf_init_mutex);
54 55
55#define cnode_possible(n) ((n) < num_cnodes) 56#define cnode_possible(n) ((n) < num_cnodes)
56 57
@@ -884,10 +885,10 @@ static int sn_hwperf_init(void)
884 int e = 0; 885 int e = 0;
885 886
886 /* single threaded, once-only initialization */ 887 /* single threaded, once-only initialization */
887 down(&sn_hwperf_init_mutex); 888 mutex_lock(&sn_hwperf_init_mutex);
888 889
889 if (sn_hwperf_salheap) { 890 if (sn_hwperf_salheap) {
890 up(&sn_hwperf_init_mutex); 891 mutex_unlock(&sn_hwperf_init_mutex);
891 return e; 892 return e;
892 } 893 }
893 894
@@ -936,7 +937,7 @@ out:
936 sn_hwperf_salheap = NULL; 937 sn_hwperf_salheap = NULL;
937 sn_hwperf_obj_cnt = 0; 938 sn_hwperf_obj_cnt = 0;
938 } 939 }
939 up(&sn_hwperf_init_mutex); 940 mutex_unlock(&sn_hwperf_init_mutex);
940 return e; 941 return e;
941} 942}
942 943