From 52604c49a620809826ea0904f4e2ea46a20c3f25 Mon Sep 17 00:00:00 2001 From: Nate Lawson Date: Thu, 6 Dec 2007 01:39:23 +0000 Subject: [PATCH] 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 --- sys/i386/bios/apm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/i386/bios/apm.c b/sys/i386/bios/apm.c index 894d1351622..a8447283496 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; }