aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-15 12:57:54 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-15 12:57:54 -0400
commit4937ce87959629d31e9b09cf5bdf1e12a305c805 (patch)
treef5b93ec4f8271c7109bbd61e09c788e0be7caa85 /arch/ia64/kernel
parent4271e0f7e12bdbbd7ce131187aaae2ba5233a309 (diff)
parent432a7d6587fc5028421342785f6c9552c9fba175 (diff)
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6: [IA64] update sn2_defconfig [IA64] Fix kernel hangup in kdump on INIT [IA64] Fix kernel panic in kdump on INIT [IA64] Remove vector from ia64_machine_kexec() [IA64] Fix race when multiple cpus go through MCA [IA64] Remove needless delay in MCA rendezvous [IA64] add driver for ACPI methods to call native firmware [IA64] abstract SAL_CALL wrapper to allow other firmware entry points [IA64] perfmon: Remove exit_pfm_fs() [IA64] tree-wide: Misc __cpu{initdata, init, exit} annotations
Diffstat (limited to 'arch/ia64/kernel')
-rw-r--r--arch/ia64/kernel/crash.c13
-rw-r--r--arch/ia64/kernel/machine_kexec.c6
-rw-r--r--arch/ia64/kernel/mca.c88
-rw-r--r--arch/ia64/kernel/mca_drv.h2
-rw-r--r--arch/ia64/kernel/palinfo.c6
-rw-r--r--arch/ia64/kernel/perfmon.c7
-rw-r--r--arch/ia64/kernel/salinfo.c4
-rw-r--r--arch/ia64/kernel/topology.c12
8 files changed, 64 insertions, 74 deletions
diff --git a/arch/ia64/kernel/crash.c b/arch/ia64/kernel/crash.c
index 1d64ef478dde..f1cf2df97a2d 100644
--- a/arch/ia64/kernel/crash.c
+++ b/arch/ia64/kernel/crash.c
@@ -118,11 +118,6 @@ machine_crash_shutdown(struct pt_regs *pt)
118static void 118static void
119machine_kdump_on_init(void) 119machine_kdump_on_init(void)
120{ 120{
121 if (!ia64_kimage) {
122 printk(KERN_NOTICE "machine_kdump_on_init(): "
123 "kdump not configured\n");
124 return;
125 }
126 local_irq_disable(); 121 local_irq_disable();
127 kexec_disable_iosapic(); 122 kexec_disable_iosapic();
128 machine_kexec(ia64_kimage); 123 machine_kexec(ia64_kimage);
@@ -156,6 +151,14 @@ kdump_init_notifier(struct notifier_block *self, unsigned long val, void *data)
156 if (!kdump_on_init) 151 if (!kdump_on_init)
157 return NOTIFY_DONE; 152 return NOTIFY_DONE;
158 153
154 if (!ia64_kimage) {
155 if (val == DIE_INIT_MONARCH_LEAVE)
156 ia64_mca_printk(KERN_NOTICE
157 "%s: kdump not configured\n",
158 __FUNCTION__);
159 return NOTIFY_DONE;
160 }
161
159 if (val != DIE_INIT_MONARCH_LEAVE && 162 if (val != DIE_INIT_MONARCH_LEAVE &&
160 val != DIE_INIT_SLAVE_LEAVE && 163 val != DIE_INIT_SLAVE_LEAVE &&
161 val != DIE_INIT_MONARCH_PROCESS && 164 val != DIE_INIT_MONARCH_PROCESS &&
diff --git a/arch/ia64/kernel/machine_kexec.c b/arch/ia64/kernel/machine_kexec.c
index 4f0f3b8c1ee2..58e943a5d95c 100644
--- a/arch/ia64/kernel/machine_kexec.c
+++ b/arch/ia64/kernel/machine_kexec.c
@@ -79,7 +79,6 @@ static void ia64_machine_kexec(struct unw_frame_info *info, void *arg)
79 relocate_new_kernel_t rnk; 79 relocate_new_kernel_t rnk;
80 void *pal_addr = efi_get_pal_addr(); 80 void *pal_addr = efi_get_pal_addr();
81 unsigned long code_addr = (unsigned long)page_address(image->control_code_page); 81 unsigned long code_addr = (unsigned long)page_address(image->control_code_page);
82 unsigned long vector;
83 int ii; 82 int ii;
84 83
85 BUG_ON(!image); 84 BUG_ON(!image);
@@ -107,11 +106,8 @@ static void ia64_machine_kexec(struct unw_frame_info *info, void *arg)
107 /* unmask TPR and clear any pending interrupts */ 106 /* unmask TPR and clear any pending interrupts */
108 ia64_setreg(_IA64_REG_CR_TPR, 0); 107 ia64_setreg(_IA64_REG_CR_TPR, 0);
109 ia64_srlz_d(); 108 ia64_srlz_d();
110 vector = ia64_get_ivr(); 109 while (ia64_get_ivr() != IA64_SPURIOUS_INT_VECTOR)
111 while (vector != IA64_SPURIOUS_INT_VECTOR) {
112 ia64_eoi(); 110 ia64_eoi();
113 vector = ia64_get_ivr();
114 }
115 platform_kernel_launch_event(); 111 platform_kernel_launch_event();
116 rnk = (relocate_new_kernel_t)&code_addr; 112 rnk = (relocate_new_kernel_t)&code_addr;
117 (*rnk)(image->head, image->start, ia64_boot_param, 113 (*rnk)(image->head, image->start, ia64_boot_param,
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index 63b73f3d4c9f..cc87025e8f54 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -701,8 +701,7 @@ ia64_mca_cmc_vector_enable_keventd(struct work_struct *unused)
701/* 701/*
702 * ia64_mca_wakeup 702 * ia64_mca_wakeup
703 * 703 *
704 * Send an inter-cpu interrupt to wake-up a particular cpu 704 * Send an inter-cpu interrupt to wake-up a particular cpu.
705 * and mark that cpu to be out of rendez.
706 * 705 *
707 * Inputs : cpuid 706 * Inputs : cpuid
708 * Outputs : None 707 * Outputs : None
@@ -711,14 +710,12 @@ static void
711ia64_mca_wakeup(int cpu) 710ia64_mca_wakeup(int cpu)
712{ 711{
713 platform_send_ipi(cpu, IA64_MCA_WAKEUP_VECTOR, IA64_IPI_DM_INT, 0); 712 platform_send_ipi(cpu, IA64_MCA_WAKEUP_VECTOR, IA64_IPI_DM_INT, 0);
714 ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_NOTDONE;
715
716} 713}
717 714
718/* 715/*
719 * ia64_mca_wakeup_all 716 * ia64_mca_wakeup_all
720 * 717 *
721 * Wakeup all the cpus which have rendez'ed previously. 718 * Wakeup all the slave cpus which have rendez'ed previously.
722 * 719 *
723 * Inputs : None 720 * Inputs : None
724 * Outputs : None 721 * Outputs : None
@@ -741,7 +738,10 @@ ia64_mca_wakeup_all(void)
741 * 738 *
742 * This is handler used to put slave processors into spinloop 739 * This is handler used to put slave processors into spinloop
743 * while the monarch processor does the mca handling and later 740 * while the monarch processor does the mca handling and later
744 * wake each slave up once the monarch is done. 741 * wake each slave up once the monarch is done. The state
742 * IA64_MCA_RENDEZ_CHECKIN_DONE indicates the cpu is rendez'ed
743 * in SAL. The state IA64_MCA_RENDEZ_CHECKIN_NOTDONE indicates
744 * the cpu has come out of OS rendezvous.
745 * 745 *
746 * Inputs : None 746 * Inputs : None
747 * Outputs : None 747 * Outputs : None
@@ -778,6 +778,7 @@ ia64_mca_rendez_int_handler(int rendez_irq, void *arg)
778 (long)&nd, 0, 0) == NOTIFY_STOP) 778 (long)&nd, 0, 0) == NOTIFY_STOP)
779 ia64_mca_spin(__FUNCTION__); 779 ia64_mca_spin(__FUNCTION__);
780 780
781 ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_NOTDONE;
781 /* Enable all interrupts */ 782 /* Enable all interrupts */
782 local_irq_restore(flags); 783 local_irq_restore(flags);
783 return IRQ_HANDLED; 784 return IRQ_HANDLED;
@@ -1135,30 +1136,27 @@ no_mod:
1135static void 1136static void
1136ia64_wait_for_slaves(int monarch, const char *type) 1137ia64_wait_for_slaves(int monarch, const char *type)
1137{ 1138{
1138 int c, wait = 0, missing = 0; 1139 int c, i , wait;
1139 for_each_online_cpu(c) { 1140
1140 if (c == monarch) 1141 /*
1141 continue; 1142 * wait 5 seconds total for slaves (arbitrary)
1142 if (ia64_mc_info.imi_rendez_checkin[c] == IA64_MCA_RENDEZ_CHECKIN_NOTDONE) { 1143 */
1143 udelay(1000); /* short wait first */ 1144 for (i = 0; i < 5000; i++) {
1144 wait = 1; 1145 wait = 0;
1145 break; 1146 for_each_online_cpu(c) {
1146 } 1147 if (c == monarch)
1147 } 1148 continue;
1148 if (!wait) 1149 if (ia64_mc_info.imi_rendez_checkin[c]
1149 goto all_in; 1150 == IA64_MCA_RENDEZ_CHECKIN_NOTDONE) {
1150 for_each_online_cpu(c) { 1151 udelay(1000); /* short wait */
1151 if (c == monarch) 1152 wait = 1;
1152 continue; 1153 break;
1153 if (ia64_mc_info.imi_rendez_checkin[c] == IA64_MCA_RENDEZ_CHECKIN_NOTDONE) { 1154 }
1154 udelay(5*1000000); /* wait 5 seconds for slaves (arbitrary) */
1155 if (ia64_mc_info.imi_rendez_checkin[c] == IA64_MCA_RENDEZ_CHECKIN_NOTDONE)
1156 missing = 1;
1157 break;
1158 } 1155 }
1156 if (!wait)
1157 goto all_in;
1159 } 1158 }
1160 if (!missing) 1159
1161 goto all_in;
1162 /* 1160 /*
1163 * Maybe slave(s) dead. Print buffered messages immediately. 1161 * Maybe slave(s) dead. Print buffered messages immediately.
1164 */ 1162 */
@@ -1224,26 +1222,27 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw,
1224 if (notify_die(DIE_MCA_MONARCH_ENTER, "MCA", regs, (long)&nd, 0, 0) 1222 if (notify_die(DIE_MCA_MONARCH_ENTER, "MCA", regs, (long)&nd, 0, 0)
1225 == NOTIFY_STOP) 1223 == NOTIFY_STOP)
1226 ia64_mca_spin(__FUNCTION__); 1224 ia64_mca_spin(__FUNCTION__);
1225
1226 ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_CONCURRENT_MCA;
1227 if (sos->monarch) { 1227 if (sos->monarch) {
1228 ia64_wait_for_slaves(cpu, "MCA"); 1228 ia64_wait_for_slaves(cpu, "MCA");
1229
1230 /* Wakeup all the processors which are spinning in the
1231 * rendezvous loop. They will leave SAL, then spin in the OS
1232 * with interrupts disabled until this monarch cpu leaves the
1233 * MCA handler. That gets control back to the OS so we can
1234 * backtrace the other cpus, backtrace when spinning in SAL
1235 * does not work.
1236 */
1237 ia64_mca_wakeup_all();
1238 if (notify_die(DIE_MCA_MONARCH_PROCESS, "MCA", regs, (long)&nd, 0, 0)
1239 == NOTIFY_STOP)
1240 ia64_mca_spin(__FUNCTION__);
1229 } else { 1241 } else {
1230 ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_CONCURRENT_MCA;
1231 while (cpu_isset(cpu, mca_cpu)) 1242 while (cpu_isset(cpu, mca_cpu))
1232 cpu_relax(); /* spin until monarch wakes us */ 1243 cpu_relax(); /* spin until monarch wakes us */
1233 ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_NOTDONE;
1234 } 1244 }
1235 1245
1236 /* Wakeup all the processors which are spinning in the rendezvous loop.
1237 * They will leave SAL, then spin in the OS with interrupts disabled
1238 * until this monarch cpu leaves the MCA handler. That gets control
1239 * back to the OS so we can backtrace the other cpus, backtrace when
1240 * spinning in SAL does not work.
1241 */
1242 ia64_mca_wakeup_all();
1243 if (notify_die(DIE_MCA_MONARCH_PROCESS, "MCA", regs, (long)&nd, 0, 0)
1244 == NOTIFY_STOP)
1245 ia64_mca_spin(__FUNCTION__);
1246
1247 /* Get the MCA error record and log it */ 1246 /* Get the MCA error record and log it */
1248 ia64_mca_log_sal_error_record(SAL_INFO_TYPE_MCA); 1247 ia64_mca_log_sal_error_record(SAL_INFO_TYPE_MCA);
1249 1248
@@ -1277,21 +1276,22 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw,
1277 /* wake up the next monarch cpu, 1276 /* wake up the next monarch cpu,
1278 * and put this cpu in the rendez loop. 1277 * and put this cpu in the rendez loop.
1279 */ 1278 */
1280 ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_CONCURRENT_MCA;
1281 for_each_online_cpu(i) { 1279 for_each_online_cpu(i) {
1282 if (cpu_isset(i, mca_cpu)) { 1280 if (cpu_isset(i, mca_cpu)) {
1283 monarch_cpu = i; 1281 monarch_cpu = i;
1284 cpu_clear(i, mca_cpu); /* wake next cpu */ 1282 cpu_clear(i, mca_cpu); /* wake next cpu */
1285 while (monarch_cpu != -1) 1283 while (monarch_cpu != -1)
1286 cpu_relax(); /* spin until last cpu leaves */ 1284 cpu_relax(); /* spin until last cpu leaves */
1287 ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_NOTDONE;
1288 set_curr_task(cpu, previous_current); 1285 set_curr_task(cpu, previous_current);
1286 ia64_mc_info.imi_rendez_checkin[cpu]
1287 = IA64_MCA_RENDEZ_CHECKIN_NOTDONE;
1289 return; 1288 return;
1290 } 1289 }
1291 } 1290 }
1292 } 1291 }
1293 set_curr_task(cpu, previous_current); 1292 set_curr_task(cpu, previous_current);
1294 monarch_cpu = -1; 1293 ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_NOTDONE;
1294 monarch_cpu = -1; /* This frees the slaves and previous monarchs */
1295} 1295}
1296 1296
1297static DECLARE_WORK(cmc_disable_work, ia64_mca_cmc_vector_disable_keventd); 1297static DECLARE_WORK(cmc_disable_work, ia64_mca_cmc_vector_disable_keventd);
diff --git a/arch/ia64/kernel/mca_drv.h b/arch/ia64/kernel/mca_drv.h
index c85e943ba5fd..485e34d0b199 100644
--- a/arch/ia64/kernel/mca_drv.h
+++ b/arch/ia64/kernel/mca_drv.h
@@ -118,7 +118,5 @@ struct mca_table_entry {
118 118
119extern const struct mca_table_entry *search_mca_tables (unsigned long addr); 119extern const struct mca_table_entry *search_mca_tables (unsigned long addr);
120extern int mca_recover_range(unsigned long); 120extern int mca_recover_range(unsigned long);
121extern void ia64_mca_printk(const char * fmt, ...)
122 __attribute__ ((format (printf, 1, 2)));
123extern void ia64_mlogbuf_dump(void); 121extern void ia64_mlogbuf_dump(void);
124 122
diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c
index 85829e27785c..6ef6ffb943a0 100644
--- a/arch/ia64/kernel/palinfo.c
+++ b/arch/ia64/kernel/palinfo.c
@@ -907,7 +907,7 @@ palinfo_read_entry(char *page, char **start, off_t off, int count, int *eof, voi
907 return len; 907 return len;
908} 908}
909 909
910static void 910static void __cpuinit
911create_palinfo_proc_entries(unsigned int cpu) 911create_palinfo_proc_entries(unsigned int cpu)
912{ 912{
913# define CPUSTR "cpu%d" 913# define CPUSTR "cpu%d"
@@ -968,7 +968,7 @@ remove_palinfo_proc_entries(unsigned int hcpu)
968 } 968 }
969} 969}
970 970
971static int palinfo_cpu_callback(struct notifier_block *nfb, 971static int __cpuinit palinfo_cpu_callback(struct notifier_block *nfb,
972 unsigned long action, void *hcpu) 972 unsigned long action, void *hcpu)
973{ 973{
974 unsigned int hotcpu = (unsigned long)hcpu; 974 unsigned int hotcpu = (unsigned long)hcpu;
@@ -986,7 +986,7 @@ static int palinfo_cpu_callback(struct notifier_block *nfb,
986 return NOTIFY_OK; 986 return NOTIFY_OK;
987} 987}
988 988
989static struct notifier_block palinfo_cpu_notifier = 989static struct notifier_block palinfo_cpu_notifier __cpuinitdata =
990{ 990{
991 .notifier_call = palinfo_cpu_callback, 991 .notifier_call = palinfo_cpu_callback,
992 .priority = 0, 992 .priority = 0,
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 14b8e5a6222b..f55fa07849c4 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -1538,13 +1538,6 @@ init_pfm_fs(void)
1538 return err; 1538 return err;
1539} 1539}
1540 1540
1541static void __exit
1542exit_pfm_fs(void)
1543{
1544 unregister_filesystem(&pfm_fs_type);
1545 mntput(pfmfs_mnt);
1546}
1547
1548static ssize_t 1541static ssize_t
1549pfm_read(struct file *filp, char __user *buf, size_t size, loff_t *ppos) 1542pfm_read(struct file *filp, char __user *buf, size_t size, loff_t *ppos)
1550{ 1543{
diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c
index 25cd75f50ab1..779c3cca206c 100644
--- a/arch/ia64/kernel/salinfo.c
+++ b/arch/ia64/kernel/salinfo.c
@@ -574,7 +574,7 @@ static const struct file_operations salinfo_data_fops = {
574 .write = salinfo_log_write, 574 .write = salinfo_log_write,
575}; 575};
576 576
577static int __devinit 577static int __cpuinit
578salinfo_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu) 578salinfo_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu)
579{ 579{
580 unsigned int i, cpu = (unsigned long)hcpu; 580 unsigned int i, cpu = (unsigned long)hcpu;
@@ -615,7 +615,7 @@ salinfo_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu
615 return NOTIFY_OK; 615 return NOTIFY_OK;
616} 616}
617 617
618static struct notifier_block salinfo_cpu_notifier = 618static struct notifier_block salinfo_cpu_notifier __cpuinitdata =
619{ 619{
620 .notifier_call = salinfo_cpu_callback, 620 .notifier_call = salinfo_cpu_callback,
621 .priority = 0, 621 .priority = 0,
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
index 94ae3c87d828..14261fee5f4d 100644
--- a/arch/ia64/kernel/topology.c
+++ b/arch/ia64/kernel/topology.c
@@ -118,11 +118,11 @@ struct cpu_cache_info {
118 struct kobject kobj; 118 struct kobject kobj;
119}; 119};
120 120
121static struct cpu_cache_info all_cpu_cache_info[NR_CPUS]; 121static struct cpu_cache_info all_cpu_cache_info[NR_CPUS] __cpuinitdata;
122#define LEAF_KOBJECT_PTR(x,y) (&all_cpu_cache_info[x].cache_leaves[y]) 122#define LEAF_KOBJECT_PTR(x,y) (&all_cpu_cache_info[x].cache_leaves[y])
123 123
124#ifdef CONFIG_SMP 124#ifdef CONFIG_SMP
125static void cache_shared_cpu_map_setup( unsigned int cpu, 125static void __cpuinit cache_shared_cpu_map_setup( unsigned int cpu,
126 struct cache_info * this_leaf) 126 struct cache_info * this_leaf)
127{ 127{
128 pal_cache_shared_info_t csi; 128 pal_cache_shared_info_t csi;
@@ -157,7 +157,7 @@ static void cache_shared_cpu_map_setup( unsigned int cpu,
157 &csi) == PAL_STATUS_SUCCESS); 157 &csi) == PAL_STATUS_SUCCESS);
158} 158}
159#else 159#else
160static void cache_shared_cpu_map_setup(unsigned int cpu, 160static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu,
161 struct cache_info * this_leaf) 161 struct cache_info * this_leaf)
162{ 162{
163 cpu_set(cpu, this_leaf->shared_cpu_map); 163 cpu_set(cpu, this_leaf->shared_cpu_map);
@@ -428,13 +428,13 @@ static struct notifier_block __cpuinitdata cache_cpu_notifier =
428 .notifier_call = cache_cpu_callback 428 .notifier_call = cache_cpu_callback
429}; 429};
430 430
431static int __cpuinit cache_sysfs_init(void) 431static int __init cache_sysfs_init(void)
432{ 432{
433 int i; 433 int i;
434 434
435 for_each_online_cpu(i) { 435 for_each_online_cpu(i) {
436 cache_cpu_callback(&cache_cpu_notifier, CPU_ONLINE, 436 struct sys_device *sys_dev = get_cpu_sysdev((unsigned int)i);
437 (void *)(long)i); 437 cache_add_dev(sys_dev);
438 } 438 }
439 439
440 register_hotcpu_notifier(&cache_cpu_notifier); 440 register_hotcpu_notifier(&cache_cpu_notifier);