]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
AcpiAcquireGlobalLock() can sometimes sleep if the mutex is contested.
authorNate Lawson <njl@FreeBSD.org>
Sat, 2 Jun 2007 19:21:40 +0000 (19:21 +0000)
committerNate Lawson <njl@FreeBSD.org>
Sat, 2 Jun 2007 19:21:40 +0000 (19:21 +0000)
commit35440dd3e92e214da7a1ceef46c8021b0f8d916a
treedaa0853e0ceddab48782ebf16e6bf45a87924925
parent3a787f042c4ae870c95f247b6acb5d08d33c71c0
AcpiAcquireGlobalLock() can sometimes sleep if the mutex is contested.
The global lock is a memory region shared with the BIOS and thus
has some strange behavior like the fact that the sleep is 1 ms max.
We use standard mutexes to synchronize with the SCI so acquiring
the global lock after locking the mutex resulted in a witness
warning.

To deal with this for now, acquire the global lock before all other
locks, similar to Giant.  This should fix the witness "sleeping
with mutex held" issue on boot that occurred after the last ACPI-CA
import.  In the future, we hope to move to the new mutex interface
in ACPI-CA instead of the pseudo-semaphore version we have now.

Reviewed by:    jkim
sys/dev/acpica/acpi_ec.c