Skip to content

Commit

Permalink
Merge tag 'acpica-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/git/rafael/linux-pm

Pull ACPICA updates from Rafael Wysocki:
 "This updates the kernel's ACPICA code to upstream revision 20150410
  and adds a fix for a GPE handling regression introduced during the
  3.19 cycle on top of that.

  Included are two stable-candidate bug fixes (one of them fixing a 3.16
  regression), multiple other fixes and a bunch of cleanups.

  Specifics:

   - Fix for a GPE handling regression on Dell Latitude D600 that caused
     GPE signaling to stop working on that machine, which appears to be
     due to a hardware glitch, but it used to work and it can be made
     work again in a relativly straightforward way (Rafael J Wysocki).

   - Fix for a mutex unlock regression related to the handling of ACPI
     tables introduced during the 3.16 development cycle (Octavian
     Purdila).

   - _REV modification to always return 2 which has been done by all
     versions of Windows since NT and the firmware people started to use
     it to distinguish between OSes in their AML and do some silly and
     wrong things on that basis (Bob Moore).

   - Fixes and cleanups related to the acpi_physicall_address data type
     including one stable-candidate fix for an issue occasionally
     occuring on 64-bit machines running 32-bit kernels where using
     offsets provided by the firmware may lead to address overflows (Lv
     Zheng).

   - External() opcode support infrastructure needed for recompiling
     disassembled ACPI tables in some cases including interpreter
     modification to ignore that opcode (Bob Moore).

   - Support for the "Windows 2015" string in _OSI (Bob Moore).

   - GPE debug interface change to return values read from hardware
     registers (Lv Zheng).

   - Removal of the __DATE__ macro usage in tools (Rasmus Villemoes).

   - Assorted minor fixes and cleanups (Lv Zheng, Rickard Strandqvist,
     Bob Moore)"

* tag 'acpica-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (32 commits)
  ACPICA: Store GPE register enable masks upfront
  ACPICA: Update version to 20150410.
  ACPICA: Fix a couple issues with the local printf module.
  ACPICA: Disassembler: Some cleanup of the table dump module.
  ACPICA: iASL: Add support for MSDM ACPI table.
  ACPICA: Update for SLIC ACPI table.
  ACPICA: Add "//" before ascii output of buffers.
  ACPICA: Remove unused internal AML opcode.
  ACPICA: Permanently set _REV to the value '2'.
  ACPICA: Add "Windows 2015" string to _OSI support.
  ACPICA: Add infrastructure for External() opcode.
  ACPICA: iASL: Enhancement for constant folding.
  ACPICA: iASL/Disassembler: Add option to assume table contains valid AML.
  ACPICA: Update AML Debugger global variables.
  ACPICA: Update Resource descriptor dump module.
  ACPICA: Fix a sscanf format string.
  ACPICA: Casting changes around acpi_physical_address/acpi_size.
  ACPICA: Resources: Correct conditional compilation definitions.
  ACPICA: Utilities: Correct conditional compilation definitions.
  ACPICA: Tables: Move an iasl specific table function to iasl source file.
  ...
  • Loading branch information
Linus Torvalds committed Apr 17, 2015
2 parents 54e514b + 0ee0d34 commit 0f5abd4
Show file tree
Hide file tree
Showing 43 changed files with 391 additions and 420 deletions.
8 changes: 4 additions & 4 deletions drivers/acpi/acpica/acapps.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@
/* Macros for signons and file headers */

#define ACPI_COMMON_SIGNON(utility_name) \
"\n%s\n%s version %8.8X%s [%s]\n%s\n\n", \
"\n%s\n%s version %8.8X%s\n%s\n\n", \
ACPICA_NAME, \
utility_name, ((u32) ACPI_CA_VERSION), ACPI_WIDTH, __DATE__, \
utility_name, ((u32) ACPI_CA_VERSION), ACPI_WIDTH, \
ACPICA_COPYRIGHT

