[PATCH 2.6.12] x86_64/kernel/time.c

From: Gerhard Wichert (Gerhard.Wichert_at_fujitsu-siemens.com)
Date: 08/26/05

  • Next message: Daniel Walker: "Re: 2.6.13-rc7-rt1"
    To: linux-kernel@vger.kernel.org
    Date:	Fri, 26 Aug 2005 16:18:00 +0200
    
    

     
    Hi,
    there are are two error returns of hpet_init() but vxtime.hpet_address remains
    set.
    This can cause div-by-zero exceptions later in the boot process when executing
    the
    wrong code sequences ( hpet code instead of pit code). To avoid this error
    behaviour
    vxtime.hpet_address should be cleared in time_init() if hpet_init() returns
    -1.

    Regards, Gerhard.

    --- linux-2.6.12.orig/arch/x86_64/kernel/time.c 2005-06-17 21:48:29.000000000
    +0200
    +++ linux-2.6.12/arch/x86_64/kernel/time.c 2005-08-16 08:54:29.000000000
    +0200
    @@ -892,16 +892,16 @@
                           "at %#lx.\n", vxtime.hpet_address);
             }
     #endif
    - if (nohpet)
    - vxtime.hpet_address = 0;
    -
            xtime.tv_sec = get_cmos_time();
            xtime.tv_nsec = 0;

            set_normalized_timespec(&wall_to_monotonic,
                                    -xtime.tv_sec, -xtime.tv_nsec);

    - if (!hpet_init()) {
    + if (nohpet || hpet_init())
    + vxtime.hpet_address = 0;
    +
    + if (vxtime.hpet_address) {
                     vxtime_hz = (1000000000000000L + hpet_period / 2) /
                            hpet_period;
                    cpu_khz = hpet_calibrate_tsc();

    -- 
    Gerhard Wichert              Phone: +49 5251 8 15127
    Fujitsu Siemens Computers    Fax:   +49 5251 8 20409
    Heinz-Nixdorf-Ring 1         mailto:Gerhard.Wichert@Fujitsu-Siemens.com
    D-33106 Paderborn            http://www.fujitsu-siemens.com/primergy
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Daniel Walker: "Re: 2.6.13-rc7-rt1"

    Relevant Pages