Skip to content

Commit

Permalink
Merge tag 'acpica-4.2-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:
 "Additional ACPICA material for v4.2-rc1

  This will update the ACPICA code in the kernel to upstream revision
  20150619 (a bug-fix release mostly including stable-candidate fixes)
  and restore an earlier ACPICA commit that had to be reverted due to a
  regression introduced by it (the regression is addressed by
  blacklisting the only known system affected by it to date).

  The only new feature added by this update is the support for
  overriding objects in the ACPI namespace and a new ACPI table that can
  be used for that called the Override System Definition Table (OSDT).
  That should allow us to "patch" the ACPI namespace built from
  incomplete or incorrect ACPI System Definition tables (DSDT, SSDT)
  during system startup without the need to provide replacements for all
  of those tables in the future.

  Specifics:

   - Fix system resume problems related to 32-bit and 64-bit versions of
     the Firmware ACPI Control Structure (FACS) in the firmare (Lv
     Zheng)

   - Fix double initialization of the FACS (Lv Zheng)

   - Add _CLS object processing code to ACPICA (Suravee Suthikulpanit)

   - Add support for the (currently missing) new GIC version field in
     the Multiple APIC Description Table (MADT) (Hanjun Guo)

   - Add support for overriding objects in the ACPI namespace to ACPICA
     and OSDT support (Lv Zheng, Bob Moore, Zhang Rui)

   - Updates related to the TCPA and TPM2 ACPI tables (Bob Moore)

   - Restore the commit modifying _REV to always return "2" (as required
     by ACPI 6) and add a blacklisting mechanism for systems that may be
     affected by that change (Rafael J Wysocki)

   - Assorted fixes and cleanups (Bob Moore, Lv Zheng, Sascha Wildner)"

* tag 'acpica-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (28 commits)
  Revert 'Revert "ACPICA: Permanently set _REV to the value '2'."'
  ACPI / init: Make it possible to override _REV
  ACPICA: Update version to 20150619
  ACPICA: Comment update, no functional change
  ACPICA: Update TPM2 ACPI table
  ACPICA: Update definitions for the TCPA and TPM2 ACPI tables
  ACPICA: Split C library prototypes to new header
  ACPICA: De-macroize calls to standard C library functions
  ACPI / acpidump: Update acpidump manual
  ACPICA: acpidump: Convert the default behavior to dump from /sys/firmware/acpi/tables
  ACPICA: acpidump: Allow customized tables to be dumped without accessing /dev/mem
  ACPICA: Cleanup output for the ASL Debug object
  ACPICA: Update for acpi_install_table memory types
  ACPICA: Namespace: Change namespace override to avoid node deletion
  ACPICA: Namespace: Add support of OSDT table
  ACPICA: Namespace: Add support to allow overriding objects
  ACPICA: ACPI 6.0: Add values for MADT GIC version field
  ACPICA: Utilities: Add _CLS processing
  ACPICA: Add dragon_fly support to unix file mapping file
  ACPICA: EFI: Add EFI interface definitions to eliminate dependency of GNU EFI
  ...
  • Loading branch information
Linus Torvalds committed Jul 3, 2015
2 parents 7df9ab8 + ea7d521 commit 9bdc771
Show file tree
Hide file tree
Showing 91 changed files with 973 additions and 532 deletions.
6 changes: 6 additions & 0 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
acpi_os_name= [HW,ACPI] Tell ACPI BIOS the name of the OS
Format: To spoof as Windows 98: ="Microsoft Windows"

acpi_rev_override [ACPI] Override the _REV object to return 5 (instead
of 2 which is mandated by ACPI 6) as the supported ACPI
specification revision (when using this switch, it may
be necessary to carry out a cold reboot _twice_ in a
row to make it take effect on the platform firmware).

acpi_osi= [HW,ACPI] Modify list of supported OS interface strings
acpi_osi="string1" # add string1
acpi_osi="!string2" # remove string2
Expand Down
20 changes: 20 additions & 0 deletions drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,26 @@ config ACPI_PROCFS_POWER

Say N to delete power /proc/acpi/ directories that have moved to /sys/

config ACPI_REV_OVERRIDE_POSSIBLE
bool "Allow supported ACPI revision to be overriden"
depends on X86
default y
help
The platform firmware on some systems expects Linux to return "5" as
the supported ACPI revision which makes it expose system configuration
information in a special way.

For example, based on what ACPI exports as the supported revision,
Dell XPS 13 (2015) configures its audio device to either work in HDA
mode or in I2S mode, where the former is supposed to be used on Linux
until the latter is fully supported (in the kernel as well as in user
space).

