mirror of
https://github.com/opnsense/src.git
synced 2026-04-28 09:37:08 -04:00
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:
parent
9c04b2966d
commit
52604c49a6
1 changed files with 4 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue