Merge branch 'sh-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[pandora-kernel.git] / arch / x86 / kernel / cpu / mtrr / main.c
index 307dfbb..929739a 100644 (file)
@@ -293,14 +293,24 @@ set_mtrr(unsigned int reg, unsigned long base, unsigned long size, mtrr_type typ
 
        /*
         * HACK!
-        * We use this same function to initialize the mtrrs on boot.
-        * The state of the boot cpu's mtrrs has been saved, and we want
-        * to replicate across all the APs.
-        * If we're doing that @reg is set to something special...
+        *
+        * We use this same function to initialize the mtrrs during boot,
+        * resume, runtime cpu online and on an explicit request to set a
+        * specific MTRR.
+        *
+        * During boot or suspend, the state of the boot cpu's mtrrs has been
+        * saved, and we want to replicate that across all the cpus that come
+        * online (either at the end of boot or resume or during a runtime cpu
+        * online). If we're doing that, @reg is set to something special and on
+        * this cpu we still do mtrr_if->set_all(). During boot/resume, this
+        * is unnecessary if at this point we are still on the cpu that started
+        * the boot/resume sequence. But there is no guarantee that we are still
+        * on the same cpu. So we do mtrr_if->set_all() on this cpu aswell to be
+        * sure that we are in sync with everyone else.
         */
        if (reg != ~0U)
                mtrr_if->set(reg, base, size, type);
-       else if (!mtrr_aps_delayed_init)
+       else
                mtrr_if->set_all();
 
        /* Wait for the others */