This option enables a DMI-based quirk for the above Dell machine (so
that HDA audio is exposed by the platform firmware to the kernel) and
makes it possible to force the kernel to return "5" as the supported
ACPI revision via the "acpi_rev_override" command line switch.

config ACPI_EC_DEBUGFS
tristate "EC read/write access through /sys/kernel/debug/ec"
default n
Expand Down
3 changes: 3 additions & 0 deletions drivers/acpi/acpica/accommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,8 @@
#include "acglobal.h" /* All global variables */
#include "achware.h" /* Hardware defines and interfaces */
#include "acutils.h" /* Utility interfaces */
#ifndef ACPI_USE_SYSTEM_CLIBRARY
#include "acclib.h" /* C library interfaces */
#endif /* !ACPI_USE_SYSTEM_CLIBRARY */

#endif /* __ACCOMMON_H__ */
2 changes: 2 additions & 0 deletions drivers/acpi/acpica/acglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ ACPI_GLOBAL(struct acpi_table_header, acpi_gbl_original_dsdt_header);

#if (!ACPI_REDUCED_HARDWARE)
ACPI_GLOBAL(struct acpi_table_facs *, acpi_gbl_FACS);
ACPI_GLOBAL(struct acpi_table_facs *, acpi_gbl_facs32);
ACPI_GLOBAL(struct acpi_table_facs *, acpi_gbl_facs64);

#endif /* !ACPI_REDUCED_HARDWARE */

Expand Down
2 changes: 2 additions & 0 deletions drivers/acpi/acpica/acinterp.h
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,8 @@ void acpi_ex_eisa_id_to_string(char *dest, u64 compressed_id);

void acpi_ex_integer_to_string(char *dest, u64 value);

void acpi_ex_pci_cls_to_string(char *dest, u8 class_code[3]);

u8 acpi_is_valid_space_id(u8 space_id);

/*
Expand Down
1 change: 1 addition & 0 deletions drivers/acpi/acpica/aclocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ struct acpi_table_list {

#define ACPI_TABLE_INDEX_DSDT (0)
#define ACPI_TABLE_INDEX_FACS (1)
#define ACPI_TABLE_INDEX_X_FACS (2)

struct acpi_find_context {
char *search_for;
Expand Down
1 change: 1 addition & 0 deletions drivers/acpi/acpica/acnamesp.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
#define ACPI_NS_PREFIX_IS_SCOPE 0x10
#define ACPI_NS_EXTERNAL 0x20
#define ACPI_NS_TEMPORARY 0x40
#define ACPI_NS_OVERRIDE_IF_FOUND 0x80

/* Flags for acpi_ns_walk_namespace */

Expand Down
1 change: 1 addition & 0 deletions drivers/acpi/acpica/acobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ struct acpi_object_reference {
void *object; /* name_op=>HANDLE to obj, index_op=>union acpi_operand_object */
struct acpi_namespace_node *node; /* ref_of or Namepath */
union acpi_operand_object **where; /* Target of Index */
u8 *index_pointer; /* Used for Buffers and Strings */
u32 value; /* Used for Local/Arg/Index/ddb_handle */
};

