summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2007-12-06 01:39:23 +0000
committernjl <njl@FreeBSD.org>2007-12-06 01:39:23 +0000
commit2a1203094929305cfee849143c8d4aa3942077f7 (patch)
tree5828257084a0673ac75923c0ed429a6fe3609ea4 /sys
parent475b5616558f70d42e26258e5c744cf8b400f258 (diff)
downloadFreeBSD-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')
-rw-r--r--sys/i386/bios/apm.c8
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;
}
OpenPOWER on IntegriCloud