]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/setup.c
x86: use round_jiffies() for the corruption check timer
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / setup.c
index ec7e56c1b9843df4ad142cb03ad50eda985cc769..161f1b33ecec0ccae3cd8dfaf36df52249d9c98e 100644 (file)
@@ -712,7 +712,7 @@ void check_for_bios_corruption(void)
 static void periodic_check_for_corruption(unsigned long data)
 {
        check_for_bios_corruption();
-       mod_timer(&periodic_check_timer, jiffies + corruption_check_period*HZ);
+       mod_timer(&periodic_check_timer, round_jiffies(jiffies + corruption_check_period*HZ));
 }
 
 void start_periodic_check_for_corruption(void)
@@ -729,6 +729,38 @@ void start_periodic_check_for_corruption(void)
 }
 #endif
 
+static int __init dmi_low_memory_corruption(const struct dmi_system_id *d)
+{
+       printk(KERN_NOTICE
+               "%s detected: BIOS may corrupt low RAM, working it around.\n",
+               d->ident);
+
+       reserve_early_overlap_ok(0x0, 0x10000, "BIOS quirk");
+
+       return 0;
+}
+
+/* List of systems that have known low memory corruption BIOS problems */
+static struct dmi_system_id __initdata bad_bios_dmi_table[] = {
+#ifdef CONFIG_X86_RESERVE_LOW_64K
+       {
+               .callback = dmi_low_memory_corruption,
+               .ident = "AMI BIOS",
+               .matches = {
+                       DMI_MATCH(DMI_BIOS_VENDOR, "American Megatrends Inc."),
+               },
+       },
+       {
+               .callback = dmi_low_memory_corruption,
+               .ident = "Phoenix BIOS",
+               .matches = {
+                       DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies, LTD"),
+               },
+       },
+       {}
+#endif
+};
+
 /*
  * Determine if we were loaded by an EFI loader.  If so, then we have also been
  * passed the efi memmap, systab, etc., so we should use these data structures
@@ -752,6 +784,8 @@ void __init setup_arch(char **cmdline_p)
        printk(KERN_INFO "Command line: %s\n", boot_command_line);
 #endif
 
+       dmi_check_system(bad_bios_dmi_table);
+
        early_cpu_init();
        early_ioremap_init();
 
@@ -1037,3 +1071,5 @@ void __init setup_arch(char **cmdline_p)
 #endif
 #endif
 }
+
+