#define ACPI_COMMON_HEADER(utility_name, prefix) \
"%s%s\n%s%s version %8.8X%s [%s]\n%s%s\n%s\n", \
"%s%s\n%s%s version %8.8X%s\n%s%s\n%s\n", \
prefix, ACPICA_NAME, \
prefix, utility_name, ((u32) ACPI_CA_VERSION), ACPI_WIDTH, __DATE__, \
prefix, utility_name, ((u32) ACPI_CA_VERSION), ACPI_WIDTH, \
prefix, ACPICA_COPYRIGHT, \
prefix

Expand Down
5 changes: 2 additions & 3 deletions drivers/acpi/acpica/acglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_db_output_flags, ACPI_DB_CONSOLE_OUTPUT);
ACPI_INIT_GLOBAL(u8, acpi_gbl_no_resource_disassembly, FALSE);
ACPI_INIT_GLOBAL(u8, acpi_gbl_ignore_noop_operator, FALSE);
ACPI_INIT_GLOBAL(u8, acpi_gbl_cstyle_disassembly, TRUE);
ACPI_INIT_GLOBAL(u8, acpi_gbl_force_aml_disassembly, FALSE);

ACPI_GLOBAL(u8, acpi_gbl_db_opt_disasm);
ACPI_GLOBAL(u8, acpi_gbl_db_opt_verbose);
Expand All @@ -321,9 +322,7 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_db_terminate_threads, FALSE);
ACPI_INIT_GLOBAL(u8, acpi_gbl_abort_method, FALSE);
ACPI_INIT_GLOBAL(u8, acpi_gbl_method_executing, FALSE);

ACPI_GLOBAL(u8, acpi_gbl_db_opt_tables);
ACPI_GLOBAL(u8, acpi_gbl_db_opt_stats);
ACPI_GLOBAL(u8, acpi_gbl_db_opt_ini_methods);
ACPI_GLOBAL(u8, acpi_gbl_db_opt_no_ini_methods);
ACPI_GLOBAL(u8, acpi_gbl_db_opt_no_region_support);
ACPI_GLOBAL(u8, acpi_gbl_db_output_to_file);
ACPI_GLOBAL(char *, acpi_gbl_db_buffer);
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/aclocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ typedef u32 acpi_mutex_handle;

/* Total number of aml opcodes defined */

#define AML_NUM_OPCODES 0x81
#define AML_NUM_OPCODES 0x82

/* Forward declarations */

Expand Down
13 changes: 1 addition & 12 deletions drivers/acpi/acpica/acmacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,12 @@
#define ACPI_SET64(ptr, val) (*ACPI_CAST64 (ptr) = (u64) (val))

/*
* printf() format helpers. These macros are workarounds for the difficulties
* printf() format helper. This macros is a workaround for the difficulties
* with emitting 64-bit integers and 64-bit pointers with the same code
* for both 32-bit and 64-bit hosts.
*/
#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i), ACPI_LODWORD(i)

#if ACPI_MACHINE_WIDTH == 64
#define ACPI_FORMAT_NATIVE_UINT(i) ACPI_FORMAT_UINT64(i)
#define ACPI_FORMAT_TO_UINT(i) ACPI_FORMAT_UINT64(i)
#define ACPI_PRINTF_UINT "0x%8.8X%8.8X"

#else
#define ACPI_FORMAT_NATIVE_UINT(i) 0, (u32) (i)
#define ACPI_FORMAT_TO_UINT(i) (u32) (i)
#define ACPI_PRINTF_UINT "0x%8.8X"
#endif

