diff options
| author | Julian Elischer <julian@FreeBSD.org> | 2007-11-14 05:43:55 +0000 |
|---|---|---|
| committer | Julian Elischer <julian@FreeBSD.org> | 2007-11-14 05:43:55 +0000 |
| commit | 502e39a873f50184ad7e891a909940f301809e88 (patch) | |
| tree | d3ccd8ab6082d9786b177544c5cda4a467c013ac | |
| parent | df4706e2ccc46754e9da725fcc07b72c65e6f384 (diff) | |
Notes
| -rw-r--r-- | sys/i386/bios/apm.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/i386/bios/apm.c b/sys/i386/bios/apm.c index 30a24b5362af..894d1351622b 100644 --- a/sys/i386/bios/apm.c +++ b/sys/i386/bios/apm.c @@ -485,7 +485,13 @@ apm_do_suspend(void) apm_op_inprog = 0; sc->suspends = sc->suspend_countdown = 0; + /* + * Be sure to hold Giant across DEVICE_SUSPEND/RESUME since + * non-MPSAFE drivers need this. + */ + mtx_lock(&Giant); error = DEVICE_SUSPEND(root_bus); + mtx_unlock(&Giant); if (error) return; @@ -496,7 +502,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); } return; } @@ -602,7 +610,9 @@ apm_resume(void) sc->suspending = 0; apm_execute_hook(hook[APM_HOOK_RESUME]); + mtx_lock(&Giant); DEVICE_RESUME(root_bus); + mtx_unlock(&Giant); return; } |