Expand Down
1 change: 1 addition & 0 deletions drivers/acpi/acpica/acstruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ struct acpi_walk_state {
u8 return_used;
u8 scope_depth;
u8 pass_number; /* Parse pass during table load */
u8 namespace_override; /* Override existing objects */
u8 result_size; /* Total elements for the result stack */
u8 result_count; /* Current number of occupied elements of result stack */
u32 aml_offset;
Expand Down
64 changes: 4 additions & 60 deletions drivers/acpi/acpica/acutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,66 +205,6 @@ acpi_status acpi_ut_hardware_initialize(void);

void acpi_ut_subsystem_shutdown(void);

/*
* utclib - Local implementations of C library functions
*/
#ifndef ACPI_USE_SYSTEM_CLIBRARY

acpi_size acpi_ut_strlen(const char *string);

char *acpi_ut_strchr(const char *string, int ch);

char *acpi_ut_strcpy(char *dst_string, const char *src_string);

char *acpi_ut_strncpy(char *dst_string,
const char *src_string, acpi_size count);

int acpi_ut_memcmp(const char *buffer1, const char *buffer2, acpi_size count);

int acpi_ut_strncmp(const char *string1, const char *string2, acpi_size count);

int acpi_ut_strcmp(const char *string1, const char *string2);

char *acpi_ut_strcat(char *dst_string, const char *src_string);

char *acpi_ut_strncat(char *dst_string,
const char *src_string, acpi_size count);

u32 acpi_ut_strtoul(const char *string, char **terminator, u32 base);

char *acpi_ut_strstr(char *string1, char *string2);

void *acpi_ut_memcpy(void *dest, const void *src, acpi_size count);

void *acpi_ut_memset(void *dest, u8 value, acpi_size count);

int acpi_ut_to_upper(int c);

int acpi_ut_to_lower(int c);

extern const u8 _acpi_ctype[];

#define _ACPI_XA 0x00 /* extra alphabetic - not supported */
#define _ACPI_XS 0x40 /* extra space */
#define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */
#define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */
#define _ACPI_DI 0x04 /* '0'-'9' */
#define _ACPI_LO 0x02 /* 'a'-'z' */
#define _ACPI_PU 0x10 /* punctuation */
#define _ACPI_SP 0x08 /* space, tab, CR, LF, VT, FF */
#define _ACPI_UP 0x01 /* 'A'-'Z' */
#define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */

#define ACPI_IS_DIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI))
#define ACPI_IS_SPACE(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP))
#define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD))
#define ACPI_IS_UPPER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP))
#define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO))
#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU))
#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))

#endif /* !ACPI_USE_SYSTEM_CLIBRARY */

#define ACPI_IS_ASCII(c) ((c) < 0x80)

/*
Expand Down Expand Up @@ -430,6 +370,10 @@ acpi_status
acpi_ut_execute_CID(struct acpi_namespace_node *device_node,
struct acpi_pnp_device_id_list ** return_cid_list);

acpi_status
acpi_ut_execute_CLS(struct acpi_namespace_node *device_node,
struct acpi_pnp_device_id **return_id);

/*
* utlock - reader/writer locks
*/
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/dsfield.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ acpi_ds_create_field(union acpi_parse_object *op,
}
}

ACPI_MEMSET(&info, 0, sizeof(struct acpi_create_field_info));
memset(&info, 0, sizeof(struct acpi_create_field_info));

