Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f4df73c2914a49bf6a55896aaecb0563c955e167
Commit:     f4df73c2914a49bf6a55896aaecb0563c955e167
Parent:     bbbd99955bfe84c9ae63f51db946a7bcd21f48be
Author:     Thomas Gleixner <[EMAIL PROTECTED]>
AuthorDate: Thu Nov 15 21:41:50 2007 -0500
Committer:  Thomas Gleixner <[EMAIL PROTECTED](none)>
CommitDate: Sat Nov 17 16:27:01 2007 +0100

    x86: add hpet sanity checks
    
    Some BIOSes advertise HPET at 0x0. We really do no want to
    allocate a resource there. Check for it and leave early.
    
    Other BIOSes tell us the HPET is at 0xfed0000000000000
    instead of 0xfed00000. Add a check and fix it up with a warning
    on user request.
    
    
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 arch/x86/kernel/acpi/boot.c |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 289247d..0ca27c7 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -637,6 +637,38 @@ static int __init acpi_parse_hpet(struct acpi_table_header 
*table)
        }
 
        hpet_address = hpet_tbl->address.address;
+
+       /*
+        * Some broken BIOSes advertise HPET at 0x0. We really do not
+        * want to allocate a resource there.
+        */
+       if (!hpet_address) {
+               printk(KERN_WARNING PREFIX
+                      "HPET id: %#x base: %#lx is invalid\n",
+                      hpet_tbl->id, hpet_address);
+               return 0;
+       }
+#ifdef CONFIG_X86_64
+       /*
+        * Some even more broken BIOSes advertise HPET at
+        * 0xfed0000000000000 instead of 0xfed00000. Fix it up and add
+        * some noise:
+        */
+       if (hpet_address == 0xfed0000000000000UL) {
+               if (!hpet_force_user) {
+                       printk(KERN_WARNING PREFIX "HPET id: %#x "
+                              "base: 0xfed0000000000000 is bogus\n "
+                              "try hpet=force on the kernel command line to "
+                              "fix it up to 0xfed00000.\n", hpet_tbl->id);
+                       hpet_address = 0;
+                       return 0;
+               }
+               printk(KERN_WARNING PREFIX
+                      "HPET id: %#x base: 0xfed0000000000000 fixed up "
+                      "to 0xfed00000.\n", hpet_tbl->id);
+               hpet_address >>= 32;
+       }
+#endif
        printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
               hpet_tbl->id, hpet_address);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to