diff options
Diffstat (limited to 'arch/ia64/sn/kernel')
-rw-r--r-- | arch/ia64/sn/kernel/io_init.c | 104 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/irq.c | 4 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/mca.c | 5 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/setup.c | 64 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/sn2/prominfo_proc.c | 25 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/sn2/sn2_smp.c | 58 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/sn2/sn_hwperf.c | 5 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/sn2/sn_proc_fs.c | 22 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/sn2/timer.c | 19 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/sn2/timer_interrupt.c | 7 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/tiocx.c | 6 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/xpc_channel.c | 8 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/xpc_main.c | 20 |
13 files changed, 190 insertions, 157 deletions
diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c index d7e4d79e16a8..dfb3f2902379 100644 --- a/arch/ia64/sn/kernel/io_init.c +++ b/arch/ia64/sn/kernel/io_init.c | |||
@@ -23,6 +23,10 @@ | |||
23 | #include "xtalk/hubdev.h" | 23 | #include "xtalk/hubdev.h" |
24 | #include "xtalk/xwidgetdev.h" | 24 | #include "xtalk/xwidgetdev.h" |
25 | 25 | ||
26 | |||
27 | extern void sn_init_cpei_timer(void); | ||
28 | extern void register_sn_procfs(void); | ||
29 | |||
26 | static struct list_head sn_sysdata_list; | 30 | static struct list_head sn_sysdata_list; |
27 | 31 | ||
28 | /* sysdata list struct */ | 32 | /* sysdata list struct */ |
@@ -40,12 +44,12 @@ struct brick { | |||
40 | struct slab_info slab_info[MAX_SLABS + 1]; | 44 | struct slab_info slab_info[MAX_SLABS + 1]; |
41 | }; | 45 | }; |
42 | 46 | ||
43 | int sn_ioif_inited = 0; /* SN I/O infrastructure initialized? */ | 47 | int sn_ioif_inited; /* SN I/O infrastructure initialized? */ |
44 | 48 | ||
45 | struct sn_pcibus_provider *sn_pci_provider[PCIIO_ASIC_MAX_TYPES]; /* indexed by asic type */ | 49 | struct sn_pcibus_provider *sn_pci_provider[PCIIO_ASIC_MAX_TYPES]; /* indexed by asic type */ |
46 | 50 | ||
47 | static int max_segment_number = 0; /* Default highest segment number */ | 51 | static int max_segment_number; /* Default highest segment number */ |
48 | static int max_pcibus_number = 255; /* Default highest pci bus number */ | 52 | static int max_pcibus_number = 255; /* Default highest pci bus number */ |
49 | 53 | ||
50 | /* | 54 | /* |
51 | * Hooks and struct for unsupported pci providers | 55 | * Hooks and struct for unsupported pci providers |
@@ -84,7 +88,6 @@ static inline u64 | |||
84 | sal_get_device_dmaflush_list(u64 nasid, u64 widget_num, u64 device_num, | 88 | sal_get_device_dmaflush_list(u64 nasid, u64 widget_num, u64 device_num, |
85 | u64 address) | 89 | u64 address) |
86 | { | 90 | { |
87 | |||
88 | struct ia64_sal_retval ret_stuff; | 91 | struct ia64_sal_retval ret_stuff; |
89 | ret_stuff.status = 0; | 92 | ret_stuff.status = 0; |
90 | ret_stuff.v0 = 0; | 93 | ret_stuff.v0 = 0; |
@@ -94,7 +97,6 @@ sal_get_device_dmaflush_list(u64 nasid, u64 widget_num, u64 device_num, | |||
94 | (u64) nasid, (u64) widget_num, | 97 | (u64) nasid, (u64) widget_num, |
95 | (u64) device_num, (u64) address, 0, 0, 0); | 98 | (u64) device_num, (u64) address, 0, 0, 0); |
96 | return ret_stuff.status; | 99 | return ret_stuff.status; |
97 | |||
98 | } | 100 | } |
99 | 101 | ||
100 | /* | 102 | /* |
@@ -102,7 +104,6 @@ sal_get_device_dmaflush_list(u64 nasid, u64 widget_num, u64 device_num, | |||
102 | */ | 104 | */ |
103 | static inline u64 sal_get_hubdev_info(u64 handle, u64 address) | 105 | static inline u64 sal_get_hubdev_info(u64 handle, u64 address) |
104 | { | 106 | { |
105 | |||
106 | struct ia64_sal_retval ret_stuff; | 107 | struct ia64_sal_retval ret_stuff; |
107 | ret_stuff.status = 0; | 108 | ret_stuff.status = 0; |
108 | ret_stuff.v0 = 0; | 109 | ret_stuff.v0 = 0; |
@@ -118,7 +119,6 @@ static inline u64 sal_get_hubdev_info(u64 handle, u64 address) | |||
118 | */ | 119 | */ |
119 | static inline u64 sal_get_pcibus_info(u64 segment, u64 busnum, u64 address) | 120 | static inline u64 sal_get_pcibus_info(u64 segment, u64 busnum, u64 address) |
120 | { | 121 | { |
121 | |||
122 | struct ia64_sal_retval ret_stuff; | 122 | struct ia64_sal_retval ret_stuff; |
123 | ret_stuff.status = 0; | 123 | ret_stuff.status = 0; |
124 | ret_stuff.v0 = 0; | 124 | ret_stuff.v0 = 0; |
@@ -215,7 +215,7 @@ static void __init sn_fixup_ionodes(void) | |||
215 | struct hubdev_info *hubdev; | 215 | struct hubdev_info *hubdev; |
216 | u64 status; | 216 | u64 status; |
217 | u64 nasid; | 217 | u64 nasid; |
218 | int i, widget, device; | 218 | int i, widget, device, size; |
219 | 219 | ||
220 | /* | 220 | /* |
221 | * Get SGI Specific HUB chipset information. | 221 | * Get SGI Specific HUB chipset information. |
@@ -251,48 +251,37 @@ static void __init sn_fixup_ionodes(void) | |||
251 | if (!hubdev->hdi_flush_nasid_list.widget_p) | 251 | if (!hubdev->hdi_flush_nasid_list.widget_p) |
252 | continue; | 252 | continue; |
253 | 253 | ||
254 | size = (HUB_WIDGET_ID_MAX + 1) * | ||
255 | sizeof(struct sn_flush_device_kernel *); | ||
254 | hubdev->hdi_flush_nasid_list.widget_p = | 256 | hubdev->hdi_flush_nasid_list.widget_p = |
255 | kmalloc((HUB_WIDGET_ID_MAX + 1) * | 257 | kzalloc(size, GFP_KERNEL); |
256 | sizeof(struct sn_flush_device_kernel *), | 258 | if (!hubdev->hdi_flush_nasid_list.widget_p) |
257 | GFP_KERNEL); | 259 | BUG(); |
258 | memset(hubdev->hdi_flush_nasid_list.widget_p, 0x0, | ||
259 | (HUB_WIDGET_ID_MAX + 1) * | ||
260 | sizeof(struct sn_flush_device_kernel *)); | ||
261 | 260 | ||
262 | for (widget = 0; widget <= HUB_WIDGET_ID_MAX; widget++) { | 261 | for (widget = 0; widget <= HUB_WIDGET_ID_MAX; widget++) { |
263 | sn_flush_device_kernel = kmalloc(DEV_PER_WIDGET * | 262 | size = DEV_PER_WIDGET * |
264 | sizeof(struct | 263 | sizeof(struct sn_flush_device_kernel); |
265 | sn_flush_device_kernel), | 264 | sn_flush_device_kernel = kzalloc(size, GFP_KERNEL); |
266 | GFP_KERNEL); | ||
267 | if (!sn_flush_device_kernel) | 265 | if (!sn_flush_device_kernel) |
268 | BUG(); | 266 | BUG(); |
269 | memset(sn_flush_device_kernel, 0x0, | ||
270 | DEV_PER_WIDGET * | ||
271 | sizeof(struct sn_flush_device_kernel)); | ||
272 | 267 | ||
273 | dev_entry = sn_flush_device_kernel; | 268 | dev_entry = sn_flush_device_kernel; |
274 | for (device = 0; device < DEV_PER_WIDGET; | 269 | for (device = 0; device < DEV_PER_WIDGET; |
275 | device++,dev_entry++) { | 270 | device++,dev_entry++) { |
276 | dev_entry->common = kmalloc(sizeof(struct | 271 | size = sizeof(struct sn_flush_device_common); |
277 | sn_flush_device_common), | 272 | dev_entry->common = kzalloc(size, GFP_KERNEL); |
278 | GFP_KERNEL); | ||
279 | if (!dev_entry->common) | 273 | if (!dev_entry->common) |
280 | BUG(); | 274 | BUG(); |
281 | memset(dev_entry->common, 0x0, sizeof(struct | ||
282 | sn_flush_device_common)); | ||
283 | 275 | ||
284 | if (sn_prom_feature_available( | 276 | if (sn_prom_feature_available( |
285 | PRF_DEVICE_FLUSH_LIST)) | 277 | PRF_DEVICE_FLUSH_LIST)) |
286 | status = sal_get_device_dmaflush_list( | 278 | status = sal_get_device_dmaflush_list( |
287 | nasid, | 279 | nasid, widget, device, |
288 | widget, | 280 | (u64)(dev_entry->common)); |
289 | device, | ||
290 | (u64)(dev_entry->common)); | ||
291 | else | 281 | else |
292 | status = sn_device_fixup_war(nasid, | 282 | status = sn_device_fixup_war(nasid, |
293 | widget, | 283 | widget, device, |
294 | device, | 284 | dev_entry->common); |
295 | dev_entry->common); | ||
296 | if (status != SALRET_OK) | 285 | if (status != SALRET_OK) |
297 | panic("SAL call failed: %s\n", | 286 | panic("SAL call failed: %s\n", |
298 | ia64_sal_strerror(status)); | 287 | ia64_sal_strerror(status)); |
@@ -383,13 +372,12 @@ void sn_pci_fixup_slot(struct pci_dev *dev) | |||
383 | 372 | ||
384 | pci_dev_get(dev); /* for the sysdata pointer */ | 373 | pci_dev_get(dev); /* for the sysdata pointer */ |
385 | pcidev_info = kzalloc(sizeof(struct pcidev_info), GFP_KERNEL); | 374 | pcidev_info = kzalloc(sizeof(struct pcidev_info), GFP_KERNEL); |
386 | if (pcidev_info <= 0) | 375 | if (!pcidev_info) |
387 | BUG(); /* Cannot afford to run out of memory */ | 376 | BUG(); /* Cannot afford to run out of memory */ |
388 | 377 | ||
389 | sn_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_KERNEL); | 378 | sn_irq_info = kzalloc(sizeof(struct sn_irq_info), GFP_KERNEL); |
390 | if (sn_irq_info <= 0) | 379 | if (!sn_irq_info) |
391 | BUG(); /* Cannot afford to run out of memory */ | 380 | BUG(); /* Cannot afford to run out of memory */ |
392 | memset(sn_irq_info, 0, sizeof(struct sn_irq_info)); | ||
393 | 381 | ||
394 | /* Call to retrieve pci device information needed by kernel. */ | 382 | /* Call to retrieve pci device information needed by kernel. */ |
395 | status = sal_get_pcidev_info((u64) segment, (u64) dev->bus->number, | 383 | status = sal_get_pcidev_info((u64) segment, (u64) dev->bus->number, |
@@ -482,13 +470,13 @@ void sn_pci_fixup_slot(struct pci_dev *dev) | |||
482 | */ | 470 | */ |
483 | void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus) | 471 | void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus) |
484 | { | 472 | { |
485 | int status = 0; | 473 | int status; |
486 | int nasid, cnode; | 474 | int nasid, cnode; |
487 | struct pci_controller *controller; | 475 | struct pci_controller *controller; |
488 | struct sn_pci_controller *sn_controller; | 476 | struct sn_pci_controller *sn_controller; |
489 | struct pcibus_bussoft *prom_bussoft_ptr; | 477 | struct pcibus_bussoft *prom_bussoft_ptr; |
490 | struct hubdev_info *hubdev_info; | 478 | struct hubdev_info *hubdev_info; |
491 | void *provider_soft = NULL; | 479 | void *provider_soft; |
492 | struct sn_pcibus_provider *provider; | 480 | struct sn_pcibus_provider *provider; |
493 | 481 | ||
494 | status = sal_get_pcibus_info((u64) segment, (u64) busnum, | 482 | status = sal_get_pcibus_info((u64) segment, (u64) busnum, |
@@ -535,6 +523,8 @@ void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus) | |||
535 | bus->sysdata = controller; | 523 | bus->sysdata = controller; |
536 | if (provider->bus_fixup) | 524 | if (provider->bus_fixup) |
537 | provider_soft = (*provider->bus_fixup) (prom_bussoft_ptr, controller); | 525 | provider_soft = (*provider->bus_fixup) (prom_bussoft_ptr, controller); |
526 | else | ||
527 | provider_soft = NULL; | ||
538 | 528 | ||
539 | if (provider_soft == NULL) { | 529 | if (provider_soft == NULL) { |
540 | /* fixup failed or not applicable */ | 530 | /* fixup failed or not applicable */ |
@@ -617,15 +607,15 @@ void sn_bus_store_sysdata(struct pci_dev *dev) | |||
617 | void sn_bus_free_sysdata(void) | 607 | void sn_bus_free_sysdata(void) |
618 | { | 608 | { |
619 | struct sysdata_el *element; | 609 | struct sysdata_el *element; |
620 | struct list_head *list; | 610 | struct list_head *list, *safe; |
621 | 611 | ||
622 | sn_sysdata_free_start: | 612 | list_for_each_safe(list, safe, &sn_sysdata_list) { |
623 | list_for_each(list, &sn_sysdata_list) { | ||
624 | element = list_entry(list, struct sysdata_el, entry); | 613 | element = list_entry(list, struct sysdata_el, entry); |
625 | list_del(&element->entry); | 614 | list_del(&element->entry); |
615 | list_del(&(((struct pcidev_info *) | ||
616 | (element->sysdata))->pdi_list)); | ||
626 | kfree(element->sysdata); | 617 | kfree(element->sysdata); |
627 | kfree(element); | 618 | kfree(element); |
628 | goto sn_sysdata_free_start; | ||
629 | } | 619 | } |
630 | return; | 620 | return; |
631 | } | 621 | } |
@@ -638,13 +628,8 @@ sn_sysdata_free_start: | |||
638 | 628 | ||
639 | static int __init sn_pci_init(void) | 629 | static int __init sn_pci_init(void) |
640 | { | 630 | { |
641 | int i = 0; | 631 | int i, j; |
642 | int j = 0; | ||
643 | struct pci_dev *pci_dev = NULL; | 632 | struct pci_dev *pci_dev = NULL; |
644 | extern void sn_init_cpei_timer(void); | ||
645 | #ifdef CONFIG_PROC_FS | ||
646 | extern void register_sn_procfs(void); | ||
647 | #endif | ||
648 | 633 | ||
649 | if (!ia64_platform_is("sn2") || IS_RUNNING_ON_FAKE_PROM()) | 634 | if (!ia64_platform_is("sn2") || IS_RUNNING_ON_FAKE_PROM()) |
650 | return 0; | 635 | return 0; |
@@ -700,32 +685,29 @@ static int __init sn_pci_init(void) | |||
700 | */ | 685 | */ |
701 | void hubdev_init_node(nodepda_t * npda, cnodeid_t node) | 686 | void hubdev_init_node(nodepda_t * npda, cnodeid_t node) |
702 | { | 687 | { |
703 | |||
704 | struct hubdev_info *hubdev_info; | 688 | struct hubdev_info *hubdev_info; |
689 | int size; | ||
690 | pg_data_t *pg; | ||
691 | |||
692 | size = sizeof(struct hubdev_info); | ||
705 | 693 | ||
706 | if (node >= num_online_nodes()) /* Headless/memless IO nodes */ | 694 | if (node >= num_online_nodes()) /* Headless/memless IO nodes */ |
707 | hubdev_info = | 695 | pg = NODE_DATA(0); |
708 | (struct hubdev_info *)alloc_bootmem_node(NODE_DATA(0), | ||
709 | sizeof(struct | ||
710 | hubdev_info)); | ||
711 | else | 696 | else |
712 | hubdev_info = | 697 | pg = NODE_DATA(node); |
713 | (struct hubdev_info *)alloc_bootmem_node(NODE_DATA(node), | ||
714 | sizeof(struct | ||
715 | hubdev_info)); | ||
716 | npda->pdinfo = (void *)hubdev_info; | ||
717 | 698 | ||
699 | hubdev_info = (struct hubdev_info *)alloc_bootmem_node(pg, size); | ||
700 | |||
701 | npda->pdinfo = (void *)hubdev_info; | ||
718 | } | 702 | } |
719 | 703 | ||
720 | geoid_t | 704 | geoid_t |
721 | cnodeid_get_geoid(cnodeid_t cnode) | 705 | cnodeid_get_geoid(cnodeid_t cnode) |
722 | { | 706 | { |
723 | |||
724 | struct hubdev_info *hubdev; | 707 | struct hubdev_info *hubdev; |
725 | 708 | ||
726 | hubdev = (struct hubdev_info *)(NODEPDA(cnode)->pdinfo); | 709 | hubdev = (struct hubdev_info *)(NODEPDA(cnode)->pdinfo); |
727 | return hubdev->hdi_geoid; | 710 | return hubdev->hdi_geoid; |
728 | |||
729 | } | 711 | } |
730 | 712 | ||
731 | subsys_initcall(sn_pci_init); | 713 | subsys_initcall(sn_pci_init); |
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c index 74d87d903d5d..c373113d073a 100644 --- a/arch/ia64/sn/kernel/irq.c +++ b/arch/ia64/sn/kernel/irq.c | |||
@@ -299,7 +299,9 @@ void sn_irq_unfixup(struct pci_dev *pci_dev) | |||
299 | return; | 299 | return; |
300 | 300 | ||
301 | sn_irq_info = SN_PCIDEV_INFO(pci_dev)->pdi_sn_irq_info; | 301 | sn_irq_info = SN_PCIDEV_INFO(pci_dev)->pdi_sn_irq_info; |
302 | if (!sn_irq_info || !sn_irq_info->irq_irq) { | 302 | if (!sn_irq_info) |
303 | return; | ||
304 | if (!sn_irq_info->irq_irq) { | ||
303 | kfree(sn_irq_info); | 305 | kfree(sn_irq_info); |
304 | return; | 306 | return; |
305 | } | 307 | } |
diff --git a/arch/ia64/sn/kernel/mca.c b/arch/ia64/sn/kernel/mca.c index 9ab684d1bb55..3db62f24596c 100644 --- a/arch/ia64/sn/kernel/mca.c +++ b/arch/ia64/sn/kernel/mca.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) 2000-2004 Silicon Graphics, Inc. All Rights Reserved. | 6 | * Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/types.h> | 9 | #include <linux/types.h> |
@@ -137,7 +137,8 @@ int sn_salinfo_platform_oemdata(const u8 *sect_header, u8 **oemdata, u64 *oemdat | |||
137 | 137 | ||
138 | static int __init sn_salinfo_init(void) | 138 | static int __init sn_salinfo_init(void) |
139 | { | 139 | { |
140 | salinfo_platform_oemdata = &sn_salinfo_platform_oemdata; | 140 | if (ia64_platform_is("sn2")) |
141 | salinfo_platform_oemdata = &sn_salinfo_platform_oemdata; | ||
141 | return 0; | 142 | return 0; |
142 | } | 143 | } |
143 | 144 | ||
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c index ee36bff93c30..8b6d5c844708 100644 --- a/arch/ia64/sn/kernel/setup.c +++ b/arch/ia64/sn/kernel/setup.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-2005 Silicon Graphics, Inc. All rights reserved. | 6 | * Copyright (C) 1999,2001-2006 Silicon Graphics, Inc. All rights reserved. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <linux/config.h> | 9 | #include <linux/config.h> |
@@ -67,6 +67,7 @@ extern unsigned long last_time_offset; | |||
67 | extern void (*ia64_mark_idle) (int); | 67 | extern void (*ia64_mark_idle) (int); |
68 | extern void snidle(int); | 68 | extern void snidle(int); |
69 | extern unsigned char acpi_kbd_controller_present; | 69 | extern unsigned char acpi_kbd_controller_present; |
70 | extern unsigned long long (*ia64_printk_clock)(void); | ||
70 | 71 | ||
71 | unsigned long sn_rtc_cycles_per_second; | 72 | unsigned long sn_rtc_cycles_per_second; |
72 | EXPORT_SYMBOL(sn_rtc_cycles_per_second); | 73 | EXPORT_SYMBOL(sn_rtc_cycles_per_second); |
@@ -74,7 +75,7 @@ EXPORT_SYMBOL(sn_rtc_cycles_per_second); | |||
74 | DEFINE_PER_CPU(struct sn_hub_info_s, __sn_hub_info); | 75 | DEFINE_PER_CPU(struct sn_hub_info_s, __sn_hub_info); |
75 | EXPORT_PER_CPU_SYMBOL(__sn_hub_info); | 76 | EXPORT_PER_CPU_SYMBOL(__sn_hub_info); |
76 | 77 | ||
77 | DEFINE_PER_CPU(short, __sn_cnodeid_to_nasid[MAX_NUMNODES]); | 78 | DEFINE_PER_CPU(short, __sn_cnodeid_to_nasid[MAX_COMPACT_NODES]); |
78 | EXPORT_PER_CPU_SYMBOL(__sn_cnodeid_to_nasid); | 79 | EXPORT_PER_CPU_SYMBOL(__sn_cnodeid_to_nasid); |
79 | 80 | ||
80 | DEFINE_PER_CPU(struct nodepda_s *, __sn_nodepda); | 81 | DEFINE_PER_CPU(struct nodepda_s *, __sn_nodepda); |
@@ -125,20 +126,6 @@ struct screen_info sn_screen_info = { | |||
125 | }; | 126 | }; |
126 | 127 | ||
127 | /* | 128 | /* |
128 | * This is here so we can use the CMOS detection in ide-probe.c to | ||
129 | * determine what drives are present. In theory, we don't need this | ||
130 | * as the auto-detection could be done via ide-probe.c:do_probe() but | ||
131 | * in practice that would be much slower, which is painful when | ||
132 | * running in the simulator. Note that passing zeroes in DRIVE_INFO | ||
133 | * is sufficient (the IDE driver will autodetect the drive geometry). | ||
134 | */ | ||
135 | #ifdef CONFIG_IA64_GENERIC | ||
136 | extern char drive_info[4 * 16]; | ||
137 | #else | ||
138 | char drive_info[4 * 16]; | ||
139 | #endif | ||
140 | |||
141 | /* | ||
142 | * This routine can only be used during init, since | 129 | * This routine can only be used during init, since |
143 | * smp_boot_data is an init data structure. | 130 | * smp_boot_data is an init data structure. |
144 | * We have to use smp_boot_data.cpu_phys_id to find | 131 | * We have to use smp_boot_data.cpu_phys_id to find |
@@ -330,6 +317,7 @@ struct pcdp_vga_device { | |||
330 | #define PCDP_PCI_TRANS_IOPORT 0x02 | 317 | #define PCDP_PCI_TRANS_IOPORT 0x02 |
331 | #define PCDP_PCI_TRANS_MMIO 0x01 | 318 | #define PCDP_PCI_TRANS_MMIO 0x01 |
332 | 319 | ||
320 | #if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE) | ||
333 | static void | 321 | static void |
334 | sn_scan_pcdp(void) | 322 | sn_scan_pcdp(void) |
335 | { | 323 | { |
@@ -371,6 +359,17 @@ sn_scan_pcdp(void) | |||
371 | break; /* once we find the primary, we're done */ | 359 | break; /* once we find the primary, we're done */ |
372 | } | 360 | } |
373 | } | 361 | } |
362 | #endif | ||
363 | |||
364 | static unsigned long sn2_rtc_initial; | ||
365 | |||
366 | static unsigned long long ia64_sn2_printk_clock(void) | ||
367 | { | ||
368 | unsigned long rtc_now = rtc_time(); | ||
369 | |||
370 | return (rtc_now - sn2_rtc_initial) * | ||
371 | (1000000000 / sn_rtc_cycles_per_second); | ||
372 | } | ||
374 | 373 | ||
375 | /** | 374 | /** |
376 | * sn_setup - SN platform setup routine | 375 | * sn_setup - SN platform setup routine |
@@ -386,6 +385,7 @@ void __init sn_setup(char **cmdline_p) | |||
386 | u32 version = sn_sal_rev(); | 385 | u32 version = sn_sal_rev(); |
387 | extern void sn_cpu_init(void); | 386 | extern void sn_cpu_init(void); |
388 | 387 | ||
388 | sn2_rtc_initial = rtc_time(); | ||
389 | ia64_sn_plat_set_error_handling_features(); // obsolete | 389 | ia64_sn_plat_set_error_handling_features(); // obsolete |
390 | ia64_sn_set_os_feature(OSF_MCA_SLV_TO_OS_INIT_SLV); | 390 | ia64_sn_set_os_feature(OSF_MCA_SLV_TO_OS_INIT_SLV); |
391 | ia64_sn_set_os_feature(OSF_FEAT_LOG_SBES); | 391 | ia64_sn_set_os_feature(OSF_FEAT_LOG_SBES); |
@@ -437,19 +437,6 @@ void __init sn_setup(char **cmdline_p) | |||
437 | */ | 437 | */ |
438 | build_cnode_tables(); | 438 | build_cnode_tables(); |
439 | 439 | ||
440 | /* | ||
441 | * Old PROMs do not provide an ACPI FADT. Disable legacy keyboard | ||
442 | * support here so we don't have to listen to failed keyboard probe | ||
443 | * messages. | ||
444 | */ | ||
445 | if (version <= 0x0209 && acpi_kbd_controller_present) { | ||
446 | printk(KERN_INFO "Disabling legacy keyboard support as prom " | ||
447 | "is too old and doesn't provide FADT\n"); | ||
448 | acpi_kbd_controller_present = 0; | ||
449 | } | ||
450 | |||
451 | printk("SGI SAL version %x.%02x\n", version >> 8, version & 0x00FF); | ||
452 | |||
453 | status = | 440 | status = |
454 | ia64_sal_freq_base(SAL_FREQ_BASE_REALTIME_CLOCK, &ticks_per_sec, | 441 | ia64_sal_freq_base(SAL_FREQ_BASE_REALTIME_CLOCK, &ticks_per_sec, |
455 | &drift); | 442 | &drift); |
@@ -463,6 +450,21 @@ void __init sn_setup(char **cmdline_p) | |||
463 | 450 | ||
464 | platform_intr_list[ACPI_INTERRUPT_CPEI] = IA64_CPE_VECTOR; | 451 | platform_intr_list[ACPI_INTERRUPT_CPEI] = IA64_CPE_VECTOR; |
465 | 452 | ||
453 | ia64_printk_clock = ia64_sn2_printk_clock; | ||
454 | |||
455 | /* | ||
456 | * Old PROMs do not provide an ACPI FADT. Disable legacy keyboard | ||
457 | * support here so we don't have to listen to failed keyboard probe | ||
458 | * messages. | ||
459 | */ | ||
460 | if (version <= 0x0209 && acpi_kbd_controller_present) { | ||
461 | printk(KERN_INFO "Disabling legacy keyboard support as prom " | ||
462 | "is too old and doesn't provide FADT\n"); | ||
463 | acpi_kbd_controller_present = 0; | ||
464 | } | ||
465 | |||
466 | printk("SGI SAL version %x.%02x\n", version >> 8, version & 0x00FF); | ||
467 | |||
466 | /* | 468 | /* |
467 | * we set the default root device to /dev/hda | 469 | * we set the default root device to /dev/hda |
468 | * to make simulation easy | 470 | * to make simulation easy |
@@ -496,6 +498,7 @@ void __init sn_setup(char **cmdline_p) | |||
496 | * for sn. | 498 | * for sn. |
497 | */ | 499 | */ |
498 | pm_power_off = ia64_sn_power_down; | 500 | pm_power_off = ia64_sn_power_down; |
501 | current->thread.flags |= IA64_THREAD_MIGRATION; | ||
499 | } | 502 | } |
500 | 503 | ||
501 | /** | 504 | /** |
@@ -658,7 +661,8 @@ void __init sn_cpu_init(void) | |||
658 | SH2_PIO_WRITE_STATUS_1, SH2_PIO_WRITE_STATUS_3}; | 661 | SH2_PIO_WRITE_STATUS_1, SH2_PIO_WRITE_STATUS_3}; |
659 | u64 *pio; | 662 | u64 *pio; |
660 | pio = is_shub1() ? pio1 : pio2; | 663 | pio = is_shub1() ? pio1 : pio2; |
661 | pda->pio_write_status_addr = (volatile unsigned long *) LOCAL_MMR_ADDR(pio[slice]); | 664 | pda->pio_write_status_addr = |
665 | (volatile unsigned long *)GLOBAL_MMR_ADDR(nasid, pio[slice]); | ||
662 | pda->pio_write_status_val = is_shub1() ? SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_MASK : 0; | 666 | pda->pio_write_status_val = is_shub1() ? SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_MASK : 0; |
663 | } | 667 | } |
664 | 668 | ||
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 | |||
190 | read_version_entry(char *page, char **start, off_t off, int count, int *eof, | 190 | read_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 | |||
202 | read_fit_entry(char *page, char **start, off_t off, int count, int *eof, | 202 | read_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) | |||
263 | void __exit prominfo_exit(void) | 264 | void __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..d9d306c79f2d 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 | ||
47 | static __cacheline_aligned DEFINE_SPINLOCK(sn2_global_ptc_lock); | 47 | static __cacheline_aligned DEFINE_SPINLOCK(sn2_global_ptc_lock); |
48 | 48 | ||
49 | void sn2_ptc_deadlock_recovery(short *, short, short, int, volatile unsigned long *, unsigned long, | 49 | extern unsigned long |
50 | volatile unsigned long *, unsigned long); | 50 | sn2_ptc_deadlock_recovery_core(volatile unsigned long *, unsigned long, |
51 | volatile unsigned long *, unsigned long, | ||
52 | volatile unsigned long *, unsigned long); | ||
53 | void | ||
54 | sn2_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 | ||
62 | static inline void ptc_lock(int sh1, unsigned long *flagp) | ||
63 | { | ||
64 | spin_lock_irqsave(PTC_LOCK(sh1), *flagp); | ||
65 | } | ||
66 | |||
67 | static inline void ptc_unlock(int sh1, unsigned long flags) | ||
68 | { | ||
69 | spin_unlock_irqrestore(PTC_LOCK(sh1), flags); | ||
70 | } | ||
71 | |||
72 | struct ptc_stats { | 68 | struct 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 | |||
85 | static inline unsigned long wait_piowc(void) | 83 | static inline unsigned long wait_piowc(void) |
86 | { | 84 | { |
87 | volatile unsigned long *piows; | 85 | volatile unsigned long *piows; |
@@ -95,6 +93,27 @@ static inline unsigned long wait_piowc(void) | |||
95 | return (ws & SH_PIO_WRITE_STATUS_WRITE_DEADLOCK_MASK) != 0; | 93 | return (ws & SH_PIO_WRITE_STATUS_WRITE_DEADLOCK_MASK) != 0; |
96 | } | 94 | } |
97 | 95 | ||
96 | /** | ||
97 | * sn_migrate - SN-specific task migration actions | ||
98 | * @task: Task being migrated to new CPU | ||
99 | * | ||
100 | * SN2 PIO writes from separate CPUs are not guaranteed to arrive in order. | ||
101 | * Context switching user threads which have memory-mapped MMIO may cause | ||
102 | * PIOs to issue from seperate CPUs, thus the PIO writes must be drained | ||
103 | * from the previous CPU's Shub before execution resumes on the new CPU. | ||
104 | */ | ||
105 | void sn_migrate(struct task_struct *task) | ||
106 | { | ||
107 | pda_t *last_pda = pdacpu(task_thread_info(task)->last_cpu); | ||
108 | volatile unsigned long *adr = last_pda->pio_write_status_addr; | ||
109 | unsigned long val = last_pda->pio_write_status_val; | ||
110 | |||
111 | /* Drain PIO writes from old CPU's Shub */ | ||
112 | while (unlikely((*adr & SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_MASK) | ||
113 | != val)) | ||
114 | cpu_relax(); | ||
115 | } | ||
116 | |||
98 | void sn_tlb_migrate_finish(struct mm_struct *mm) | 117 | void sn_tlb_migrate_finish(struct mm_struct *mm) |
99 | { | 118 | { |
100 | /* flush_tlb_mm is inefficient if more than 1 users of mm */ | 119 | /* flush_tlb_mm is inefficient if more than 1 users of mm */ |
@@ -200,7 +219,7 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start, | |||
200 | max_active = max_active_pio(shub1); | 219 | max_active = max_active_pio(shub1); |
201 | 220 | ||
202 | itc = ia64_get_itc(); | 221 | itc = ia64_get_itc(); |
203 | ptc_lock(shub1, &flags); | 222 | spin_lock_irqsave(PTC_LOCK(shub1), flags); |
204 | itc2 = ia64_get_itc(); | 223 | itc2 = ia64_get_itc(); |
205 | 224 | ||
206 | __get_cpu_var(ptcstats).lock_itc_clocks += itc2 - itc; | 225 | __get_cpu_var(ptcstats).lock_itc_clocks += itc2 - itc; |
@@ -258,7 +277,7 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start, | |||
258 | ia64_srlz_d(); | 277 | ia64_srlz_d(); |
259 | } | 278 | } |
260 | 279 | ||
261 | ptc_unlock(shub1, flags); | 280 | spin_unlock_irqrestore(PTC_LOCK(shub1), flags); |
262 | 281 | ||
263 | preempt_enable(); | 282 | preempt_enable(); |
264 | } | 283 | } |
@@ -270,11 +289,12 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start, | |||
270 | * TLB flush transaction. The recovery sequence is somewhat tricky & is | 289 | * TLB flush transaction. The recovery sequence is somewhat tricky & is |
271 | * coded in assembly language. | 290 | * coded in assembly language. |
272 | */ | 291 | */ |
273 | void sn2_ptc_deadlock_recovery(short *nasids, short ib, short ie, int mynasid, volatile unsigned long *ptc0, unsigned long data0, | 292 | |
274 | volatile unsigned long *ptc1, unsigned long data1) | 293 | void |
294 | sn2_ptc_deadlock_recovery(short *nasids, short ib, short ie, int mynasid, | ||
295 | volatile unsigned long *ptc0, unsigned long data0, | ||
296 | volatile unsigned long *ptc1, unsigned long data1) | ||
275 | { | 297 | { |
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; | 298 | short nasid, i; |
279 | unsigned long *piows, zeroval, n; | 299 | unsigned long *piows, zeroval, n; |
280 | 300 | ||
@@ -447,7 +467,7 @@ static struct proc_dir_entry *proc_sn2_ptc; | |||
447 | static int __init sn2_ptc_init(void) | 467 | static int __init sn2_ptc_init(void) |
448 | { | 468 | { |
449 | if (!ia64_platform_is("sn2")) | 469 | if (!ia64_platform_is("sn2")) |
450 | return -ENOSYS; | 470 | return 0; |
451 | 471 | ||
452 | if (!(proc_sn2_ptc = create_proc_entry(PTC_BASENAME, 0444, NULL))) { | 472 | if (!(proc_sn2_ptc = create_proc_entry(PTC_BASENAME, 0444, NULL))) { |
453 | printk(KERN_ERR "unable to create %s proc entry", PTC_BASENAME); | 473 | printk(KERN_ERR "unable to create %s proc entry", PTC_BASENAME); |
diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c index 19b54fbcd7ea..70db21f3df21 100644 --- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c +++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.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) 2004-2005 Silicon Graphics, Inc. All rights reserved. | 6 | * Copyright (C) 2004-2006 Silicon Graphics, Inc. All rights reserved. |
7 | * | 7 | * |
8 | * SGI Altix topology and hardware performance monitoring API. | 8 | * SGI Altix topology and hardware performance monitoring API. |
9 | * Mark Goodwin <markgw@sgi.com>. | 9 | * Mark Goodwin <markgw@sgi.com>. |
@@ -973,6 +973,9 @@ static int __devinit sn_hwperf_misc_register_init(void) | |||
973 | { | 973 | { |
974 | int e; | 974 | int e; |
975 | 975 | ||
976 | if (!ia64_platform_is("sn2")) | ||
977 | return 0; | ||
978 | |||
976 | sn_hwperf_init(); | 979 | sn_hwperf_init(); |
977 | 980 | ||
978 | /* | 981 | /* |
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 | ||
16 | static int partition_id_show(struct seq_file *s, void *p) | 16 | static 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 | ||
93 | static struct proc_dir_entry *sn_procfs_create_entry( | 93 | static 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 */ |
diff --git a/arch/ia64/sn/kernel/sn2/timer.c b/arch/ia64/sn/kernel/sn2/timer.c index deb9baf4d473..56a88b6df4b4 100644 --- a/arch/ia64/sn/kernel/sn2/timer.c +++ b/arch/ia64/sn/kernel/sn2/timer.c | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | #include <asm/hw_irq.h> | 15 | #include <asm/hw_irq.h> |
16 | #include <asm/system.h> | 16 | #include <asm/system.h> |
17 | #include <asm/timex.h> | ||
17 | 18 | ||
18 | #include <asm/sn/leds.h> | 19 | #include <asm/sn/leds.h> |
19 | #include <asm/sn/shub_mmr.h> | 20 | #include <asm/sn/shub_mmr.h> |
@@ -28,9 +29,27 @@ static struct time_interpolator sn2_interpolator = { | |||
28 | .source = TIME_SOURCE_MMIO64 | 29 | .source = TIME_SOURCE_MMIO64 |
29 | }; | 30 | }; |
30 | 31 | ||
32 | /* | ||
33 | * sn udelay uses the RTC instead of the ITC because the ITC is not | ||
34 | * synchronized across all CPUs, and the thread may migrate to another CPU | ||
35 | * if preemption is enabled. | ||
36 | */ | ||
37 | static void | ||
38 | ia64_sn_udelay (unsigned long usecs) | ||
39 | { | ||
40 | unsigned long start = rtc_time(); | ||
41 | unsigned long end = start + | ||
42 | usecs * sn_rtc_cycles_per_second / 1000000; | ||
43 | |||
44 | while (time_before((unsigned long)rtc_time(), end)) | ||
45 | cpu_relax(); | ||
46 | } | ||
47 | |||
31 | void __init sn_timer_init(void) | 48 | void __init sn_timer_init(void) |
32 | { | 49 | { |
33 | sn2_interpolator.frequency = sn_rtc_cycles_per_second; | 50 | sn2_interpolator.frequency = sn_rtc_cycles_per_second; |
34 | sn2_interpolator.addr = RTC_COUNTER_ADDR; | 51 | sn2_interpolator.addr = RTC_COUNTER_ADDR; |
35 | register_time_interpolator(&sn2_interpolator); | 52 | register_time_interpolator(&sn2_interpolator); |
53 | |||
54 | ia64_udelay = &ia64_sn_udelay; | ||
36 | } | 55 | } |
diff --git a/arch/ia64/sn/kernel/sn2/timer_interrupt.c b/arch/ia64/sn/kernel/sn2/timer_interrupt.c index adf5db2e2afe..fa7f69945917 100644 --- a/arch/ia64/sn/kernel/sn2/timer_interrupt.c +++ b/arch/ia64/sn/kernel/sn2/timer_interrupt.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * | 2 | * |
3 | * | 3 | * |
4 | * Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved. | 4 | * Copyright (c) 2005, 2006 Silicon Graphics, Inc. All Rights Reserved. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of version 2 of the GNU General Public License | 7 | * under the terms of version 2 of the GNU General Public License |
@@ -22,11 +22,6 @@ | |||
22 | * License along with this program; if not, write the Free Software | 22 | * License along with this program; if not, write the Free Software |
23 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | 23 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. |
24 | * | 24 | * |
25 | * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, | ||
26 | * Mountain View, CA 94043, or: | ||
27 | * | ||
28 | * http://www.sgi.com | ||
29 | * | ||
30 | * For further information regarding this notice, see: | 25 | * For further information regarding this notice, see: |
31 | * | 26 | * |
32 | * http://oss.sgi.com/projects/GenInfo/NoticeExplan | 27 | * http://oss.sgi.com/projects/GenInfo/NoticeExplan |
diff --git a/arch/ia64/sn/kernel/tiocx.c b/arch/ia64/sn/kernel/tiocx.c index d263d3e8fbb9..99cb28e74295 100644 --- a/arch/ia64/sn/kernel/tiocx.c +++ b/arch/ia64/sn/kernel/tiocx.c | |||
@@ -284,12 +284,10 @@ struct sn_irq_info *tiocx_irq_alloc(nasid_t nasid, int widget, int irq, | |||
284 | if ((nasid & 1) == 0) | 284 | if ((nasid & 1) == 0) |
285 | return NULL; | 285 | return NULL; |
286 | 286 | ||
287 | sn_irq_info = kmalloc(sn_irq_size, GFP_KERNEL); | 287 | sn_irq_info = kzalloc(sn_irq_size, GFP_KERNEL); |
288 | if (sn_irq_info == NULL) | 288 | if (sn_irq_info == NULL) |
289 | return NULL; | 289 | return NULL; |
290 | 290 | ||
291 | memset(sn_irq_info, 0x0, sn_irq_size); | ||
292 | |||
293 | status = tiocx_intr_alloc(nasid, widget, __pa(sn_irq_info), irq, | 291 | status = tiocx_intr_alloc(nasid, widget, __pa(sn_irq_info), irq, |
294 | req_nasid, slice); | 292 | req_nasid, slice); |
295 | if (status) { | 293 | if (status) { |
@@ -486,7 +484,7 @@ static int __init tiocx_init(void) | |||
486 | int found_tiocx_device = 0; | 484 | int found_tiocx_device = 0; |
487 | 485 | ||
488 | if (!ia64_platform_is("sn2")) | 486 | if (!ia64_platform_is("sn2")) |
489 | return -ENODEV; | 487 | return 0; |
490 | 488 | ||
491 | bus_register(&tiocx_bus_type); | 489 | bus_register(&tiocx_bus_type); |
492 | 490 | ||
diff --git a/arch/ia64/sn/kernel/xpc_channel.c b/arch/ia64/sn/kernel/xpc_channel.c index 36e5437a0fb6..cdf6856ce089 100644 --- a/arch/ia64/sn/kernel/xpc_channel.c +++ b/arch/ia64/sn/kernel/xpc_channel.c | |||
@@ -738,7 +738,9 @@ xpc_process_disconnect(struct xpc_channel *ch, unsigned long *irq_flags) | |||
738 | 738 | ||
739 | /* make sure all activity has settled down first */ | 739 | /* make sure all activity has settled down first */ |
740 | 740 | ||
741 | if (atomic_read(&ch->references) > 0) { | 741 | if (atomic_read(&ch->references) > 0 || |
742 | ((ch->flags & XPC_C_CONNECTEDCALLOUT_MADE) && | ||
743 | !(ch->flags & XPC_C_DISCONNECTINGCALLOUT_MADE))) { | ||
742 | return; | 744 | return; |
743 | } | 745 | } |
744 | DBUG_ON(atomic_read(&ch->kthreads_assigned) != 0); | 746 | DBUG_ON(atomic_read(&ch->kthreads_assigned) != 0); |
@@ -775,7 +777,7 @@ xpc_process_disconnect(struct xpc_channel *ch, unsigned long *irq_flags) | |||
775 | 777 | ||
776 | /* both sides are disconnected now */ | 778 | /* both sides are disconnected now */ |
777 | 779 | ||
778 | if (ch->flags & XPC_C_CONNECTCALLOUT) { | 780 | if (ch->flags & XPC_C_DISCONNECTINGCALLOUT_MADE) { |
779 | spin_unlock_irqrestore(&ch->lock, *irq_flags); | 781 | spin_unlock_irqrestore(&ch->lock, *irq_flags); |
780 | xpc_disconnect_callout(ch, xpcDisconnected); | 782 | xpc_disconnect_callout(ch, xpcDisconnected); |
781 | spin_lock_irqsave(&ch->lock, *irq_flags); | 783 | spin_lock_irqsave(&ch->lock, *irq_flags); |
@@ -1300,7 +1302,7 @@ xpc_process_msg_IPI(struct xpc_partition *part, int ch_number) | |||
1300 | "delivered=%d, partid=%d, channel=%d\n", | 1302 | "delivered=%d, partid=%d, channel=%d\n", |
1301 | nmsgs_sent, ch->partid, ch->number); | 1303 | nmsgs_sent, ch->partid, ch->number); |
1302 | 1304 | ||
1303 | if (ch->flags & XPC_C_CONNECTCALLOUT) { | 1305 | if (ch->flags & XPC_C_CONNECTEDCALLOUT_MADE) { |
1304 | xpc_activate_kthreads(ch, nmsgs_sent); | 1306 | xpc_activate_kthreads(ch, nmsgs_sent); |
1305 | } | 1307 | } |
1306 | } | 1308 | } |
diff --git a/arch/ia64/sn/kernel/xpc_main.c b/arch/ia64/sn/kernel/xpc_main.c index 9cd460dfe27e..8cbf16432570 100644 --- a/arch/ia64/sn/kernel/xpc_main.c +++ b/arch/ia64/sn/kernel/xpc_main.c | |||
@@ -750,12 +750,16 @@ xpc_daemonize_kthread(void *args) | |||
750 | /* let registerer know that connection has been established */ | 750 | /* let registerer know that connection has been established */ |
751 | 751 | ||
752 | spin_lock_irqsave(&ch->lock, irq_flags); | 752 | spin_lock_irqsave(&ch->lock, irq_flags); |
753 | if (!(ch->flags & XPC_C_CONNECTCALLOUT)) { | 753 | if (!(ch->flags & XPC_C_CONNECTEDCALLOUT)) { |
754 | ch->flags |= XPC_C_CONNECTCALLOUT; | 754 | ch->flags |= XPC_C_CONNECTEDCALLOUT; |
755 | spin_unlock_irqrestore(&ch->lock, irq_flags); | 755 | spin_unlock_irqrestore(&ch->lock, irq_flags); |
756 | 756 | ||
757 | xpc_connected_callout(ch); | 757 | xpc_connected_callout(ch); |
758 | 758 | ||
759 | spin_lock_irqsave(&ch->lock, irq_flags); | ||
760 | ch->flags |= XPC_C_CONNECTEDCALLOUT_MADE; | ||
761 | spin_unlock_irqrestore(&ch->lock, irq_flags); | ||
762 | |||
759 | /* | 763 | /* |
760 | * It is possible that while the callout was being | 764 | * It is possible that while the callout was being |
761 | * made that the remote partition sent some messages. | 765 | * made that the remote partition sent some messages. |
@@ -777,15 +781,17 @@ xpc_daemonize_kthread(void *args) | |||
777 | 781 | ||
778 | if (atomic_dec_return(&ch->kthreads_assigned) == 0) { | 782 | if (atomic_dec_return(&ch->kthreads_assigned) == 0) { |
779 | spin_lock_irqsave(&ch->lock, irq_flags); | 783 | spin_lock_irqsave(&ch->lock, irq_flags); |
780 | if ((ch->flags & XPC_C_CONNECTCALLOUT) && | 784 | if ((ch->flags & XPC_C_CONNECTEDCALLOUT_MADE) && |
781 | !(ch->flags & XPC_C_DISCONNECTCALLOUT)) { | 785 | !(ch->flags & XPC_C_DISCONNECTINGCALLOUT)) { |
782 | ch->flags |= XPC_C_DISCONNECTCALLOUT; | 786 | ch->flags |= XPC_C_DISCONNECTINGCALLOUT; |
783 | spin_unlock_irqrestore(&ch->lock, irq_flags); | 787 | spin_unlock_irqrestore(&ch->lock, irq_flags); |
784 | 788 | ||
785 | xpc_disconnect_callout(ch, xpcDisconnecting); | 789 | xpc_disconnect_callout(ch, xpcDisconnecting); |
786 | } else { | 790 | |
787 | spin_unlock_irqrestore(&ch->lock, irq_flags); | 791 | spin_lock_irqsave(&ch->lock, irq_flags); |
792 | ch->flags |= XPC_C_DISCONNECTINGCALLOUT_MADE; | ||
788 | } | 793 | } |
794 | spin_unlock_irqrestore(&ch->lock, irq_flags); | ||
789 | if (atomic_dec_return(&part->nchannels_engaged) == 0) { | 795 | if (atomic_dec_return(&part->nchannels_engaged) == 0) { |
790 | xpc_mark_partition_disengaged(part); | 796 | xpc_mark_partition_disengaged(part); |
791 | xpc_IPI_send_disengage(part); | 797 | xpc_IPI_send_disengage(part); |