/*
* Macros for moving data around to/from buffers that are possibly unaligned.
* If the hardware supports the transfer of unaligned data, just do the store.
Expand Down
2 changes: 2 additions & 0 deletions drivers/acpi/acpica/acopcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
#define ARGP_DWORD_OP ARGP_LIST1 (ARGP_DWORDDATA)
#define ARGP_ELSE_OP ARGP_LIST2 (ARGP_PKGLENGTH, ARGP_TERMLIST)
#define ARGP_EVENT_OP ARGP_LIST1 (ARGP_NAME)
#define ARGP_EXTERNAL_OP ARGP_LIST3 (ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_BYTEDATA)
#define ARGP_FATAL_OP ARGP_LIST3 (ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_TERMARG)
#define ARGP_FIELD_OP ARGP_LIST4 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_FIELDLIST)
#define ARGP_FIND_SET_LEFT_BIT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
Expand Down Expand Up @@ -243,6 +244,7 @@
#define ARGI_DWORD_OP ARGI_INVALID_OPCODE
#define ARGI_ELSE_OP ARGI_INVALID_OPCODE
#define ARGI_EVENT_OP ARGI_INVALID_OPCODE
#define ARGI_EXTERNAL_OP ARGI_LIST3 (ARGI_STRING, ARGI_INTEGER, ARGI_INTEGER)
#define ARGI_FATAL_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER)
#define ARGI_FIELD_OP ARGI_INVALID_OPCODE
#define ARGI_FIND_SET_LEFT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
Expand Down
6 changes: 4 additions & 2 deletions drivers/acpi/acpica/acresrc.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,13 @@ acpi_rs_set_resource_length(acpi_rsdesc_size total_length,
union aml_resource *aml);

/*
* rsdump
* rsdump - Debugger support
*/
#ifdef ACPI_DEBUGGER
void acpi_rs_dump_resource_list(struct acpi_resource *resource);

void acpi_rs_dump_irq_list(u8 * route_table);
void acpi_rs_dump_irq_list(u8 *route_table);
#endif

/*
* Resource conversion tables
Expand Down
5 changes: 0 additions & 5 deletions drivers/acpi/acpica/acstruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@
#define ACPI_WALK_METHOD 0x01
#define ACPI_WALK_METHOD_RESTART 0x02

/* Flags for iASL compiler only */

#define ACPI_WALK_CONST_REQUIRED 0x10
#define ACPI_WALK_CONST_OPTIONAL 0x20

