aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64
diff options
context:
space:
mode:
authorFernando Luis VazquezCao <fernando@oss.ntt.co.jp>2007-05-02 13:27:17 -0400
committerAndi Kleen <andi@basil.nowhere.org>2007-05-02 13:27:17 -0400
commitea8c733b98b73289421ed8f8fc15cfbce3adc3bc (patch)
tree7522643f5ff0f9158a710b907d6f5258ae62ba59 /arch/x86_64
parentae08e43eecd250e50ffa40c4bd62a65e005b875b (diff)
[PATCH] x86-64: use safe_apic_wait_icr_idle in smpboot.c - x86_64
The functionality provided by the new safe_apic_wait_icr_idle is being open-coded all over "kernel/smpboot.c". Use safe_apic_wait_icr_idle instead to consolidate code and ease maintenance. Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp> Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/x86_64')
-rw-r--r--arch/x86_64/kernel/smpboot.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
index ddc392bee243..f2a234b390e8 100644
--- a/arch/x86_64/kernel/smpboot.c
+++ b/arch/x86_64/kernel/smpboot.c
@@ -429,8 +429,8 @@ static void inquire_remote_apic(int apicid)
429 */ 429 */
430static int __cpuinit wakeup_secondary_via_INIT(int phys_apicid, unsigned int start_rip) 430static int __cpuinit wakeup_secondary_via_INIT(int phys_apicid, unsigned int start_rip)
431{ 431{
432 unsigned long send_status = 0, accept_status = 0; 432 unsigned long send_status, accept_status = 0;
433 int maxlvt, timeout, num_starts, j; 433 int maxlvt, num_starts, j;
434 434
435 Dprintk("Asserting INIT.\n"); 435 Dprintk("Asserting INIT.\n");
436 436
@@ -446,12 +446,7 @@ static int __cpuinit wakeup_secondary_via_INIT(int phys_apicid, unsigned int sta
446 | APIC_DM_INIT); 446 | APIC_DM_INIT);
447 447
448 Dprintk("Waiting for send to finish...\n"); 448 Dprintk("Waiting for send to finish...\n");
449 timeout = 0; 449 send_status = safe_apic_wait_icr_idle();
450 do {
451 Dprintk("+");
452 udelay(100);
453 send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY;
454 } while (send_status && (timeout++ < 1000));
455 450
456 mdelay(10); 451 mdelay(10);
457 452
@@ -464,12 +459,7 @@ static int __cpuinit wakeup_secondary_via_INIT(int phys_apicid, unsigned int sta
464 apic_write(APIC_ICR, APIC_INT_LEVELTRIG | APIC_DM_INIT); 459 apic_write(APIC_ICR, APIC_INT_LEVELTRIG | APIC_DM_INIT);
465 460
466 Dprintk("Waiting for send to finish...\n"); 461 Dprintk("Waiting for send to finish...\n");
467 timeout = 0; 462 send_status = safe_apic_wait_icr_idle();
468 do {
469 Dprintk("+");
470 udelay(100);
471 send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY;
472 } while (send_status && (timeout++ < 1000));
473 463
474 mb(); 464 mb();
475 atomic_set(&init_deasserted, 1); 465 atomic_set(&init_deasserted, 1);
@@ -508,12 +498,7 @@ static int __cpuinit wakeup_secondary_via_INIT(int phys_apicid, unsigned int sta
508 Dprintk("Startup point 1.\n"); 498 Dprintk("Startup point 1.\n");
509 499
510 Dprintk("Waiting for send to finish...\n"); 500 Dprintk("Waiting for send to finish...\n");
511 timeout = 0; 501 send_status = safe_apic_wait_icr_idle();
512 do {
513 Dprintk("+");
514 udelay(100);
515 send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY;
516 } while (send_status && (timeout++ < 1000));
517 502
518 /* 503 /*
519 * Give the other CPU some time to accept the IPI. 504 * Give the other CPU some time to accept the IPI.