diff options
author | njl <njl@FreeBSD.org> | 2007-12-06 01:39:23 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2007-12-06 01:39:23 +0000 |
commit | 2a1203094929305cfee849143c8d4aa3942077f7 (patch) | |
tree | 5828257084a0673ac75923c0ed429a6fe3609ea4 /sys/i386/bios/apm.c | |
parent | 475b5616558f70d42e26258e5c744cf8b400f258 (diff) | |
download | FreeBSD-src-2a1203094929305cfee849143c8d4aa3942077f7.zip FreeBSD-src-2a1203094929305cfee849143c8d4aa3942077f7.tar.gz |
Hold Giant over the entire execution of the suspend path instead of
dropping it after each call into newbus. This doesn't fix any known
problems but seems more correct.
Submitted by: Marko Zec <zec / icir.org>
Diffstat (limited to 'sys/i386/bios/apm.c')
-rw-r--r-- | sys/i386/bios/apm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/i386/bios/apm.c b/sys/i386/bios/apm.c index 894d135..a844728 100644 --- a/sys/i386/bios/apm.c +++ b/sys/i386/bios/apm.c @@ -491,9 +491,10 @@ apm_do_suspend(void) */ mtx_lock(&Giant); error = DEVICE_SUSPEND(root_bus); - mtx_unlock(&Giant); - if (error) + if (error) { + mtx_unlock(&Giant); return; + } apm_execute_hook(hook[APM_HOOK_SUSPEND]); if (apm_suspend_system(PMST_SUSPEND) == 0) { @@ -502,10 +503,9 @@ apm_do_suspend(void) } else { /* Failure, 'resume' the system again */ apm_execute_hook(hook[APM_HOOK_RESUME]); - mtx_lock(&Giant); DEVICE_RESUME(root_bus); - mtx_unlock(&Giant); } + mtx_unlock(&Giant); return; } |