/* Second arg is the field flags */

Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/dsinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ acpi_ds_initialize_objects(u32 table_index,

/* Set all init info to zero */

ACPI_MEMSET(&info, 0, sizeof(struct acpi_init_walk_info));
memset(&info, 0, sizeof(struct acpi_init_walk_info));

info.owner_id = owner_id;
info.table_index = table_index;
Expand Down
7 changes: 3 additions & 4 deletions drivers/acpi/acpica/dsobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ acpi_ds_build_internal_buffer_obj(struct acpi_walk_state *walk_state,
/* Initialize buffer from the byte_list (if present) */

if (byte_list) {
ACPI_MEMCPY(obj_desc->buffer.pointer,
byte_list->named.data, byte_list_length);
memcpy(obj_desc->buffer.pointer, byte_list->named.data,
byte_list_length);
}
}

Expand Down Expand Up @@ -750,8 +750,7 @@ acpi_ds_init_object_from_op(struct acpi_walk_state *walk_state,
case ACPI_TYPE_STRING:

obj_desc->string.pointer = op->common.value.string;
obj_desc->string.length =
(u32) ACPI_STRLEN(op->common.value.string);
obj_desc->string.length = (u32)strlen(op->common.value.string);

/*
* The string is contained in the ACPI table, don't ever try
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/acpica/dsutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,8 @@ acpi_ds_create_operand(struct acpi_walk_state *walk_state,
obj_desc =
acpi_ut_create_string_object((acpi_size) name_length);

ACPI_STRNCPY(obj_desc->string.pointer,
name_string, name_length);
strncpy(obj_desc->string.pointer,
name_string, name_length);
status = AE_OK;
} else {
/*
Expand Down
17 changes: 13 additions & 4 deletions drivers/acpi/acpica/dswload.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,19 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
flags = ACPI_NS_NO_UPSEARCH;
if ((walk_state->opcode != AML_SCOPE_OP) &&
(!(walk_state->parse_flags & ACPI_PARSE_DEFERRED_OP))) {
flags |= ACPI_NS_ERROR_IF_FOUND;
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"[%s] Cannot already exist\n",
acpi_ut_get_type_name(object_type)));
if (walk_state->namespace_override) {
flags |= ACPI_NS_OVERRIDE_IF_FOUND;
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"[%s] Override allowed\n",
acpi_ut_get_type_name
(object_type)));
} else {
flags |= ACPI_NS_ERROR_IF_FOUND;
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"[%s] Cannot already exist\n",
acpi_ut_get_type_name
(object_type)));
}
} else {
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
"[%s] Both Find or Create allowed\n",
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/evgpeinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ acpi_ev_match_gpe_method(acpi_handle obj_handle,

/* 4) The last two characters of the name are the hex GPE Number */

gpe_number = ACPI_STRTOUL(&name[2], NULL, 16);
gpe_number = strtoul(&name[2], NULL, 16);
if (gpe_number == ACPI_UINT32_MAX) {

/* Conversion failed; invalid method, just ignore it */
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/exconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
return_ACPI_STATUS(AE_NO_MEMORY);
}

ACPI_MEMCPY(table, table_header, length);
memcpy(table, table_header, length);
break;

default:
Expand Down
9 changes: 4 additions & 5 deletions drivers/acpi/acpica/exconvrt.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,8 @@ acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc,
/* Copy the integer to the buffer, LSB first */

new_buf = return_desc->buffer.pointer;
ACPI_MEMCPY(new_buf,
&obj_desc->integer.value,
acpi_gbl_integer_byte_width);
memcpy(new_buf,
&obj_desc->integer.value, acpi_gbl_integer_byte_width);
break;

case ACPI_TYPE_STRING:
Expand All @@ -252,8 +251,8 @@ acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc,
/* Copy the string to the buffer */

new_buf = return_desc->buffer.pointer;
ACPI_STRNCPY((char *)new_buf, (char *)obj_desc->string.pointer,
obj_desc->string.length);
strncpy((char *)new_buf, (char *)obj_desc->string.pointer,
obj_desc->string.length);
break;

default:
Expand Down
42 changes: 40 additions & 2 deletions drivers/acpi/acpica/exdebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
{
u32 i;
u32 timer;
union acpi_operand_object *object_desc;
u32 value;

ACPI_FUNCTION_TRACE_PTR(ex_do_debug_object, source_desc);

Expand Down Expand Up @@ -254,8 +256,44 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
object)->object,
level + 4, 0);
} else {
acpi_ex_do_debug_object(source_desc->reference.
object, level + 4, 0);
object_desc = source_desc->reference.object;
value = source_desc->reference.value;

switch (object_desc->common.type) {
case ACPI_TYPE_BUFFER:

acpi_os_printf("Buffer[%u] = 0x%2.2X\n",
value,
*source_desc->reference.
index_pointer);
break;

case ACPI_TYPE_STRING:

acpi_os_printf
("String[%u] = \"%c\" (0x%2.2X)\n",
value,
*source_desc->reference.
index_pointer,
*source_desc->reference.
index_pointer);
break;

case ACPI_TYPE_PACKAGE:

acpi_os_printf("Package[%u] = ", value);
acpi_ex_do_debug_object(*source_desc->
reference.where,
level + 4, 0);
break;

default:

acpi_os_printf
("Unknown Reference object type %X\n",
object_desc->common.type);
break;
}
}
}
break;
Expand Down
9 changes: 5 additions & 4 deletions drivers/acpi/acpica/exdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,16 @@ static struct acpi_exdump_info acpi_ex_dump_index_field[5] = {
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(index_field.data_obj), "Data Object"}
};

static struct acpi_exdump_info acpi_ex_dump_reference[8] = {
static struct acpi_exdump_info acpi_ex_dump_reference[9] = {
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_reference), NULL},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(reference.class), "Class"},
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET(reference.target_type), "Target Type"},
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET(reference.value), "Value"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.object), "Object Desc"},
{ACPI_EXD_NODE, ACPI_EXD_OFFSET(reference.node), "Node"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.where), "Where"},
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET(reference.index_pointer),
"Index Pointer"},
{ACPI_EXD_REFERENCE, 0, NULL}
};

Expand Down Expand Up @@ -1005,14 +1007,13 @@ static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc)
} else if (obj_desc->reference.object) {
if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) ==
ACPI_DESC_TYPE_OPERAND) {
acpi_os_printf(" Target: %p",
acpi_os_printf("%22s %p", "Target :",
obj_desc->reference.object);
if (obj_desc->reference.class == ACPI_REFCLASS_TABLE) {
acpi_os_printf(" Table Index: %X\n",
obj_desc->reference.value);
} else {
acpi_os_printf(" Target: %p [%s]\n",
obj_desc->reference.object,
acpi_os_printf(" [%s]\n",
acpi_ut_get_type_name(((union
acpi_operand_object
*)
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/exfield.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
}

buffer = buffer_desc->buffer.pointer;
ACPI_MEMCPY(buffer, source_desc->buffer.pointer, length);
memcpy(buffer, source_desc->buffer.pointer, length);

/* Lock entire transaction if requested */

Expand Down
Loading

0 comments on commit 9bdc771

Please sign in to comment.