x86/smpboot: Remove udelay(100) when polling cpu_callin_map
[firefly-linux-kernel-4.4.55.git] / arch / x86 / kernel / smpboot.c
index d3010aa79dafaff14e74b140e12daa2756f03160..310b6f0bf6f7ddd56098fdf11a71a3e1955651f2 100644 (file)
@@ -898,7 +898,7 @@ static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle)
 
        if (!boot_error) {
                /*
-                * Wait 10s total for a response from AP
+                * Wait 10s total for first sign of life from AP
                 */
                boot_error = -1;
                timeout = jiffies + 10*HZ;
@@ -911,7 +911,6 @@ static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle)
                                boot_error = 0;
                                break;
                        }
-                       udelay(100);
                        schedule();
                }
        }
@@ -927,7 +926,6 @@ static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle)
                         * for the MTRR work(triggered by the AP coming online)
                         * to be completed in the stop machine context.
                         */
-                       udelay(100);
                        schedule();
                }
        }
@@ -992,8 +990,17 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
 
        common_cpu_up(cpu, tidle);
 
+       /*
+        * We have to walk the irq descriptors to setup the vector
+        * space for the cpu which comes online.  Prevent irq
+        * alloc/free across the bringup.
+        */
+       irq_lock_sparse();
+
        err = do_boot_cpu(apicid, cpu, tidle);
+
        if (err) {
+               irq_unlock_sparse();
                pr_err("do_boot_cpu failed(%d) to wakeup CPU#%u\n", err, cpu);
                return -EIO;
        }
@@ -1011,6 +1018,8 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
                touch_nmi_watchdog();
        }
 
+       irq_unlock_sparse();
+
        return 0;
 }