diff options
author | njl <njl@FreeBSD.org> | 2004-08-17 18:36:07 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2004-08-17 18:36:07 +0000 |
commit | 494133eeee0d46d7cd7dcd3df49b57fc74f1123b (patch) | |
tree | b71ba4f77ee76cc43d62960d12b3854b2a27b292 /sys | |
parent | 3eac0b71ccf07c90d2f72843cd2ce2e4712c440f (diff) | |
download | FreeBSD-src-494133eeee0d46d7cd7dcd3df49b57fc74f1123b.zip FreeBSD-src-494133eeee0d46d7cd7dcd3df49b57fc74f1123b.tar.gz |
Fix a deadlock on boot for some systems where reading the battery status
also generates a notify. Since we held the lock over this call, the
notify never got to run and the battery status read never returned.
Document this also.
Tested by: Maxim Maximov <mcsi_at_mcsi.pp.ru>
Approved by: re (scottl)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/acpica/acpi_cmbat.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/acpica/acpi_cmbat.c b/sys/dev/acpica/acpi_cmbat.c index e849346..90f46a4 100644 --- a/sys/dev/acpica/acpi_cmbat.c +++ b/sys/dev/acpica/acpi_cmbat.c @@ -274,7 +274,12 @@ acpi_cmbat_notify_handler(ACPI_HANDLE h, UINT32 notify, void *context) acpi_UserNotify("CMBAT", h, notify); - ACPI_SERIAL_BEGIN(cmbat); + /* + * Clear the appropriate last updated time. The next call to retrieve + * the battery status will get the new value for us. We don't need to + * acquire a lock since we are only clearing the time stamp and since + * calling _BST/_BIF can trigger a notify, we could deadlock also. + */ switch (notify) { case ACPI_NOTIFY_DEVICE_CHECK: case ACPI_BATTERY_BST_CHANGE: @@ -287,7 +292,6 @@ acpi_cmbat_notify_handler(ACPI_HANDLE h, UINT32 notify, void *context) default: break; } - ACPI_SERIAL_END(cmbat); } static int |