Module Name: src Committed By: riz Date: Sat Mar 13 07:27:09 UTC 2010
Modified Files: src/sys/dev/apm [netbsd-5]: apm.c Log Message: Pull up following revision(s) (requested by bouyer in ticket #1337): sys/dev/apm/apm.c: revision 1.26 Fix apm(4) suspend/resume: - apm_suspend() and apm_standby() will call splhhigh() before entering standby or suspend. After resume, the system go back tsleep()ing in the apm thread without restoring the ipl (this is done in apm_resume()), and calling tlseep() at IPL_HIGH cause a DIAGNOSTIC panic (and other bad things, I guess). Fix by calling apm_resume() from within apm_suspend() or apm_standby(), after aa_set_powstate() has returned. - In apm_event_handle(), we test (apm_standbys || apm_suspends) to set apm_damn_fool_bios to 1 and break the while() loop in apm_periodic_check(). But we set apm_standbys or apm_suspends to non-0 only if apm_op_inprog is 0 and we failed to record the apm event. With apmd listening we usually succeed recording the event, so apm_standbys/apm_suspends remains 0 and we never go out of the while() loop. Fix by apm_op_inprog instead of (apm_standbys || apm_suspends) to break the loop. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.22.6.1 src/sys/dev/apm/apm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.