Skip to content

Commit

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

Pull ACPI updates from Rafael Wysocki:
 "These update the ACPICA code in the kernel to upstream revision
  20190703, fix up the handling of GPEs in ACPICA, allow some more ACPI
  code to be built on ARM64 platforms, allow BGRT to be overridden, fix
  minor issues and clean up assorted pieces of ACPI code.

  Specifics:

   - Update the ACPICA code in the kernel to upstream revision 20190703
     including:
       - Initial/default namespace creation simplification (Bob Moore).
       - Object initialization sequence update (Bob Moore).
       - Removal of legacy module-level (dead) code (Erik Schmauss).
       - Table load object initialization update (Erik Schmauss,
         Nikolaus Voss).

   - Fix GPE enabling issue in ACPICA causing premature wakeups from
     suspend-to-idle to occur (Rafael Wysocki).

   - Allow ACPI AC and battery drivers to be built on non-X86 (Ard
     Biesheuvel).

   - Fix address space handler removal in the ACPI PMIC driver for Intel
     platforms (Andy Shevchenko).

   - Allow BGRT to be overridden via initrd or configfs (Andrea
     Oliveri).

   - Fix object resolution on table loads via configfs (Nikolaus Voss).

   - Clean up assorted pieces of ACPI code and tools (Colin Ian King,
     Liguang Zhang, Masahiro Yamada).

   - Fix documentation build warning, convert the extcon document to
     ReST and add it to the ACPI documentation (Mauro Carvalho Chehab,
     Qian Cai)"

* tag 'acpi-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI / APEI: Remove needless __ghes_check_estatus() calls
  ACPICA: Update version to 20190703
  ACPICA: Update table load object initialization
  ACPICA: Update for object initialization sequence
  ACPICA: remove legacy module-level code due to deprecation
  ACPICA: Namespace: simplify creation of the initial/default namespace
  ACPI / PMIC: intel: Drop double removal of address space handler
  ACPI: APD: remove redundant assignment to pointer clk
  docs: extcon: convert it to ReST and move to ACPI dir
  ACPI: Make AC and battery drivers available on !X86
  ACPICA: Clear status of GPEs on first direct enable
  ACPI: configfs: Resolve objects on host-directed table loads
  ACPI: tables: Allow BGRT to be overridden
  ACPI: OSL: Make a W=1 kernel-doc warning go away
  ACPI: tools: Exclude tools/* from .gitignore patterns
  • Loading branch information
Linus Torvalds committed Jul 9, 2019
2 parents cf2d213 + 64372c0 commit 4b47045
Show file tree
Hide file tree
Showing 31 changed files with 131 additions and 337 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
=====================================================
Intel INT3496 ACPI device extcon driver documentation
-----------------------------------------------------
=====================================================

The Intel INT3496 ACPI device extcon driver is a driver for ACPI
devices with an acpi-id of INT3496, such as found for example on
Expand All @@ -13,15 +14,20 @@ between an USB host and an USB peripheral controller.
The ACPI devices exposes this functionality by returning an array with up
to 3 gpio descriptors from its ACPI _CRS (Current Resource Settings) call:

Index 0: The input gpio for the id-pin, this is always present and valid
Index 1: The output gpio for enabling Vbus output from the device to the otg
======= =====================================================================
Index 0 The input gpio for the id-pin, this is always present and valid
Index 1 The output gpio for enabling Vbus output from the device to the otg
port, write 1 to enable the Vbus output (this gpio descriptor may
be absent or invalid)
Index 2: The output gpio for muxing of the data pins between the USB host and
Index 2 The output gpio for muxing of the data pins between the USB host and
the USB peripheral controller, write 1 to mux to the peripheral
controller
======= =====================================================================

There is a mapping between indices and GPIO connection IDs as follows

======= =======
id index 0
vbus index 1
mux index 2
======= =======
1 change: 1 addition & 0 deletions Documentation/firmware-guide/acpi/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ ACPI Support
acpi-lid
lpit
video_extension
extcon-intel-int3496
6 changes: 3 additions & 3 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ F: drivers/pnp/pnpacpi/
F: include/linux/acpi.h
F: include/linux/fwnode.h
F: include/acpi/
F: Documentation/acpi/
F: Documentation/firmware-guide/acpi/
F: Documentation/ABI/testing/sysfs-bus-acpi
F: Documentation/ABI/testing/configfs-acpi
F: drivers/pci/*acpi*
Expand Down Expand Up @@ -4893,7 +4893,7 @@ S: Maintained
F: Documentation/
F: scripts/kernel-doc
X: Documentation/ABI/
X: Documentation/acpi/
X: Documentation/firmware-guide/acpi/
X: Documentation/devicetree/
X: Documentation/i2c/
X: Documentation/media/
Expand Down Expand Up @@ -6069,7 +6069,7 @@ S: Maintained
F: drivers/extcon/
F: include/linux/extcon/
F: include/linux/extcon.h
F: Documentation/extcon/
F: Documentation/firmware-guide/acpi/extcon-intel-int3496.rst
F: Documentation/devicetree/bindings/extcon/

EXYNOS DP DRIVER
Expand Down
2 changes: 0 additions & 2 deletions drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ config ACPI_EC_DEBUGFS

config ACPI_AC
tristate "AC Adapter"
depends on X86
select POWER_SUPPLY
default y
help
Expand All @@ -168,7 +167,6 @@ config ACPI_AC

config ACPI_BATTERY
tristate "Battery"
depends on X86
select POWER_SUPPLY
default y
help
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpi_apd.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ struct apd_private_data {
static int acpi_apd_setup(struct apd_private_data *pdata)
{
const struct apd_device_desc *dev_desc = pdata->dev_desc;
struct clk *clk = ERR_PTR(-ENODEV);
struct clk *clk;

if (dev_desc->fixed_clk_rate) {
clk = clk_register_fixed_rate(&pdata->adev->dev,
Expand Down
6 changes: 1 addition & 5 deletions drivers/acpi/acpi_configfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ static ssize_t acpi_table_aml_write(struct config_item *cfg,
if (!table->header)
return -ENOMEM;

ACPI_INFO(("Host-directed Dynamic ACPI Table Load:"));
ret = acpi_tb_install_and_load_table(
ACPI_PTR_TO_PHYSADDR(table->header),
ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, FALSE,
&table->index);
ret = acpi_load_table(table->header);
if (ret) {
kfree(table->header);
table->header = NULL;
Expand Down
3 changes: 2 additions & 1 deletion drivers/acpi/acpica/acevents.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ acpi_status
acpi_ev_mask_gpe(struct acpi_gpe_event_info *gpe_event_info, u8 is_masked);

acpi_status
acpi_ev_add_gpe_reference(struct acpi_gpe_event_info *gpe_event_info);
acpi_ev_add_gpe_reference(struct acpi_gpe_event_info *gpe_event_info,
u8 clear_on_enable);

acpi_status
acpi_ev_remove_gpe_reference(struct acpi_gpe_event_info *gpe_event_info);
Expand Down
1 change: 0 additions & 1 deletion drivers/acpi/acpica/acglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ ACPI_GLOBAL(u8, acpi_gbl_verbose_leak_dump);
ACPI_GLOBAL(struct acpi_namespace_node, acpi_gbl_root_node_struct);
ACPI_GLOBAL(struct acpi_namespace_node *, acpi_gbl_root_node);
ACPI_GLOBAL(struct acpi_namespace_node *, acpi_gbl_fadt_gpe_device);
ACPI_GLOBAL(union acpi_operand_object *, acpi_gbl_module_code_list);

extern const u8 acpi_gbl_ns_properties[ACPI_NUM_NS_TYPES];
extern const struct acpi_predefined_names
Expand Down
2 changes: 0 additions & 2 deletions drivers/acpi/acpica/acnamesp.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,6 @@ acpi_ns_dump_object_paths(acpi_object_type type,
*/
acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info);

