aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/sn/kernel/sn2
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64/sn/kernel/sn2')
-rw-r--r--arch/ia64/sn/kernel/sn2/prominfo_proc.c25
-rw-r--r--arch/ia64/sn/kernel/sn2/sn2_smp.c35
-rw-r--r--arch/ia64/sn/kernel/sn2/sn_proc_fs.c22
3 files changed, 41 insertions, 41 deletions
diff --git a/arch/ia64/sn/kernel/sn2/prominfo_proc.c b/arch/ia64/sn/kernel/sn2/prominfo_proc.c
index 81c63b2f8ae9..6ae276d5d50c 100644
--- a/arch/ia64/sn/kernel/sn2/prominfo_proc.c
+++ b/arch/ia64/sn/kernel/sn2/prominfo_proc.c
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 1999,2001-2004 Silicon Graphics, Inc. All Rights Reserved. 6 * Copyright (C) 1999,2001-2004, 2006 Silicon Graphics, Inc. All Rights Reserved.
7 * 7 *
8 * Module to export the system's Firmware Interface Tables, including 8 * Module to export the system's Firmware Interface Tables, including
9 * PROM revision numbers and banners, in /proc 9 * PROM revision numbers and banners, in /proc
@@ -190,7 +190,7 @@ static int
190read_version_entry(char *page, char **start, off_t off, int count, int *eof, 190read_version_entry(char *page, char **start, off_t off, int count, int *eof,
191 void *data) 191 void *data)
192{ 192{
193 int len = 0; 193 int len;
194 194
195 /* data holds the NASID of the node */ 195 /* data holds the NASID of the node */
196 len = dump_version(page, (unsigned long)data); 196 len = dump_version(page, (unsigned long)data);
@@ -202,7 +202,7 @@ static int
202read_fit_entry(char *page, char **start, off_t off, int count, int *eof, 202read_fit_entry(char *page, char **start, off_t off, int count, int *eof,
203 void *data) 203 void *data)
204{ 204{
205 int len = 0; 205 int len;
206 206
207 /* data holds the NASID of the node */ 207 /* data holds the NASID of the node */
208 len = dump_fit(page, (unsigned long)data); 208 len = dump_fit(page, (unsigned long)data);
@@ -229,13 +229,16 @@ int __init prominfo_init(void)
229 struct proc_dir_entry *p; 229 struct proc_dir_entry *p;
230 cnodeid_t cnodeid; 230 cnodeid_t cnodeid;
231 unsigned long nasid; 231 unsigned long nasid;
232 int size;
232 char name[NODE_NAME_LEN]; 233 char name[NODE_NAME_LEN];
233 234
234 if (!ia64_platform_is("sn2")) 235 if (!ia64_platform_is("sn2"))
235 return 0; 236 return 0;
236 237
237 proc_entries = kmalloc(num_online_nodes() * sizeof(struct proc_dir_entry *), 238 size = num_online_nodes() * sizeof(struct proc_dir_entry *);
238 GFP_KERNEL); 239 proc_entries = kzalloc(size, GFP_KERNEL);
240 if (!proc_entries)
241 return -ENOMEM;
239 242
240 sgi_prominfo_entry = proc_mkdir("sgi_prominfo", NULL); 243 sgi_prominfo_entry = proc_mkdir("sgi_prominfo", NULL);
241 244
@@ -244,14 +247,12 @@ int __init prominfo_init(void)
244 sprintf(name, "node%d", cnodeid); 247 sprintf(name, "node%d", cnodeid);
245 *entp = proc_mkdir(name, sgi_prominfo_entry); 248 *entp = proc_mkdir(name, sgi_prominfo_entry);
246 nasid = cnodeid_to_nasid(cnodeid); 249 nasid = cnodeid_to_nasid(cnodeid);
247 p = create_proc_read_entry( 250 p = create_proc_read_entry("fit", 0, *entp, read_fit_entry,
248 "fit", 0, *entp, read_fit_entry, 251 (void *)nasid);
249 (void *)nasid);
250 if (p) 252 if (p)
251 p->owner = THIS_MODULE; 253 p->owner = THIS_MODULE;
252 p = create_proc_read_entry( 254 p = create_proc_read_entry("version", 0, *entp,
253 "version", 0, *entp, read_version_entry, 255 read_version_entry, (void *)nasid);
254 (void *)nasid);
255 if (p) 256 if (p)
256 p->owner = THIS_MODULE; 257 p->owner = THIS_MODULE;
257 entp++; 258 entp++;
@@ -263,7 +264,7 @@ int __init prominfo_init(void)
263void __exit prominfo_exit(void) 264void __exit prominfo_exit(void)
264{ 265{
265 struct proc_dir_entry **entp; 266 struct proc_dir_entry **entp;
266 unsigned cnodeid; 267 unsigned int cnodeid;
267 char name[NODE_NAME_LEN]; 268 char name[NODE_NAME_LEN];
268 269
269 entp = proc_entries; 270 entp = proc_entries;
diff --git a/arch/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c
index f153a4c35c70..24eefb2fc55f 100644
--- a/arch/ia64/sn/kernel/sn2/sn2_smp.c
+++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c
@@ -46,8 +46,14 @@ DECLARE_PER_CPU(struct ptc_stats, ptcstats);
46 46
47static __cacheline_aligned DEFINE_SPINLOCK(sn2_global_ptc_lock); 47static __cacheline_aligned DEFINE_SPINLOCK(sn2_global_ptc_lock);
48 48
49void sn2_ptc_deadlock_recovery(short *, short, short, int, volatile unsigned long *, unsigned long, 49extern unsigned long
50 volatile unsigned long *, unsigned long); 50sn2_ptc_deadlock_recovery_core(volatile unsigned long *, unsigned long,
51 volatile unsigned long *, unsigned long,
52 volatile unsigned long *, unsigned long);
53void
54sn2_ptc_deadlock_recovery(short *, short, short, int,
55 volatile unsigned long *, unsigned long,
56 volatile unsigned long *, unsigned long);
51 57
52/* 58/*
53 * Note: some is the following is captured here to make degugging easier 59 * Note: some is the following is captured here to make degugging easier
@@ -59,16 +65,6 @@ void sn2_ptc_deadlock_recovery(short *, short, short, int, volatile unsigned lon
59#define reset_max_active_on_deadlock() 1 65#define reset_max_active_on_deadlock() 1
60#define PTC_LOCK(sh1) ((sh1) ? &sn2_global_ptc_lock : &sn_nodepda->ptc_lock) 66#define PTC_LOCK(sh1) ((sh1) ? &sn2_global_ptc_lock : &sn_nodepda->ptc_lock)
61 67
62static inline void ptc_lock(int sh1, unsigned long *flagp)
63{
64 spin_lock_irqsave(PTC_LOCK(sh1), *flagp);
65}
66
67static inline void ptc_unlock(int sh1, unsigned long flags)
68{
69 spin_unlock_irqrestore(PTC_LOCK(sh1), flags);
70}
71
72struct ptc_stats { 68struct ptc_stats {
73 unsigned long ptc_l; 69 unsigned long ptc_l;
74 unsigned long change_rid; 70 unsigned long change_rid;
@@ -82,6 +78,8 @@ struct ptc_stats {
82 unsigned long shub_ptc_flushes_not_my_mm; 78 unsigned long shub_ptc_flushes_not_my_mm;
83}; 79};
84 80
81#define sn2_ptctest 0
82
85static inline unsigned long wait_piowc(void) 83static inline unsigned long wait_piowc(void)
86{ 84{
87 volatile unsigned long *piows; 85 volatile unsigned long *piows;
@@ -200,7 +198,7 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start,
200 max_active = max_active_pio(shub1); 198 max_active = max_active_pio(shub1);
201 199
202 itc = ia64_get_itc(); 200 itc = ia64_get_itc();
203 ptc_lock(shub1, &flags); 201 spin_lock_irqsave(PTC_LOCK(shub1), flags);
204 itc2 = ia64_get_itc(); 202 itc2 = ia64_get_itc();
205 203
206 __get_cpu_var(ptcstats).lock_itc_clocks += itc2 - itc; 204 __get_cpu_var(ptcstats).lock_itc_clocks += itc2 - itc;
@@ -258,7 +256,7 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start,
258 ia64_srlz_d(); 256 ia64_srlz_d();
259 } 257 }
260 258
261 ptc_unlock(shub1, flags); 259 spin_unlock_irqrestore(PTC_LOCK(shub1), flags);
262 260
263 preempt_enable(); 261 preempt_enable();
264} 262}
@@ -270,11 +268,12 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start,
270 * TLB flush transaction. The recovery sequence is somewhat tricky & is 268 * TLB flush transaction. The recovery sequence is somewhat tricky & is
271 * coded in assembly language. 269 * coded in assembly language.
272 */ 270 */
273void sn2_ptc_deadlock_recovery(short *nasids, short ib, short ie, int mynasid, volatile unsigned long *ptc0, unsigned long data0, 271
274 volatile unsigned long *ptc1, unsigned long data1) 272void
273sn2_ptc_deadlock_recovery(short *nasids, short ib, short ie, int mynasid,
274 volatile unsigned long *ptc0, unsigned long data0,
275 volatile unsigned long *ptc1, unsigned long data1)
275{ 276{
276 extern unsigned long sn2_ptc_deadlock_recovery_core(volatile unsigned long *, unsigned long,
277 volatile unsigned long *, unsigned long, volatile unsigned long *, unsigned long);
278 short nasid, i; 277 short nasid, i;
279 unsigned long *piows, zeroval, n; 278 unsigned long *piows, zeroval, n;
280 279
diff --git a/arch/ia64/sn/kernel/sn2/sn_proc_fs.c b/arch/ia64/sn/kernel/sn2/sn_proc_fs.c
index a06719d752a0..c686d9c12f7b 100644
--- a/arch/ia64/sn/kernel/sn2/sn_proc_fs.c
+++ b/arch/ia64/sn/kernel/sn2/sn_proc_fs.c
@@ -6,11 +6,11 @@
6 * Copyright (C) 2000-2005 Silicon Graphics, Inc. All rights reserved. 6 * Copyright (C) 2000-2005 Silicon Graphics, Inc. All rights reserved.
7 */ 7 */
8#include <linux/config.h> 8#include <linux/config.h>
9#include <asm/uaccess.h>
10 9
11#ifdef CONFIG_PROC_FS 10#ifdef CONFIG_PROC_FS
12#include <linux/proc_fs.h> 11#include <linux/proc_fs.h>
13#include <linux/seq_file.h> 12#include <linux/seq_file.h>
13#include <asm/uaccess.h>
14#include <asm/sn/sn_sal.h> 14#include <asm/sn/sn_sal.h>
15 15
16static int partition_id_show(struct seq_file *s, void *p) 16static int partition_id_show(struct seq_file *s, void *p)
@@ -90,10 +90,10 @@ static int coherence_id_open(struct inode *inode, struct file *file)
90 return single_open(file, coherence_id_show, NULL); 90 return single_open(file, coherence_id_show, NULL);
91} 91}
92 92
93static struct proc_dir_entry *sn_procfs_create_entry( 93static struct proc_dir_entry
94 const char *name, struct proc_dir_entry *parent, 94*sn_procfs_create_entry(const char *name, struct proc_dir_entry *parent,
95 int (*openfunc)(struct inode *, struct file *), 95 int (*openfunc)(struct inode *, struct file *),
96 int (*releasefunc)(struct inode *, struct file *)) 96 int (*releasefunc)(struct inode *, struct file *))
97{ 97{
98 struct proc_dir_entry *e = create_proc_entry(name, 0444, parent); 98 struct proc_dir_entry *e = create_proc_entry(name, 0444, parent);
99 99
@@ -126,24 +126,24 @@ void register_sn_procfs(void)
126 return; 126 return;
127 127
128 sn_procfs_create_entry("partition_id", sgi_proc_dir, 128 sn_procfs_create_entry("partition_id", sgi_proc_dir,
129 partition_id_open, single_release); 129 partition_id_open, single_release);
130 130
131 sn_procfs_create_entry("system_serial_number", sgi_proc_dir, 131 sn_procfs_create_entry("system_serial_number", sgi_proc_dir,
132 system_serial_number_open, single_release); 132 system_serial_number_open, single_release);
133 133
134 sn_procfs_create_entry("licenseID", sgi_proc_dir, 134 sn_procfs_create_entry("licenseID", sgi_proc_dir,
135 licenseID_open, single_release); 135 licenseID_open, single_release);
136 136
137 e = sn_procfs_create_entry("sn_force_interrupt", sgi_proc_dir, 137 e = sn_procfs_create_entry("sn_force_interrupt", sgi_proc_dir,
138 sn_force_interrupt_open, single_release); 138 sn_force_interrupt_open, single_release);
139 if (e) 139 if (e)
140 e->proc_fops->write = sn_force_interrupt_write_proc; 140 e->proc_fops->write = sn_force_interrupt_write_proc;
141 141
142 sn_procfs_create_entry("coherence_id", sgi_proc_dir, 142 sn_procfs_create_entry("coherence_id", sgi_proc_dir,
143 coherence_id_open, single_release); 143 coherence_id_open, single_release);
144 144
145 sn_procfs_create_entry("sn_topology", sgi_proc_dir, 145 sn_procfs_create_entry("sn_topology", sgi_proc_dir,
146 sn_topology_open, sn_topology_release); 146 sn_topology_open, sn_topology_release);
147} 147}
148 148
149#endif /* CONFIG_PROC_FS */ 149#endif /* CONFIG_PROC_FS */