struct acpi_walk_state {
struct acpi_walk_state *next; /* Next walk_state in list */
u8 descriptor_type; /* To differentiate various internal objs */
Expand Down
9 changes: 3 additions & 6 deletions drivers/acpi/acpica/actables.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ u8 *acpi_tb_scan_memory_for_rsdp(u8 *start_address, u32 length);
/*
* tbdata - table data structure management
*/
acpi_status acpi_tb_get_next_root_index(u32 *table_index);
acpi_status
acpi_tb_get_next_table_descriptor(u32 *table_index,
struct acpi_table_desc **table_desc);

void
acpi_tb_init_table_descriptor(struct acpi_table_desc *table_desc,
Expand Down Expand Up @@ -119,11 +121,6 @@ acpi_tb_install_standard_table(acpi_physical_address address,
u8 flags,
u8 reload, u8 override, u32 *table_index);

acpi_status
acpi_tb_store_table(acpi_physical_address address,
struct acpi_table_header *table,
u32 length, u8 flags, u32 *table_index);

void acpi_tb_uninstall_table(struct acpi_table_desc *table_desc);

void acpi_tb_terminate(void);
Expand Down
22 changes: 12 additions & 10 deletions drivers/acpi/acpica/acutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -502,16 +502,18 @@ const union acpi_predefined_info *acpi_ut_get_next_predefined_method(const union

const union acpi_predefined_info *acpi_ut_match_predefined_method(char *name);

void acpi_ut_get_expected_return_types(char *buffer, u32 expected_btypes);

#if (defined ACPI_ASL_COMPILER || defined ACPI_HELP_APP)
const union acpi_predefined_info *acpi_ut_match_resource_name(char *name);

void
acpi_ut_display_predefined_method(char *buffer,
const union acpi_predefined_info *this_name,
u8 multi_line);

void acpi_ut_get_expected_return_types(char *buffer, u32 expected_btypes);

u32 acpi_ut_get_resource_bit_width(char *buffer, u16 types);
#endif

/*
* utstate - Generic state creation/cache routines
Expand Down Expand Up @@ -539,14 +541,6 @@ acpi_ut_create_update_state_and_push(union acpi_operand_object *object,
u16 action,
union acpi_generic_state **state_list);

#ifdef ACPI_FUTURE_USAGE
acpi_status
acpi_ut_create_pkg_state_and_push(void *internal_object,
void *external_object,
u16 index,
union acpi_generic_state **state_list);
#endif /* ACPI_FUTURE_USAGE */

union acpi_generic_state *acpi_ut_create_control_state(void);

void acpi_ut_delete_generic_state(union acpi_generic_state *state);
Expand All @@ -570,7 +564,9 @@ const struct acpi_exception_info *acpi_ut_validate_exception(acpi_status

u8 acpi_ut_is_pci_root_bridge(char *id);

#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP)
u8 acpi_ut_is_aml_table(struct acpi_table_header *table);
#endif

acpi_status
acpi_ut_walk_package_tree(union acpi_operand_object *source_object,
Expand Down Expand Up @@ -629,15 +625,19 @@ acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc, u8 **end_tag);
*/
void acpi_ut_strupr(char *src_string);

#ifdef ACPI_ASL_COMPILER
void acpi_ut_strlwr(char *src_string);

int acpi_ut_stricmp(char *string1, char *string2);
#endif

acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer);

void acpi_ut_print_string(char *string, u16 max_length);

#if defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP
void ut_convert_backslashes(char *pathname);
#endif

u8 acpi_ut_valid_acpi_name(char *name);

Expand Down Expand Up @@ -785,6 +785,8 @@ int acpi_ut_file_printf(ACPI_FILE file, const char *format, ...);
/*
* utuuid -- UUID support functions
*/
#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_HELP_APP)
void acpi_ut_convert_string_to_uuid(char *in_string, u8 *uuid_buffer);
#endif

#endif /* _ACUTILS_H */
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/amlcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
#define AML_PACKAGE_OP (u16) 0x12
#define AML_VAR_PACKAGE_OP (u16) 0x13 /* ACPI 2.0 */
#define AML_METHOD_OP (u16) 0x14
#define AML_EXTERNAL_OP (u16) 0x15 /* ACPI 6.0 */
#define AML_DUAL_NAME_PREFIX (u16) 0x2e
#define AML_MULTI_NAME_PREFIX_OP (u16) 0x2f
#define AML_NAME_CHAR_SUBSEQ (u16) 0x30
Expand Down Expand Up @@ -206,7 +207,6 @@
#define AML_INT_RESERVEDFIELD_OP (u16) 0x0031
#define AML_INT_ACCESSFIELD_OP (u16) 0x0032
#define AML_INT_BYTELIST_OP (u16) 0x0033
#define AML_INT_STATICSTRING_OP (u16) 0x0034
#define AML_INT_METHODCALL_OP (u16) 0x0035
#define AML_INT_RETURN_VALUE_OP (u16) 0x0036
#define AML_INT_EVAL_SUBTREE_OP (u16) 0x0037
Expand Down
7 changes: 3 additions & 4 deletions drivers/acpi/acpica/dsopcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,

ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
obj_desc,
ACPI_FORMAT_NATIVE_UINT(obj_desc->region.address),
ACPI_FORMAT_UINT64(obj_desc->region.address),
obj_desc->region.length));

/* Now the address and length are valid for this opregion */
Expand Down Expand Up @@ -539,13 +539,12 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,
return_ACPI_STATUS(AE_NOT_EXIST);
}

obj_desc->region.address =
(acpi_physical_address) ACPI_TO_INTEGER(table);
obj_desc->region.address = ACPI_PTR_TO_PHYSADDR(table);
obj_desc->region.length = table->length;

ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
obj_desc,
ACPI_FORMAT_NATIVE_UINT(obj_desc->region.address),
ACPI_FORMAT_UINT64(obj_desc->region.address),
obj_desc->region.length));

