mca.c (4ba24fef3eb3b142197135223b90ced2f319cd53) mca.c (5d2068da8d339e4dff8f9b9a1246e6a79e2949d8)
1/*
2 * File: mca.c
3 * Purpose: Generic MCA handling layer
4 *
5 * Copyright (C) 2003 Hewlett-Packard Co
6 * David Mosberger-Tang <davidm@hpl.hp.com>
7 *
8 * Copyright (C) 2002 Dell Inc.

--- 1279 unchanged lines hidden (view full) ---

1288 { .sos = sos, .monarch_cpu = &monarch_cpu, .data = &recover };
1289 static atomic_t mca_count;
1290 static cpumask_t mca_cpu;
1291
1292 if (atomic_add_return(1, &mca_count) == 1) {
1293 monarch_cpu = cpu;
1294 sos->monarch = 1;
1295 } else {
1/*
2 * File: mca.c
3 * Purpose: Generic MCA handling layer
4 *
5 * Copyright (C) 2003 Hewlett-Packard Co
6 * David Mosberger-Tang <davidm@hpl.hp.com>
7 *
8 * Copyright (C) 2002 Dell Inc.

--- 1279 unchanged lines hidden (view full) ---

1288 { .sos = sos, .monarch_cpu = &monarch_cpu, .data = &recover };
1289 static atomic_t mca_count;
1290 static cpumask_t mca_cpu;
1291
1292 if (atomic_add_return(1, &mca_count) == 1) {
1293 monarch_cpu = cpu;
1294 sos->monarch = 1;
1295 } else {
1296 cpu_set(cpu, mca_cpu);
1296 cpumask_set_cpu(cpu, &mca_cpu);
1297 sos->monarch = 0;
1298 }
1299 mprintk(KERN_INFO "Entered OS MCA handler. PSP=%lx cpu=%d "
1300 "monarch=%ld\n", sos->proc_state_param, cpu, sos->monarch);
1301
1302 previous_current = ia64_mca_modify_original_stack(regs, sw, sos, "MCA");
1303
1304 NOTIFY_MCA(DIE_MCA_MONARCH_ENTER, regs, (long)&nd, 1);

--- 6 unchanged lines hidden (view full) ---

1311 * rendezvous loop. They will leave SAL, then spin in the OS
1312 * with interrupts disabled until this monarch cpu leaves the
1313 * MCA handler. That gets control back to the OS so we can
1314 * backtrace the other cpus, backtrace when spinning in SAL
1315 * does not work.
1316 */
1317 ia64_mca_wakeup_all();
1318 } else {
1297 sos->monarch = 0;
1298 }
1299 mprintk(KERN_INFO "Entered OS MCA handler. PSP=%lx cpu=%d "
1300 "monarch=%ld\n", sos->proc_state_param, cpu, sos->monarch);
1301
1302 previous_current = ia64_mca_modify_original_stack(regs, sw, sos, "MCA");
1303
1304 NOTIFY_MCA(DIE_MCA_MONARCH_ENTER, regs, (long)&nd, 1);

--- 6 unchanged lines hidden (view full) ---

1311 * rendezvous loop. They will leave SAL, then spin in the OS
1312 * with interrupts disabled until this monarch cpu leaves the
1313 * MCA handler. That gets control back to the OS so we can
1314 * backtrace the other cpus, backtrace when spinning in SAL
1315 * does not work.
1316 */
1317 ia64_mca_wakeup_all();
1318 } else {
1319 while (cpu_isset(cpu, mca_cpu))
1319 while (cpumask_test_cpu(cpu, &mca_cpu))
1320 cpu_relax(); /* spin until monarch wakes us */
1321 }
1322
1323 NOTIFY_MCA(DIE_MCA_MONARCH_PROCESS, regs, (long)&nd, 1);
1324
1325 /* Get the MCA error record and log it */
1326 ia64_mca_log_sal_error_record(SAL_INFO_TYPE_MCA);
1327

