[PATCH] x86-64: Fix kobject_init() WARN_ON on resume from disk
[powerpc.git] / arch / x86_64 / kernel / pmtimer.c
index ee5ee48..7554458 100644 (file)
@@ -27,7 +27,7 @@
 /* The I/O port the PMTMR resides at.
  * The location is detected during setup_arch(),
  * in arch/i386/kernel/acpi/boot.c */
-u32 pmtmr_ioport;
+u32 pmtmr_ioport __read_mostly;
 
 /* value of the Power timer at last timer interrupt */
 static u32 offset_delay;
@@ -68,7 +68,7 @@ int pmtimer_mark_offset(void)
        offset_delay = delta % (USEC_PER_SEC / HZ);
 
        rdtscll(tsc);
-       vxtime.last_tsc = tsc - offset_delay * cpu_khz;
+       vxtime.last_tsc = tsc - offset_delay * (u64)cpu_khz / 1000;
 
        /* don't calculate delay for first run,
           or if we've got less then a tick */
@@ -121,7 +121,7 @@ unsigned int do_gettimeoffset_pm(void)
 static int __init nopmtimer_setup(char *s)
 {
        pmtmr_ioport = 0;
-       return 0;
+       return 1;
 }
 
 __setup("nopmtimer", nopmtimer_setup);