/* Now the address and length are valid for this opregion */
Expand Down
11 changes: 11 additions & 0 deletions drivers/acpi/acpica/dsutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,17 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
acpi_operand_object,
acpi_gbl_root_node);
status = AE_OK;
} else if (parent_op->common.aml_opcode ==
AML_EXTERNAL_OP) {

/* TBD: May only be temporary */

obj_desc =
acpi_ut_create_string_object((acpi_size) name_length);

ACPI_STRNCPY(obj_desc->string.pointer,
name_string, name_length);
status = AE_OK;
} else {
/*
* We just plain didn't find it -- which is a
Expand Down
5 changes: 3 additions & 2 deletions drivers/acpi/acpica/evgpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ acpi_ev_update_gpe_enable_mask(struct acpi_gpe_event_info *gpe_event_info)
ACPI_SET_BIT(gpe_register_info->enable_for_run,
(u8)register_bit);
}
gpe_register_info->enable_mask = gpe_register_info->enable_for_run;

return_ACPI_STATUS(AE_OK);
}
Expand Down Expand Up @@ -123,7 +124,7 @@ acpi_status acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info)

/* Enable the requested GPE */

status = acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_ENABLE_SAVE);
status = acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_ENABLE);
return_ACPI_STATUS(status);
}

Expand Down Expand Up @@ -202,7 +203,7 @@ acpi_ev_remove_gpe_reference(struct acpi_gpe_event_info *gpe_event_info)
if (ACPI_SUCCESS(status)) {
status =
acpi_hw_low_set_gpe(gpe_event_info,
ACPI_GPE_DISABLE_SAVE);
ACPI_GPE_DISABLE);
}

if (ACPI_FAILURE(status)) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/evregion.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,
"Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
&region_obj->region.handler->address_space, handler,
ACPI_FORMAT_NATIVE_UINT(address),
ACPI_FORMAT_UINT64(address),
acpi_ut_get_region_name(region_obj->region.
space_id)));

Expand Down
5 changes: 3 additions & 2 deletions drivers/acpi/acpica/evxfevnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status)
}

if (in_byte) {
local_event_status |= ACPI_EVENT_FLAG_ENABLED;
local_event_status |=
(ACPI_EVENT_FLAG_ENABLED | ACPI_EVENT_FLAG_ENABLE_SET);
}

/* Fixed event currently active? */
Expand All @@ -369,7 +370,7 @@ acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status)
}

if (in_byte) {
local_event_status |= ACPI_EVENT_FLAG_SET;
local_event_status |= ACPI_EVENT_FLAG_STATUS_SET;
}

(*event_status) = local_event_status;
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/acpica/exdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,8 +767,8 @@ void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
acpi_os_printf("\n");
} else {
acpi_os_printf(" base %8.8X%8.8X Length %X\n",
ACPI_FORMAT_NATIVE_UINT(obj_desc->region.
address),
ACPI_FORMAT_UINT64(obj_desc->region.
address),
obj_desc->region.length);
}
break;
Expand Down
10 changes: 4 additions & 6 deletions drivers/acpi/acpica/exfldio.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,17 +263,15 @@ acpi_ex_access_region(union acpi_operand_object *obj_desc,
}

ACPI_DEBUG_PRINT_RAW((ACPI_DB_BFIELD,
" Region [%s:%X], Width %X, ByteBase %X, Offset %X at %p\n",
" Region [%s:%X], Width %X, ByteBase %X, Offset %X at %8.8X%8.8X\n",
acpi_ut_get_region_name(rgn_desc->region.
space_id),
rgn_desc->region.space_id,
obj_desc->common_field.access_byte_width,
obj_desc->common_field.base_byte_offset,
field_datum_byte_offset, ACPI_CAST_PTR(void,
(rgn_desc->
region.
address +
region_offset))));
field_datum_byte_offset,
ACPI_FORMAT_UINT64(rgn_desc->region.address +
region_offset)));

/* Invoke the appropriate address_space/op_region handler */

Expand Down
13 changes: 12 additions & 1 deletion drivers/acpi/acpica/exoparg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,18 @@ acpi_status acpi_ex_opcode_3A_0T_0R(struct acpi_walk_state *walk_state)
/* Might return while OS is shutting down, just continue */

ACPI_FREE(fatal);
break;
goto cleanup;

case AML_EXTERNAL_OP:
/*
* If the interpreter sees this opcode, just ignore it. The External
* op is intended for use by disassemblers in order to properly
* disassemble control method invocations. The opcode or group of
* opcodes should be surrounded by an "if (0)" clause to ensure that
* AML interpreters never see the opcode.
*/
status = AE_OK;
goto cleanup;

default:

Expand Down
Loading

0 comments on commit 0f5abd4

Please sign in to comment.