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>
This commit is contained in:
Nate Lawson 2007-12-06 01:39:23 +00:00
parent 9c04b2966d
commit 52604c49a6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=174324

View File

@ -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;
}