Skip site navigation (1)Skip section navigation (2)
Date:      17 Dec 1998 13:28:34 -0800
From:      Matt Braithwaite <mab@alink.net>
To:        mobile@FreeBSD.ORG
Subject:   APM can suspend right after resume without updating clock 
Message-ID:  <86empyjw59.fsf@zildjian.hq.alink.net>

next in thread | raw e-mail | index | archive | help
when i powered up today, my machine (nec versa lx) suspended
instantly.  i connected AC power, and powered up again.  dmesg showed
only this:

\^G\^G * * * BATTERY IS LOW * * * \^G\^G<5>resumed from suspended mode
(slept 00:00:41)

but the first time i powered it up, it had been asleep for over eight
hours.  unsurprisingly, the clock was off by that amount of time.
looking at apm.c (2.2.8-STABLE), it's easy to see how this could
happen: the low power event inevitably suspends the machine right
away: 

		    OPMEV_DEBUGMESSAGE(PMEV_BATTERYLOW);
			apm_battery_low();
			apm_suspend();
			break;

my guess is that for some reason, the APM code got hold of the low
battery event before the resume event.  unfortunately, i don't know
how best to fix this.  is it easy to schedule the suspend a little bit 
into the future, to catch other events?  would it be easy to update
the clock before suspending?  could suspending on low battery be left
up to user code?

-- 
Matthew Braithwaite

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?86empyjw59.fsf>