diff options
author | Bob Moore <robert.moore@intel.com> | 2006-06-08 16:29:00 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-06-14 02:45:47 -0400 |
commit | 4c90ece249992c7a2e3fc921e5cdb8eb92193067 (patch) | |
tree | e145ffe472802ef870ba1eaea150b688c19e45ca /drivers/acpi/hardware | |
parent | 4119532c95547821dbe72d6916dfa1b2148475b3 (diff) | |
download | talos-op-linux-4c90ece249992c7a2e3fc921e5cdb8eb92193067.tar.gz talos-op-linux-4c90ece249992c7a2e3fc921e5cdb8eb92193067.zip |
ACPI: ACPICA 20060608
Converted the locking mutex used for the ACPI hardware
to a spinlock. This change should eliminate all problems
caused by attempting to acquire a semaphore at interrupt
level, and it means that all ACPICA external interfaces
that directly access the ACPI hardware can be safely
called from interrupt level.
Fixed a regression introduced in 20060526 where the ACPI
device initialization could be prematurely aborted with
an AE_NOT_FOUND if a device did not have an optional
_INI method.
Fixed an IndexField issue where a write to the Data
Register should be limited in size to the AccessSize
(width) of the IndexField itself. (BZ 433, Fiodor Suietov)
Fixed problem reports (Valery Podrezov) integrated: - Allow
store of ThermalZone objects to Debug object.
http://bugzilla.kernel.org/show_bug.cgi?id=5369
http://bugzilla.kernel.org/show_bug.cgi?id=5370
Fixed problem reports (Fiodor Suietov) integrated: -
acpi_get_table_header() doesn't handle multiple instances
correctly (BZ 364)
Removed four global mutexes that were obsolete and were
no longer being used.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/hardware')
-rw-r--r-- | drivers/acpi/hardware/hwregs.c | 59 |
1 files changed, 19 insertions, 40 deletions
diff --git a/drivers/acpi/hardware/hwregs.c b/drivers/acpi/hardware/hwregs.c index 5a3aa8dd8cb7..ae142de19507 100644 --- a/drivers/acpi/hardware/hwregs.c +++ b/drivers/acpi/hardware/hwregs.c @@ -61,10 +61,13 @@ ACPI_MODULE_NAME("hwregs") * DESCRIPTION: Clears all fixed and general purpose status bits * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED * + * NOTE: TBD: Flags parameter is obsolete, to be removed + * ******************************************************************************/ acpi_status acpi_hw_clear_acpi_status(u32 flags) { acpi_status status; + acpi_cpu_flags lock_flags = 0; ACPI_FUNCTION_TRACE(hw_clear_acpi_status); @@ -72,12 +75,7 @@ acpi_status acpi_hw_clear_acpi_status(u32 flags) ACPI_BITMASK_ALL_FIXED_STATUS, (u16) acpi_gbl_FADT->xpm1a_evt_blk.address)); - if (flags & ACPI_MTX_LOCK) { - status = acpi_ut_acquire_mutex(ACPI_MTX_HARDWARE); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - } + lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); status = acpi_hw_register_write(ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_STATUS, @@ -102,9 +100,7 @@ acpi_status acpi_hw_clear_acpi_status(u32 flags) status = acpi_ev_walk_gpe_list(acpi_hw_clear_gpe_block); unlock_and_exit: - if (flags & ACPI_MTX_LOCK) { - (void)acpi_ut_release_mutex(ACPI_MTX_HARDWARE); - } + acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags); return_ACPI_STATUS(status); } @@ -264,6 +260,8 @@ struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id) * * DESCRIPTION: ACPI bit_register read function. * + * NOTE: TBD: Flags parameter is obsolete, to be removed + * ******************************************************************************/ acpi_status acpi_get_register(u32 register_id, u32 * return_value, u32 flags) @@ -281,23 +279,12 @@ acpi_status acpi_get_register(u32 register_id, u32 * return_value, u32 flags) return_ACPI_STATUS(AE_BAD_PARAMETER); } - if (flags & ACPI_MTX_LOCK) { - status = acpi_ut_acquire_mutex(ACPI_MTX_HARDWARE); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - } - /* Read from the register */ - status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, + status = acpi_hw_register_read(ACPI_MTX_LOCK, bit_reg_info->parent_register, ®ister_value); - if (flags & ACPI_MTX_LOCK) { - (void)acpi_ut_release_mutex(ACPI_MTX_HARDWARE); - } - if (ACPI_SUCCESS(status)) { /* Normalize the value that was read */ @@ -331,12 +318,15 @@ ACPI_EXPORT_SYMBOL(acpi_get_register) * * DESCRIPTION: ACPI Bit Register write function. * + * NOTE: TBD: Flags parameter is obsolete, to be removed + * ******************************************************************************/ acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags) { u32 register_value = 0; struct acpi_bit_register_info *bit_reg_info; acpi_status status; + acpi_cpu_flags lock_flags; ACPI_FUNCTION_TRACE_U32(acpi_set_register, register_id); @@ -349,12 +339,7 @@ acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags) return_ACPI_STATUS(AE_BAD_PARAMETER); } - if (flags & ACPI_MTX_LOCK) { - status = acpi_ut_acquire_mutex(ACPI_MTX_HARDWARE); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - } + lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); /* Always do a register read first so we can insert the new bits */ @@ -462,9 +447,7 @@ acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags) unlock_and_exit: - if (flags & ACPI_MTX_LOCK) { - (void)acpi_ut_release_mutex(ACPI_MTX_HARDWARE); - } + acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags); /* Normalize the value that was read */ @@ -500,14 +483,12 @@ acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) u32 value1 = 0; u32 value2 = 0; acpi_status status; + acpi_cpu_flags lock_flags = 0; ACPI_FUNCTION_TRACE(hw_register_read); if (ACPI_MTX_LOCK == use_lock) { - status = acpi_ut_acquire_mutex(ACPI_MTX_HARDWARE); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } + lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); } switch (register_id) { @@ -585,7 +566,7 @@ acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) unlock_and_exit: if (ACPI_MTX_LOCK == use_lock) { - (void)acpi_ut_release_mutex(ACPI_MTX_HARDWARE); + acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags); } if (ACPI_SUCCESS(status)) { @@ -613,14 +594,12 @@ acpi_hw_register_read(u8 use_lock, u32 register_id, u32 * return_value) acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value) { acpi_status status; + acpi_cpu_flags lock_flags = 0; ACPI_FUNCTION_TRACE(hw_register_write); if (ACPI_MTX_LOCK == use_lock) { - status = acpi_ut_acquire_mutex(ACPI_MTX_HARDWARE); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } + lock_flags = acpi_os_acquire_lock(acpi_gbl_hardware_lock); } switch (register_id) { @@ -710,7 +689,7 @@ acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value) unlock_and_exit: if (ACPI_MTX_LOCK == use_lock) { - (void)acpi_ut_release_mutex(ACPI_MTX_HARDWARE); + acpi_os_release_lock(acpi_gbl_hardware_lock, lock_flags); } return_ACPI_STATUS(status); |