Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 May 1999 14:09:23 +0900
From:      Mitsuru IWASAKI <iwasaki@jp.FreeBSD.org>
To:        randy@psg.com
Cc:        freebsd-mobile@freebsd.org
Subject:   Re: PAO3-19990518 gives calcru: negative time of -69...
Message-ID:  <199905240510.OAA23390@tasogare.imasy.or.jp>
In-Reply-To: Your message of "Sat, 22 May 1999 23:53:30 -0700 (PDT)" <m10lS8Y-00000BC@roam.psg.com>
References:  <m10lS8Y-00000BC@roam.psg.com>

next in thread | previous in thread | raw e-mail | index | archive | help
randy> calcru: negative time of -16087 usec for pid 7 ([)

Could you try this?
sysctl -w kern.timecounter.method=1

This problem seems 3.X problem, not PAO specific one.

Another story, we had similar problem after resuming 
on some NotePCs. we fixed this by reseting i8254 state in 
apm_default_resume().

The following is the added code in PAO3 
by Kenjiro Cho-san (kjc@csl.sony.co.jp).

/sys/i386/isa/clock.c:
/*
 * i8254_restore is called from apm_default_resume() to reload
 * the countdown register.
 * this should not be necessary but there are broken laptops that
 * do not restore the countdown register on resume.
 * when it happnes, it messes up the hardclock interval and system clock,
 * which leads to the infamous "calcru: negative time" problem.
 */
void
i8254_restore(void)
{
        u_long ef;

        ef = read_eflags(); 
        disable_intr();
        outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT);
        outb(TIMER_CNTR0, timer0_max_count & 0xff);
        outb(TIMER_CNTR0, timer0_max_count >> 8);
        CLOCK_UNLOCK();
        write_eflags(ef);
}




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199905240510.OAA23390>