summaryrefslogtreecommitdiffstats
path: root/sys/i386/bios/apm.h
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2006-05-25 23:06:38 +0000
committerimp <imp@FreeBSD.org>2006-05-25 23:06:38 +0000
commit7854550aa7231727cd1721be60fadda01bbf0834 (patch)
treedbe6bdba11b11a99072e0832f91f2ddc1766df6f /sys/i386/bios/apm.h
parent1e9b50e704d3af2cd55eaef5761804511b5003ed (diff)
downloadFreeBSD-src-7854550aa7231727cd1721be60fadda01bbf0834.zip
FreeBSD-src-7854550aa7231727cd1721be60fadda01bbf0834.tar.gz
APM was calling the suspend process from a timeout. This meant that
other timeouts could not happen while suspending, including timeouts for things like msleep. This caused the system to hang on suspend when the cbb was enabled, since its suspend path powered down the socket which used a timeout to wait for it to be done. APM now creates a thread when it is enabled, and deletes the thread when it is disabled. This thread takes the place of the timeout by doing its polling every ~.9s. When the thread is disabled, it will wakeup early, otherwise it times out and polls the varius things the old timeout polled (APM events, suspend delays, etc). This makes my Sony VAIO 505TS suspend/resume correctly when APM is enabled (ACPI is black listed on my 505TS). This will likely fix other problems with the suspend path where drivers would sleep with msleep and/or do other timeouts. Maybe there's some special case code that would use DELAY while suspending and msleep otherwise that can be revisited and removed. This was also tested by glebius@, who pointed out that in the patch I sent him, I'd forgotten apm_saver.c MFC After: 3 weeks
Diffstat (limited to 'sys/i386/bios/apm.h')
-rw-r--r--sys/i386/bios/apm.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/i386/bios/apm.h b/sys/i386/bios/apm.h
index ce87c54..2b20e61 100644
--- a/sys/i386/bios/apm.h
+++ b/sys/i386/bios/apm.h
@@ -29,7 +29,10 @@ struct apm_softc {
bus_space_handle_t sc_ioh;
struct resource *sc_res;
#endif
- int initialized, active, bios_busy;
+ struct mtx mtx;
+ struct cv cv;
+ struct proc *event_thread;
+ int initialized, active, running, bios_busy;
int always_halt_cpu, slow_idle_cpu;
int disabled, disengaged;
int suspending;
OpenPOWER on IntegriCloud