void acpi_ns_exec_module_code_list(void);

/*
* nsarguments - Argument count/type checking for predefined/reserved names
*/
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 @@ -202,7 +202,7 @@ acpi_ds_initialize_objects(u32 table_index,

if (ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_DSDT)) {
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
"\nInitializing Namespace objects:\n"));
"\nACPI table initialization:\n"));
}

/* Summary of objects initialized */
Expand Down
8 changes: 7 additions & 1 deletion drivers/acpi/acpica/evgpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ acpi_ev_mask_gpe(struct acpi_gpe_event_info *gpe_event_info, u8 is_masked)
* FUNCTION: acpi_ev_add_gpe_reference
*
* PARAMETERS: gpe_event_info - Add a reference to this GPE
* clear_on_enable - Clear GPE status before enabling it
*
* RETURN: Status
*
Expand All @@ -155,7 +156,8 @@ acpi_ev_mask_gpe(struct acpi_gpe_event_info *gpe_event_info, u8 is_masked)
******************************************************************************/

acpi_status
acpi_ev_add_gpe_reference(struct acpi_gpe_event_info *gpe_event_info)
acpi_ev_add_gpe_reference(struct acpi_gpe_event_info *gpe_event_info,
u8 clear_on_enable)
{
acpi_status status = AE_OK;

Expand All @@ -170,6 +172,10 @@ acpi_ev_add_gpe_reference(struct acpi_gpe_event_info *gpe_event_info)

/* Enable on first reference */

if (clear_on_enable) {
(void)acpi_hw_clear_gpe(gpe_event_info);
}

status = acpi_ev_update_gpe_enable_mask(gpe_event_info);
if (ACPI_SUCCESS(status)) {
status = acpi_ev_enable_gpe(gpe_event_info);
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/evgpeblk.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
continue;
}

status = acpi_ev_add_gpe_reference(gpe_event_info);
status = acpi_ev_add_gpe_reference(gpe_event_info, FALSE);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status,
"Could not enable GPE 0x%02X",
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/evxface.c
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ acpi_remove_gpe_handler(acpi_handle gpe_device,
ACPI_GPE_DISPATCH_METHOD) ||
(ACPI_GPE_DISPATCH_TYPE(handler->original_flags) ==
ACPI_GPE_DISPATCH_NOTIFY)) && handler->originally_enabled) {
(void)acpi_ev_add_gpe_reference(gpe_event_info);
(void)acpi_ev_add_gpe_reference(gpe_event_info, FALSE);
if (ACPI_GPE_IS_POLLING_NEEDED(gpe_event_info)) {

/* Poll edge triggered GPEs to handle existing events */
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/evxfgpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number)
if (gpe_event_info) {
if (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) !=
ACPI_GPE_DISPATCH_NONE) {
status = acpi_ev_add_gpe_reference(gpe_event_info);
status = acpi_ev_add_gpe_reference(gpe_event_info, TRUE);
if (ACPI_SUCCESS(status) &&
ACPI_GPE_IS_POLLING_NEEDED(gpe_event_info)) {

Expand Down
16 changes: 6 additions & 10 deletions drivers/acpi/acpica/exconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,9 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state,
return_ACPI_STATUS(status);
}

/* Complete the initialization/resolution of package objects */
/* Complete the initialization/resolution of new objects */

status = acpi_ns_walk_namespace(ACPI_TYPE_PACKAGE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, 0,
acpi_ns_init_one_package, NULL, NULL,
NULL);
acpi_ns_initialize_objects();

/* Parameter Data (optional) */

Expand Down Expand Up @@ -437,12 +434,11 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
return_ACPI_STATUS(status);
}

/* Complete the initialization/resolution of package objects */
/* Complete the initialization/resolution of new objects */

status = acpi_ns_walk_namespace(ACPI_TYPE_PACKAGE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, 0,
acpi_ns_init_one_package, NULL, NULL,
NULL);
acpi_ex_exit_interpreter();
acpi_ns_initialize_objects();
acpi_ex_enter_interpreter();

/* Store the ddb_handle into the Target operand */

Expand Down
54 changes: 43 additions & 11 deletions drivers/acpi/acpica/nsaccess.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ acpi_status acpi_ns_root_initialize(void)
acpi_status status;
const struct acpi_predefined_names *init_val = NULL;
struct acpi_namespace_node *new_node;
struct acpi_namespace_node *prev_node = NULL;
union acpi_operand_object *obj_desc;
acpi_string val = NULL;

Expand All @@ -61,12 +62,28 @@ acpi_status acpi_ns_root_initialize(void)
*/
acpi_gbl_root_node = &acpi_gbl_root_node_struct;

/* Enter the pre-defined names in the name table */
/* Enter the predefined names in the name table */

ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Entering predefined entries into namespace\n"));

/*
* Create the initial (default) namespace.
* This namespace looks like something similar to this:
*
* ACPI Namespace (from Namespace Root):
* 0 _GPE Scope 00203160 00
* 0 _PR_ Scope 002031D0 00
* 0 _SB_ Device 00203240 00 Notify Object: 0020ADD8
* 0 _SI_ Scope 002032B0 00
* 0 _TZ_ Device 00203320 00
* 0 _REV Integer 00203390 00 = 0000000000000002
* 0 _OS_ String 00203488 00 Len 14 "Microsoft Windows NT"
* 0 _GL_ Mutex 00203580 00 Object 002035F0
* 0 _OSI Method 00203678 00 Args 1 Len 0000 Aml 00000000
*/
for (init_val = acpi_gbl_pre_defined_names; init_val->name; init_val++) {
status = AE_OK;

/* _OSI is optional for now, will be permanent later */

Expand All @@ -75,17 +92,32 @@ acpi_status acpi_ns_root_initialize(void)
continue;
}

status =
acpi_ns_lookup(NULL, ACPI_CAST_PTR(char, init_val->name),
init_val->type, ACPI_IMODE_LOAD_PASS2,
ACPI_NS_NO_UPSEARCH, NULL, &new_node);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status,
"Could not create predefined name %s",
init_val->name));
continue;
/*
* Create, init, and link the new predefined name
* Note: No need to use acpi_ns_lookup here because all the
* predefined names are at the root level. It is much easier to
* just create and link the new node(s) here.
*/
new_node =
ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_namespace_node));
if (!new_node) {
status = AE_NO_MEMORY;
goto unlock_and_exit;
}

ACPI_COPY_NAMESEG(new_node->name.ascii, init_val->name);
new_node->descriptor_type = ACPI_DESC_TYPE_NAMED;
new_node->type = init_val->type;

if (!prev_node) {
acpi_gbl_root_node_struct.child = new_node;
} else {
prev_node->peer = new_node;
}

new_node->parent = &acpi_gbl_root_node_struct;
prev_node = new_node;

/*
* Name entered successfully. If entry in pre_defined_names[] specifies
* an initial value, create the initial value.
Expand Down Expand Up @@ -131,7 +163,7 @@ acpi_status acpi_ns_root_initialize(void)

new_node->value = obj_desc->method.param_count;
#else
/* Mark this as a very SPECIAL method */
/* Mark this as a very SPECIAL method (_OSI) */

obj_desc->method.info_flags =
ACPI_METHOD_INTERNAL_ONLY;
Expand Down
Loading

0 comments on commit 4b47045

Please sign in to comment.