--- 22 unchanged lines hidden (view full) ---

1350
1351 if (atomic_dec_return(&mca_count) > 0) {
1352 int i;
1353
1354 /* wake up the next monarch cpu,
1355 * and put this cpu in the rendez loop.
1356 */
1357 for_each_online_cpu(i) {
1320 cpu_relax(); /* spin until monarch wakes us */
1321 }
1322
1323 NOTIFY_MCA(DIE_MCA_MONARCH_PROCESS, regs, (long)&nd, 1);
1324
1325 /* Get the MCA error record and log it */
1326 ia64_mca_log_sal_error_record(SAL_INFO_TYPE_MCA);
1327

--- 22 unchanged lines hidden (view full) ---

1350
1351 if (atomic_dec_return(&mca_count) > 0) {
1352 int i;
1353
1354 /* wake up the next monarch cpu,
1355 * and put this cpu in the rendez loop.
1356 */
1357 for_each_online_cpu(i) {
1358 if (cpu_isset(i, mca_cpu)) {
1358 if (cpumask_test_cpu(i, &mca_cpu)) {
1359 monarch_cpu = i;
1359 monarch_cpu = i;
1360 cpu_clear(i, mca_cpu); /* wake next cpu */
1360 cpumask_clear_cpu(i, &mca_cpu); /* wake next cpu */
1361 while (monarch_cpu != -1)
1362 cpu_relax(); /* spin until last cpu leaves */
1363 set_curr_task(cpu, previous_current);
1364 ia64_mc_info.imi_rendez_checkin[cpu]
1365 = IA64_MCA_RENDEZ_CHECKIN_NOTDONE;
1366 return;
1367 }
1368 }

--- 448 unchanged lines hidden (view full) ---

1817 memset(p, 0, KERNEL_STACK_SIZE);
1818 ti = task_thread_info(p);
1819 ti->flags = _TIF_MCA_INIT;
1820 ti->preempt_count = 1;
1821 ti->task = p;
1822 ti->cpu = cpu;
1823 p->stack = ti;
1824 p->state = TASK_UNINTERRUPTIBLE;
1361 while (monarch_cpu != -1)
1362 cpu_relax(); /* spin until last cpu leaves */
1363 set_curr_task(cpu, previous_current);
1364 ia64_mc_info.imi_rendez_checkin[cpu]
1365 = IA64_MCA_RENDEZ_CHECKIN_NOTDONE;
1366 return;
1367 }
1368 }

--- 448 unchanged lines hidden (view full) ---

1817 memset(p, 0, KERNEL_STACK_SIZE);
1818 ti = task_thread_info(p);
1819 ti->flags = _TIF_MCA_INIT;
1820 ti->preempt_count = 1;
1821 ti->task = p;
1822 ti->cpu = cpu;
1823 p->stack = ti;
1824 p->state = TASK_UNINTERRUPTIBLE;
1825 cpu_set(cpu, p->cpus_allowed);
1825 cpumask_set_cpu(cpu, &p->cpus_allowed);
1826 INIT_LIST_HEAD(&p->tasks);
1827 p->parent = p->real_parent = p->group_leader = p;
1828 INIT_LIST_HEAD(&p->children);
1829 INIT_LIST_HEAD(&p->sibling);
1830 strncpy(p->comm, type, sizeof(p->comm)-1);
1831}
1832
1833/* Caller prevents this from being called after init */

--- 333 unchanged lines hidden ---
1826 INIT_LIST_HEAD(&p->tasks);
1827 p->parent = p->real_parent = p->group_leader = p;
1828 INIT_LIST_HEAD(&p->children);
1829 INIT_LIST_HEAD(&p->sibling);
1830 strncpy(p->comm, type, sizeof(p->comm)-1);
1831}
1832
1833/* Caller prevents this from being called after init */

--- 333 unchanged lines hidden ---