Skip to content

Commit

Permalink
ACPICA: Update error/debug messages for fixed events
Browse files Browse the repository at this point in the history
Add the actual fixed event name to all messages for clarity.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Bob Moore authored and Rafael J. Wysocki committed Mar 11, 2013
1 parent 3cf2449 commit d4d3219
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
12 changes: 7 additions & 5 deletions drivers/acpi/acpica/evevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ u32 acpi_ev_fixed_event_detect(void)
*
* DESCRIPTION: Clears the status bit for the requested event, calls the
* handler that previously registered for the event.
* NOTE: If there is no handler for the event, the event is
* disabled to prevent futher interrupts.
*
******************************************************************************/

Expand All @@ -271,17 +273,17 @@ static u32 acpi_ev_fixed_event_dispatch(u32 event)
status_register_id, ACPI_CLEAR_STATUS);

/*
* Make sure we've got a handler. If not, report an error. The event is
* disabled to prevent further interrupts.
* Make sure that a handler exists. If not, report an error
* and disable the event to prevent further interrupts.
*/
if (NULL == acpi_gbl_fixed_event_handlers[event].handler) {
if (!acpi_gbl_fixed_event_handlers[event].handler) {
(void)acpi_write_bit_register(acpi_gbl_fixed_event_info[event].
enable_register_id,
ACPI_DISABLE_EVENT);

ACPI_ERROR((AE_INFO,
"No installed handler for fixed event [0x%08X]",
event));
"No installed handler for fixed event - %s (%u), disabling",
acpi_ut_get_event_name(event), event));

return (ACPI_INTERRUPT_NOT_HANDLED);
}
Expand Down
21 changes: 12 additions & 9 deletions drivers/acpi/acpica/evxface.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,9 @@ acpi_install_fixed_event_handler(u32 event,
return_ACPI_STATUS(status);
}

/* Don't allow two handlers. */
/* Do not allow multiple handlers */

if (NULL != acpi_gbl_fixed_event_handlers[event].handler) {
if (acpi_gbl_fixed_event_handlers[event].handler) {
status = AE_ALREADY_EXISTS;
goto cleanup;
}
Expand All @@ -483,16 +483,18 @@ acpi_install_fixed_event_handler(u32 event,
if (ACPI_SUCCESS(status))
status = acpi_enable_event(event, 0);
if (ACPI_FAILURE(status)) {
ACPI_WARNING((AE_INFO, "Could not enable fixed event 0x%X",
event));
ACPI_WARNING((AE_INFO,
"Could not enable fixed event - %s (%u)",
acpi_ut_get_event_name(event), event));

/* Remove the handler */

acpi_gbl_fixed_event_handlers[event].handler = NULL;
acpi_gbl_fixed_event_handlers[event].context = NULL;
} else {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Enabled fixed event %X, Handler=%p\n", event,
"Enabled fixed event %s (%X), Handler=%p\n",
acpi_ut_get_event_name(event), event,
handler));
}

Expand Down Expand Up @@ -544,11 +546,12 @@ acpi_remove_fixed_event_handler(u32 event, acpi_event_handler handler)

if (ACPI_FAILURE(status)) {
ACPI_WARNING((AE_INFO,
"Could not write to fixed event enable register 0x%X",
event));
"Could not disable fixed event - %s (%u)",
acpi_ut_get_event_name(event), event));
} else {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Disabled fixed event %X\n",
event));
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Disabled fixed event - %s (%X)\n",
acpi_ut_get_event_name(event), event));
}

(void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
Expand Down

0 comments on commit d4d3219

Please sign in to comment.