Skip to content

Commit

Permalink
Merge branch 'acpica'
Browse files Browse the repository at this point in the history
* acpica:
  MAINTAINERS / ACPICA: Add ACPICA information to MAINTAINERS
  ACPICA: Update version to 20130823.
  ACPICA: SCI Handlers: Update handler interface, eliminate unnecessary argument.
  ACPICA: Cleanup exception codes.
  ACPICA: Tables: Cleanup RSDP signature codes.
  ACPICA: Tables: Cleanup table checksum verification code.
  ACPICA: Debugger: Add new command to display full namespace pathnames.
  ACPICA: Operation region support: Never free the handler "context" pointer.
  ACPICA: Add support for host-installed SCI handlers.
  ACPICA: Validate start object for acpi_walk_namespace.
  ACPICA: Debugger: Prevent possible command line buffer overflow, kernel behavior is not affected.
  ACPICA: Linux-specific header: enable "aarch64" 64-bit build.
  ACPICA: Debug output: small formatting update, no functional change.
  ACPICA: acpi_read: On error, do not modify the return value target location.
  ACPICA: Improve error message for "too many parent prefixes" condition.
  • Loading branch information
rafaeljw committed Oct 28, 2013
2 parents 31c466c + 3774929 commit 9183ea6
Show file tree
Hide file tree
Showing 24 changed files with 479 additions and 72 deletions.
14 changes: 14 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,20 @@ F: drivers/pci/*acpi*
F: drivers/pci/*/*acpi*
F: drivers/pci/*/*/*acpi*

ACPI COMPONENT ARCHITECTURE (ACPICA)
M: Robert Moore <[email protected]>
M: Lv Zheng <[email protected]>
M: Rafael J. Wysocki <[email protected]>
L: [email protected]
L: [email protected]
W: https://acpica.org/
W: https://github.com/acpica/acpica/
Q: https://patchwork.kernel.org/project/linux-acpi/list/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
S: Supported
F: drivers/acpi/acpica/
F: include/acpi/

ACPI FAN DRIVER
M: Zhang Rui <[email protected]>
L: [email protected]
Expand Down
5 changes: 4 additions & 1 deletion drivers/acpi/acpica/acdebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,12 @@ void acpi_db_display_handlers(void);
ACPI_HW_DEPENDENT_RETURN_VOID(void
acpi_db_generate_gpe(char *gpe_arg,
char *block_arg))
ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_db_generate_sci(void))

/*
* dbconvert - miscellaneous conversion routines
*/
acpi_status acpi_db_hex_char_to_value(int hex_char, u8 *return_value);
acpi_status acpi_db_hex_char_to_value(int hex_char, u8 *return_value);

acpi_status acpi_db_convert_to_package(char *string, union acpi_object *object);

Expand Down Expand Up @@ -154,6 +155,8 @@ void acpi_db_set_scope(char *name);

void acpi_db_dump_namespace(char *start_arg, char *depth_arg);

void acpi_db_dump_namespace_paths(void);

void acpi_db_dump_namespace_by_owner(char *owner_arg, char *depth_arg);

acpi_status acpi_db_find_name_in_namespace(char *name_arg);
Expand Down
6 changes: 3 additions & 3 deletions drivers/acpi/acpica/acevents.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,11 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
*/
u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context);

u32 acpi_ev_install_sci_handler(void);
u32 acpi_ev_sci_dispatch(void);

acpi_status acpi_ev_remove_sci_handler(void);
u32 acpi_ev_install_sci_handler(void);

u32 acpi_ev_initialize_SCI(u32 program_SCI);
acpi_status acpi_ev_remove_all_sci_handlers(void);

ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_ev_terminate(void))
#endif /* __ACEVENTS_H__ */
18 changes: 11 additions & 7 deletions drivers/acpi/acpica/acglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ ACPI_EXTERN acpi_table_handler acpi_gbl_table_handler;
ACPI_EXTERN void *acpi_gbl_table_handler_context;
ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk;
ACPI_EXTERN acpi_interface_handler acpi_gbl_interface_handler;
ACPI_EXTERN struct acpi_sci_handler_info *acpi_gbl_sci_handler_list;

/* Owner ID support */

