aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64
diff options
context:
space:
mode:
authorJohn Keller <jpk@sgi.com>2007-08-22 20:32:06 -0400
committerTony Luck <tony.luck@intel.com>2007-09-01 05:49:57 -0400
commit6e9de18120988388cdae5097c09e774416d58745 (patch)
tree04f7de7bee8d38a4e871970afda136bb5ac853be /arch/ia64
parent1aac0b5739ae192ee812eee09625ebfc08c2d760 (diff)
[IA64] SN: Add support for CPU disable
Add additional support for CPU disable on SN platforms. Correctly setup the smp_affinity mask for I/O error IRQs. Restrict the use of the feature to Altix 4000 and 450 systems running with a CPU disable capable PROM, and do not allow disabling of CPU 0. Signed-off-by: John Keller <jpk@sgi.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64')
-rw-r--r--arch/ia64/kernel/smpboot.c6
-rw-r--r--arch/ia64/sn/kernel/huberror.c14
-rw-r--r--arch/ia64/sn/kernel/irq.c15
-rw-r--r--arch/ia64/sn/kernel/sn2/sn2_smp.c26
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_provider.c1
-rw-r--r--arch/ia64/sn/pci/tioca_provider.c2
-rw-r--r--arch/ia64/sn/pci/tioce_provider.c1
7 files changed, 61 insertions, 4 deletions
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index 62209dcf06d3..308772f7cddc 100644
--- a/arch/ia64/kernel/smpboot.c
+++ b/arch/ia64/kernel/smpboot.c
@@ -58,6 +58,7 @@
58#include <asm/system.h> 58#include <asm/system.h>
59#include <asm/tlbflush.h> 59#include <asm/tlbflush.h>
60#include <asm/unistd.h> 60#include <asm/unistd.h>
61#include <asm/sn/arch.h>
61 62
62#define SMP_DEBUG 0 63#define SMP_DEBUG 0
63 64
@@ -730,6 +731,11 @@ int __cpu_disable(void)
730 return (-EBUSY); 731 return (-EBUSY);
731 } 732 }
732 733
734 if (ia64_platform_is("sn2")) {
735 if (!sn_cpu_disable_allowed(cpu))
736 return -EBUSY;
737 }
738
733 cpu_clear(cpu, cpu_online_map); 739 cpu_clear(cpu, cpu_online_map);
734 740
735 if (migrate_platform_irqs(cpu)) { 741 if (migrate_platform_irqs(cpu)) {
diff --git a/arch/ia64/sn/kernel/huberror.c b/arch/ia64/sn/kernel/huberror.c
index 2c3f9dfca78b..b663168da55c 100644
--- a/arch/ia64/sn/kernel/huberror.c
+++ b/arch/ia64/sn/kernel/huberror.c
@@ -185,11 +185,14 @@ void hubiio_crb_error_handler(struct hubdev_info *hubdev_info)
185 */ 185 */
186void hub_error_init(struct hubdev_info *hubdev_info) 186void hub_error_init(struct hubdev_info *hubdev_info)
187{ 187{
188
188 if (request_irq(SGI_II_ERROR, hub_eint_handler, IRQF_SHARED, 189 if (request_irq(SGI_II_ERROR, hub_eint_handler, IRQF_SHARED,
189 "SN_hub_error", (void *)hubdev_info)) 190 "SN_hub_error", (void *)hubdev_info)) {
190 printk("hub_error_init: Failed to request_irq for 0x%p\n", 191 printk("hub_error_init: Failed to request_irq for 0x%p\n",
191 hubdev_info); 192 hubdev_info);
192 return; 193 return;
194 }
195 sn_set_err_irq_affinity(SGI_II_ERROR);
193} 196}
194 197
195 198
@@ -202,11 +205,14 @@ void hub_error_init(struct hubdev_info *hubdev_info)
202 */ 205 */
203void ice_error_init(struct hubdev_info *hubdev_info) 206void ice_error_init(struct hubdev_info *hubdev_info)
204{ 207{
208
205 if (request_irq 209 if (request_irq
206 (SGI_TIO_ERROR, (void *)hub_eint_handler, IRQF_SHARED, "SN_TIO_error", 210 (SGI_TIO_ERROR, (void *)hub_eint_handler, IRQF_SHARED, "SN_TIO_error",
207 (void *)hubdev_info)) 211 (void *)hubdev_info)) {
208 printk("ice_error_init: request_irq() error hubdev_info 0x%p\n", 212 printk("ice_error_init: request_irq() error hubdev_info 0x%p\n",
209 hubdev_info); 213 hubdev_info);
210 return; 214 return;
215 }
216 sn_set_err_irq_affinity(SGI_TIO_ERROR);
211} 217}
212 218
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c
index 360047389449..0f9b12683bf3 100644
--- a/arch/ia64/sn/kernel/irq.c
+++ b/arch/ia64/sn/kernel/irq.c
@@ -19,6 +19,7 @@
19#include <asm/sn/pcidev.h> 19#include <asm/sn/pcidev.h>
20#include <asm/sn/shub_mmr.h> 20#include <asm/sn/shub_mmr.h>
21#include <asm/sn/sn_sal.h> 21#include <asm/sn/sn_sal.h>
22#include <asm/sn/sn_feature_sets.h>
22 23
23static void force_interrupt(int irq); 24static void force_interrupt(int irq);
24static void register_intr_pda(struct sn_irq_info *sn_irq_info); 25static void register_intr_pda(struct sn_irq_info *sn_irq_info);
@@ -233,6 +234,20 @@ static void sn_set_affinity_irq(unsigned int irq, cpumask_t mask)
233 (void)sn_retarget_vector(sn_irq_info, nasid, slice); 234 (void)sn_retarget_vector(sn_irq_info, nasid, slice);
234} 235}
235 236
237#ifdef CONFIG_SMP
238void sn_set_err_irq_affinity(unsigned int irq)
239{
240 /*
241 * On systems which support CPU disabling (SHub2), all error interrupts
242 * are targetted at the boot CPU.
243 */
244 if (is_shub2() && sn_prom_feature_available(PRF_CPU_DISABLE_SUPPORT))
245 set_irq_affinity_info(irq, cpu_physical_id(0), 0);
246}
247#else
248void sn_set_err_irq_affinity(unsigned int irq) { }
249#endif
250
236static void 251static void
237sn_mask_irq(unsigned int irq) 252sn_mask_irq(unsigned int irq)
238{ 253{
diff --git a/arch/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c
index 033c8a9f000e..f3c69329e145 100644
--- a/arch/ia64/sn/kernel/sn2/sn2_smp.c
+++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c
@@ -40,6 +40,7 @@
40#include <asm/sn/shub_mmr.h> 40#include <asm/sn/shub_mmr.h>
41#include <asm/sn/nodepda.h> 41#include <asm/sn/nodepda.h>
42#include <asm/sn/rw_mmr.h> 42#include <asm/sn/rw_mmr.h>
43#include <asm/sn/sn_feature_sets.h>
43 44
44DEFINE_PER_CPU(struct ptc_stats, ptcstats); 45DEFINE_PER_CPU(struct ptc_stats, ptcstats);
45DECLARE_PER_CPU(struct ptc_stats, ptcstats); 46DECLARE_PER_CPU(struct ptc_stats, ptcstats);
@@ -429,6 +430,31 @@ void sn2_send_IPI(int cpuid, int vector, int delivery_mode, int redirect)
429 sn_send_IPI_phys(nasid, physid, vector, delivery_mode); 430 sn_send_IPI_phys(nasid, physid, vector, delivery_mode);
430} 431}
431 432
433#ifdef CONFIG_HOTPLUG_CPU
434/**
435 * sn_cpu_disable_allowed - Determine if a CPU can be disabled.
436 * @cpu - CPU that is requested to be disabled.
437 *
438 * CPU disable is only allowed on SHub2 systems running with a PROM
439 * that supports CPU disable. It is not permitted to disable the boot processor.
440 */
441bool sn_cpu_disable_allowed(int cpu)
442{
443 if (is_shub2() && sn_prom_feature_available(PRF_CPU_DISABLE_SUPPORT)) {
444 if (cpu != 0)
445 return true;
446 else
447 printk(KERN_WARNING
448 "Disabling the boot processor is not allowed.\n");
449
450 } else
451 printk(KERN_WARNING
452 "CPU disable is not supported on this system.\n");
453
454 return false;
455}
456#endif /* CONFIG_HOTPLUG_CPU */
457
432#ifdef CONFIG_PROC_FS 458#ifdef CONFIG_PROC_FS
433 459
434#define PTC_BASENAME "sgi_sn/ptc_statistics" 460#define PTC_BASENAME "sgi_sn/ptc_statistics"
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_provider.c b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
index 42485ad50ceb..ab3eaf85fe4d 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_provider.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
@@ -145,6 +145,7 @@ pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
145 printk(KERN_WARNING 145 printk(KERN_WARNING
146 "pcibr cannot allocate interrupt for error handler\n"); 146 "pcibr cannot allocate interrupt for error handler\n");
147 } 147 }
148 sn_set_err_irq_affinity(SGI_PCIASIC_ERROR);
148 149
149 /* 150 /*
150 * Update the Bridge with the "kernel" pagesize 151 * Update the Bridge with the "kernel" pagesize
diff --git a/arch/ia64/sn/pci/tioca_provider.c b/arch/ia64/sn/pci/tioca_provider.c
index d798dd4d0dc4..ef048a674772 100644
--- a/arch/ia64/sn/pci/tioca_provider.c
+++ b/arch/ia64/sn/pci/tioca_provider.c
@@ -654,6 +654,8 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
654 __FUNCTION__, SGI_TIOCA_ERROR, 654 __FUNCTION__, SGI_TIOCA_ERROR,
655 (int)tioca_common->ca_common.bs_persist_busnum); 655 (int)tioca_common->ca_common.bs_persist_busnum);
656 656
657 sn_set_err_irq_affinity(SGI_TIOCA_ERROR);
658
657 /* Setup locality information */ 659 /* Setup locality information */
658 controller->node = tioca_kern->ca_closest_node; 660 controller->node = tioca_kern->ca_closest_node;
659 return tioca_common; 661 return tioca_common;
diff --git a/arch/ia64/sn/pci/tioce_provider.c b/arch/ia64/sn/pci/tioce_provider.c
index 84b72b27e27f..cee9379d44e0 100644
--- a/arch/ia64/sn/pci/tioce_provider.c
+++ b/arch/ia64/sn/pci/tioce_provider.c
@@ -1034,6 +1034,7 @@ tioce_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
1034 tioce_common->ce_pcibus.bs_persist_segment, 1034 tioce_common->ce_pcibus.bs_persist_segment,
1035 tioce_common->ce_pcibus.bs_persist_busnum); 1035 tioce_common->ce_pcibus.bs_persist_busnum);
1036 1036
1037 sn_set_err_irq_affinity(SGI_PCIASIC_ERROR);
1037 return tioce_common; 1038 return tioce_common;
1038} 1039}
1039 1040