]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/i386/kernel/alternative.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes
[linux-2.6-omap-h63xx.git] / arch / i386 / kernel / alternative.c
index 7b421b3a053e0ce8827410566a601b7050a7ff76..583c238e17fb2e9550fbbcb490ba1a41288b97dc 100644 (file)
@@ -303,6 +303,16 @@ void alternatives_smp_switch(int smp)
        struct smp_alt_module *mod;
        unsigned long flags;
 
+#ifdef CONFIG_LOCKDEP
+       /*
+        * A not yet fixed binutils section handling bug prevents
+        * alternatives-replacement from working reliably, so turn
+        * it off:
+        */
+       printk("lockdep: not fixing up alternatives.\n");
+       return;
+#endif
+
        if (no_replacement || smp_alt_once)
                return;
        BUG_ON(!smp && (num_online_cpus() > 1));
@@ -334,6 +344,7 @@ void alternatives_smp_switch(int smp)
 
 void __init alternative_instructions(void)
 {
+       unsigned long flags;
        if (no_replacement) {
                printk(KERN_INFO "(SMP-)alternatives turned off\n");
                free_init_pages("SMP alternatives",
@@ -341,6 +352,8 @@ void __init alternative_instructions(void)
                                (unsigned long)__smp_alt_end);
                return;
        }
+
+       local_irq_save(flags);
        apply_alternatives(__alt_instructions, __alt_instructions_end);
 
        /* switch to patch-once-at-boottime-only mode and free the
@@ -376,4 +389,5 @@ void __init alternative_instructions(void)
                alternatives_smp_switch(0);
        }
 #endif
+       local_irq_restore(flags);
 }