Expand Down Expand Up @@ -445,20 +446,23 @@ ACPI_EXTERN u8 acpi_gbl_db_opt_tables;
ACPI_EXTERN u8 acpi_gbl_db_opt_stats;
ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods;
ACPI_EXTERN u8 acpi_gbl_db_opt_no_region_support;

ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS];
ACPI_EXTERN acpi_object_type acpi_gbl_db_arg_types[ACPI_DEBUGGER_MAX_ARGS];
ACPI_EXTERN char acpi_gbl_db_line_buf[ACPI_DB_LINE_BUFFER_SIZE];
ACPI_EXTERN char acpi_gbl_db_parsed_buf[ACPI_DB_LINE_BUFFER_SIZE];
ACPI_EXTERN char acpi_gbl_db_scope_buf[80];
ACPI_EXTERN char acpi_gbl_db_debug_filename[80];
ACPI_EXTERN u8 acpi_gbl_db_output_to_file;
ACPI_EXTERN char *acpi_gbl_db_buffer;
ACPI_EXTERN char *acpi_gbl_db_filename;
ACPI_EXTERN u32 acpi_gbl_db_debug_level;
ACPI_EXTERN u32 acpi_gbl_db_console_debug_level;
ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_db_scope_node;

ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS];
ACPI_EXTERN acpi_object_type acpi_gbl_db_arg_types[ACPI_DEBUGGER_MAX_ARGS];

/* These buffers should all be the same size */

ACPI_EXTERN char acpi_gbl_db_line_buf[ACPI_DB_LINE_BUFFER_SIZE];
ACPI_EXTERN char acpi_gbl_db_parsed_buf[ACPI_DB_LINE_BUFFER_SIZE];
ACPI_EXTERN char acpi_gbl_db_scope_buf[ACPI_DB_LINE_BUFFER_SIZE];
ACPI_EXTERN char acpi_gbl_db_debug_filename[ACPI_DB_LINE_BUFFER_SIZE];

/*
* Statistic globals
*/
Expand Down
8 changes: 8 additions & 0 deletions drivers/acpi/acpica/aclocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,14 @@ struct acpi_simple_repair_info {
*
****************************************************************************/

/* Dispatch info for each host-installed SCI handler */

struct acpi_sci_handler_info {
struct acpi_sci_handler_info *next;
acpi_sci_handler address; /* Address of handler */
void *context; /* Context to be passed to handler */
};

/* Dispatch info for each GPE -- either a method or handler, cannot be both */

struct acpi_gpe_handler_info {
Expand Down
6 changes: 6 additions & 0 deletions drivers/acpi/acpica/acnamesp.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,12 @@ acpi_ns_dump_objects(acpi_object_type type,
u8 display_type,
u32 max_depth,
acpi_owner_id owner_id, acpi_handle start_handle);

void
acpi_ns_dump_object_paths(acpi_object_type type,
u8 display_type,
u32 max_depth,
acpi_owner_id owner_id, acpi_handle start_handle);
#endif /* ACPI_FUTURE_USAGE */

/*
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/evgpeutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
*
* FUNCTION: acpi_ev_get_gpe_xrupt_block
*
* PARAMETERS: interrupt_number - Interrupt for a GPE block
* PARAMETERS: interrupt_number - Interrupt for a GPE block
*
* RETURN: A GPE interrupt block
*
Expand Down
14 changes: 7 additions & 7 deletions drivers/acpi/acpica/evmisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,6 @@ void acpi_ev_terminate(void)

status = acpi_ev_walk_gpe_list(acpi_hw_disable_gpe_block, NULL);

/* Remove SCI handler */

status = acpi_ev_remove_sci_handler();
if (ACPI_FAILURE(status)) {
ACPI_ERROR((AE_INFO, "Could not remove SCI handler"));
}

status = acpi_ev_remove_global_lock_handler();
if (ACPI_FAILURE(status)) {
ACPI_ERROR((AE_INFO,
Expand All @@ -280,6 +273,13 @@ void acpi_ev_terminate(void)
acpi_gbl_events_initialized = FALSE;
}

/* Remove SCI handlers */

status = acpi_ev_remove_all_sci_handlers();
if (ACPI_FAILURE(status)) {
ACPI_ERROR((AE_INFO, "Could not remove SCI handler"));
}

/* Deallocate all handler objects installed within GPE info structs */

status = acpi_ev_walk_gpe_list(acpi_ev_delete_gpe_handlers, NULL);
Expand Down
23 changes: 13 additions & 10 deletions drivers/acpi/acpica/evregion.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,16 +217,11 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
if (!(region_obj->region.flags & AOPOBJ_SETUP_COMPLETE)) {
region_obj->region.flags |= AOPOBJ_SETUP_COMPLETE;

if (region_obj2->extra.region_context) {

/* The handler for this region was already installed */

ACPI_FREE(region_context);
} else {
/*
* Save the returned context for use in all accesses to
* this particular region
*/
/*
* Save the returned context for use in all accesses to
* the handler for this particular region
*/
if (!(region_obj2->extra.region_context)) {
region_obj2->extra.region_context =
region_context;
}
Expand Down Expand Up @@ -402,6 +397,14 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj,
handler_obj->address_space.
context, region_context);

/*
* region_context should have been released by the deactivate
* operation. We don't need access to it anymore here.
*/
if (region_context) {
*region_context = NULL;
}

/* Init routine may fail, Just ignore errors */

if (ACPI_FAILURE(status)) {
Expand Down
78 changes: 71 additions & 7 deletions drivers/acpi/acpica/evsci.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,50 @@ ACPI_MODULE_NAME("evsci")
/* Local prototypes */
static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context);

/*******************************************************************************
*
* FUNCTION: acpi_ev_sci_dispatch
*
* PARAMETERS: None
*
* RETURN: Status code indicates whether interrupt was handled.
*
* DESCRIPTION: Dispatch the SCI to all host-installed SCI handlers.
*
******************************************************************************/

u32 acpi_ev_sci_dispatch(void)
{
struct acpi_sci_handler_info *sci_handler;
acpi_cpu_flags flags;
u32 int_status = ACPI_INTERRUPT_NOT_HANDLED;

ACPI_FUNCTION_NAME(ev_sci_dispatch);

/* Are there any host-installed SCI handlers? */

if (!acpi_gbl_sci_handler_list) {
return (int_status);
}

flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);

/* Invoke all host-installed SCI handlers */

sci_handler = acpi_gbl_sci_handler_list;
while (sci_handler) {

/* Invoke the installed handler (at interrupt level) */

int_status |= sci_handler->address(sci_handler->context);

sci_handler = sci_handler->next;
}

acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
return (int_status);
}

/*******************************************************************************
*
* FUNCTION: acpi_ev_sci_xrupt_handler
Expand Down Expand Up @@ -89,6 +133,10 @@ static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context)
*/
interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list);

/* Invoke all host-installed SCI handlers */

interrupt_handled |= acpi_ev_sci_dispatch();

return_UINT32(interrupt_handled);
}

Expand All @@ -112,14 +160,13 @@ u32 ACPI_SYSTEM_XFACE acpi_ev_gpe_xrupt_handler(void *context)
ACPI_FUNCTION_TRACE(ev_gpe_xrupt_handler);

/*
* We are guaranteed by the ACPI CA initialization/shutdown code that
* We are guaranteed by the ACPICA initialization/shutdown code that
* if this interrupt handler is installed, ACPI is enabled.
*/

/* GPEs: Check for and dispatch any GPEs that have occurred */

interrupt_handled |= acpi_ev_gpe_detect(gpe_xrupt_list);

return_UINT32(interrupt_handled);
}

Expand Down Expand Up @@ -150,15 +197,15 @@ u32 acpi_ev_install_sci_handler(void)

/******************************************************************************
*
* FUNCTION: acpi_ev_remove_sci_handler
* FUNCTION: acpi_ev_remove_all_sci_handlers
*
* PARAMETERS: none
*
* RETURN: E_OK if handler uninstalled OK, E_ERROR if handler was not
* RETURN: AE_OK if handler uninstalled, AE_ERROR if handler was not
* installed to begin with
*
* DESCRIPTION: Remove the SCI interrupt handler. No further SCIs will be
* taken.
* taken. Remove all host-installed SCI handlers.
*
* Note: It doesn't seem important to disable all events or set the event
* enable registers to their original values. The OS should disable
Expand All @@ -167,18 +214,35 @@ u32 acpi_ev_install_sci_handler(void)
*
******************************************************************************/

acpi_status acpi_ev_remove_sci_handler(void)
acpi_status acpi_ev_remove_all_sci_handlers(void)
{
struct acpi_sci_handler_info *sci_handler;
acpi_cpu_flags flags;
acpi_status status;

ACPI_FUNCTION_TRACE(ev_remove_sci_handler);
ACPI_FUNCTION_TRACE(ev_remove_all_sci_handlers);

/* Just let the OS remove the handler and disable the level */

status =
acpi_os_remove_interrupt_handler((u32) acpi_gbl_FADT.sci_interrupt,
acpi_ev_sci_xrupt_handler);

if (!acpi_gbl_sci_handler_list) {
return (status);
}

flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);

/* Free all host-installed SCI handlers */

while (acpi_gbl_sci_handler_list) {
sci_handler = acpi_gbl_sci_handler_list;
acpi_gbl_sci_handler_list = sci_handler->next;
ACPI_FREE(sci_handler);
}

acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
return_ACPI_STATUS(status);
}

Expand Down
Loading

0 comments on commit 9183ea6

Please sign in to comment.