Skip to content

Commit

Permalink
Merge tag 'acpi-5.7-rc1-2' 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 more ACPI updates from Rafael Wysocki:
 "Additional ACPI updates.

  These update the ACPICA code in the kernel to the 20200326 upstream
  revision, fix an ACPI-related CPU hotplug deadlock on x86, update
  Intel Tiger Lake device IDs in some places, add a new ACPI backlight
  blacklist entry, update the "acpi_backlight" kernel command line
  switch documentation and clean up a CPPC library routine.

  Specifics:

   - Update the ACPICA code in the kernel to upstream revision 20200326
     including:
      * Fix for a typo in a comment field (Bob Moore)
      * acpiExec namespace init file fixes (Bob Moore)
      * Addition of NHLT to the known tables list (Cezary Rojewski)
      * Conversion of PlatformCommChannel ASL keyword to PCC (Erik
        Kaneda)
      * acpiexec cleanup (Erik Kaneda)
      * WSMT-related typo fix (Erik Kaneda)
      * sprintf() utility function fix (John Levon)
      * IVRS IVHD type 11h parsing implementation (Michał Żygowski)
      * IVRS IVHD type 10h reserved field name fix (Michał Żygowski)

   - Fix ACPI-related CPU hotplug deadlock on x86 (Qian Cai)

   - Fix Intel Tiger Lake ACPI device IDs in several places (Gayatri
     Kammela)

   - Add ACPI backlight blacklist entry for Acer Aspire 5783z (Hans de
     Goede)

   - Fix documentation of the "acpi_backlight" kernel command line
     switch (Randy Dunlap)

   - Clean up the acpi_get_psd_map() CPPC library routine (Liguang
     Zhang)"

* tag 'acpi-5.7-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  x86: ACPI: fix CPU hotplug deadlock
  thermal: int340x_thermal: fix: Update Tiger Lake ACPI device IDs
  platform/x86: intel-hid: fix: Update Tiger Lake ACPI device ID
  ACPI: Update Tiger Lake ACPI device IDs
  ACPI: video: Use native backlight on Acer Aspire 5783z
  ACPI: video: Docs update for "acpi_backlight" kernel parameter options
  ACPICA: Update version 20200326
  ACPICA: Fixes for acpiExec namespace init file
  ACPICA: Add NHLT table signature
  ACPICA: WSMT: Fix typo, no functional change
  ACPICA: utilities: fix sprintf()
  ACPICA: acpiexec: remove redeclaration of acpi_gbl_db_opt_no_region_support
  ACPICA: Change PlatformCommChannel ASL keyword to PCC
  ACPICA: Fix IVRS IVHD type 10h reserved field name
  ACPICA: Implement IVRS IVHD type 11h parsing
  ACPICA: Fix a typo in a comment field
  ACPI: CPPC: clean up acpi_get_psd_map()
  • Loading branch information
torvalds committed Apr 6, 2020
2 parents ef05db1 + 33ae7f7 commit 7e63420
Show file tree
Hide file tree
Showing 27 changed files with 155 additions and 77 deletions.
8 changes: 5 additions & 3 deletions Documentation/admin-guide/kernel-parameters.txt
Expand Up @@ -22,11 +22,13 @@
default: 0

acpi_backlight= [HW,ACPI]
acpi_backlight=vendor
acpi_backlight=video
If set to vendor, prefer vendor specific driver
{ vendor | video | native | none }
If set to vendor, prefer vendor-specific driver
(e.g. thinkpad_acpi, sony_acpi, etc.) instead
of the ACPI video.ko driver.
If set to video, use the ACPI video.ko driver.
If set to native, use the device's native backlight mode.
If set to none, disable the ACPI backlight interface.

acpi_force_32bit_fadt_addr
force FADT to use 32 bit addresses rather than the
Expand Down
3 changes: 2 additions & 1 deletion arch/x86/kernel/acpi/cstate.c
Expand Up @@ -161,7 +161,8 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu,

/* Make sure we are running on right CPU */

retval = work_on_cpu(cpu, acpi_processor_ffh_cstate_probe_cpu, cx);
retval = call_on_cpu(cpu, acpi_processor_ffh_cstate_probe_cpu, cx,
false);
if (retval == 0) {
/* Use the hint in CST */
percpu_entry->states[cx->index].eax = cx->address;
Expand Down
2 changes: 2 additions & 0 deletions drivers/acpi/acpica/acnamesp.h
Expand Up @@ -256,6 +256,8 @@ u32
acpi_ns_build_normalized_path(struct acpi_namespace_node *node,
char *full_path, u32 path_size, u8 no_trailing);

void acpi_ns_normalize_pathname(char *original_path);

char *acpi_ns_get_normalized_pathname(struct acpi_namespace_node *node,
u8 no_trailing);

Expand Down
16 changes: 7 additions & 9 deletions drivers/acpi/acpica/dbinput.c
Expand Up @@ -468,16 +468,14 @@ char *acpi_db_get_next_token(char *string,
return (NULL);
}

/* Remove any spaces at the beginning */
/* Remove any spaces at the beginning, ignore blank lines */

if (*string == ' ') {
while (*string && (*string == ' ')) {
string++;
}
while (*string && isspace(*string)) {
string++;
}

if (!(*string)) {
return (NULL);
}
if (!(*string)) {
return (NULL);
}

switch (*string) {
Expand Down Expand Up @@ -570,7 +568,7 @@ char *acpi_db_get_next_token(char *string,

/* Find end of token */

while (*string && (*string != ' ')) {
while (*string && !isspace(*string)) {
string++;
}
break;
Expand Down
1 change: 1 addition & 0 deletions drivers/acpi/acpica/dbxface.c
Expand Up @@ -409,6 +409,7 @@ acpi_status acpi_initialize_debugger(void)
acpi_gbl_db_output_flags = ACPI_DB_CONSOLE_OUTPUT;

acpi_gbl_db_opt_no_ini_methods = FALSE;
acpi_gbl_db_opt_no_region_support = FALSE;

acpi_gbl_db_buffer = acpi_os_allocate(ACPI_DEBUG_BUFFER_SIZE);
if (!acpi_gbl_db_buffer) {
Expand Down
33 changes: 33 additions & 0 deletions drivers/acpi/acpica/dswexec.c
Expand Up @@ -16,6 +16,9 @@
#include "acinterp.h"
#include "acnamesp.h"
#include "acdebug.h"
#ifdef ACPI_EXEC_APP
#include "aecommon.h"
#endif

#define _COMPONENT ACPI_DISPATCHER
ACPI_MODULE_NAME("dswexec")
Expand Down Expand Up @@ -329,6 +332,10 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
u32 op_class;
union acpi_parse_object *next_op;
union acpi_parse_object *first_arg;
#ifdef ACPI_EXEC_APP
char *namepath;
union acpi_operand_object *obj_desc;
#endif

ACPI_FUNCTION_TRACE_PTR(ds_exec_end_op, walk_state);

Expand Down Expand Up @@ -537,6 +544,32 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)

status =
acpi_ds_eval_buffer_field_operands(walk_state, op);
if (ACPI_FAILURE(status)) {
break;
}
#ifdef ACPI_EXEC_APP
/*
* acpi_exec support for namespace initialization file (initialize
* buffer_fields in this code.)
*/
namepath =
acpi_ns_get_external_pathname(op->common.node);
status = ae_lookup_init_file_entry(namepath, &obj_desc);
if (ACPI_SUCCESS(status)) {
status =
acpi_ex_write_data_to_field(obj_desc,
op->common.
node->object,
NULL);
if ACPI_FAILURE
(status) {
ACPI_EXCEPTION((AE_INFO, status,
"While writing to buffer field"));
}
}
ACPI_FREE(namepath);
status = AE_OK;
#endif
break;

case AML_TYPE_CREATE_OBJECT:
Expand Down
2 changes: 0 additions & 2 deletions drivers/acpi/acpica/dswload.c
Expand Up @@ -14,7 +14,6 @@
#include "acdispat.h"
#include "acinterp.h"
#include "acnamesp.h"

#ifdef ACPI_ASL_COMPILER
#include "acdisasm.h"
#endif
Expand Down Expand Up @@ -399,7 +398,6 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state)
union acpi_parse_object *op;
acpi_object_type object_type;
acpi_status status = AE_OK;

#ifdef ACPI_ASL_COMPILER
u8 param_count;
#endif
Expand Down
35 changes: 35 additions & 0 deletions drivers/acpi/acpica/dswload2.c
Expand Up @@ -15,6 +15,9 @@
#include "acinterp.h"
#include "acnamesp.h"
#include "acevents.h"
#ifdef ACPI_EXEC_APP
#include "aecommon.h"
#endif

#define _COMPONENT ACPI_DISPATCHER
ACPI_MODULE_NAME("dswload2")
Expand Down Expand Up @@ -373,6 +376,10 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
struct acpi_namespace_node *new_node;
u32 i;
u8 region_space;
#ifdef ACPI_EXEC_APP
union acpi_operand_object *obj_desc;
char *namepath;
#endif

ACPI_FUNCTION_TRACE(ds_load2_end_op);

Expand Down Expand Up @@ -466,6 +473,11 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
* be evaluated later during the execution phase
*/
status = acpi_ds_create_buffer_field(op, walk_state);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status,
"CreateBufferField failure"));
goto cleanup;
}
break;

case AML_TYPE_NAMED_FIELD:
Expand Down Expand Up @@ -604,6 +616,29 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
case AML_NAME_OP:

status = acpi_ds_create_node(walk_state, node, op);
if (ACPI_FAILURE(status)) {
goto cleanup;
}
#ifdef ACPI_EXEC_APP
/*
* acpi_exec support for namespace initialization file (initialize
* Name opcodes in this code.)
*/
namepath = acpi_ns_get_external_pathname(node);
status = ae_lookup_init_file_entry(namepath, &obj_desc);
if (ACPI_SUCCESS(status)) {

/* Detach any existing object, attach new object */

if (node->object) {
acpi_ns_detach_object(node);
}
acpi_ns_attach_object(node, obj_desc,
obj_desc->common.type);
}
ACPI_FREE(namepath);
status = AE_OK;
#endif
break;

case AML_METHOD_OP:
Expand Down
6 changes: 1 addition & 5 deletions drivers/acpi/acpica/nsnames.c
Expand Up @@ -13,9 +13,6 @@
#define _COMPONENT ACPI_NAMESPACE
ACPI_MODULE_NAME("nsnames")

/* Local Prototypes */
static void acpi_ns_normalize_pathname(char *original_path);

/*******************************************************************************
*
* FUNCTION: acpi_ns_get_external_pathname
Expand All @@ -30,7 +27,6 @@ static void acpi_ns_normalize_pathname(char *original_path);
* for error and debug statements.
*
******************************************************************************/

char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node)
{
char *name_buffer;
Expand Down Expand Up @@ -411,7 +407,7 @@ char *acpi_ns_build_prefixed_pathname(union acpi_generic_state *prefix_scope,
*
******************************************************************************/

static void acpi_ns_normalize_pathname(char *original_path)
void acpi_ns_normalize_pathname(char *original_path)
{
char *input_path = original_path;
char *new_path_buffer;
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/utdecode.c
Expand Up @@ -78,7 +78,7 @@ const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = {
"IPMI", /* 0x07 */
"GeneralPurposeIo", /* 0x08 */
"GenericSerialBus", /* 0x09 */
"PlatformCommChannel" /* 0x0A */
"PCC" /* 0x0A */
};

const char *acpi_ut_get_region_name(u8 space_id)
Expand Down
9 changes: 5 additions & 4 deletions drivers/acpi/acpica/utdelete.c
Expand Up @@ -452,13 +452,13 @@ acpi_ut_update_ref_count(union acpi_operand_object *object, u32 action)
*
* FUNCTION: acpi_ut_update_object_reference
*
* PARAMETERS: object - Increment ref count for this object
* and all sub-objects
* PARAMETERS: object - Increment or decrement the ref count for
* this object and all sub-objects
* action - Either REF_INCREMENT or REF_DECREMENT
*
* RETURN: Status
*
* DESCRIPTION: Increment the object reference count
* DESCRIPTION: Increment or decrement the object reference count
*
* Object references are incremented when:
* 1) An object is attached to a Node (namespace object)
Expand Down Expand Up @@ -492,7 +492,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
}

/*
* All sub-objects must have their reference count incremented
* All sub-objects must have their reference count updated
* also. Different object types have different subobjects.
*/
switch (object->common.type) {
Expand Down Expand Up @@ -559,6 +559,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
break;
}
}

next_object = NULL;
break;

Expand Down
7 changes: 6 additions & 1 deletion drivers/acpi/acpica/utprint.c
Expand Up @@ -332,7 +332,12 @@ int vsnprintf(char *string, acpi_size size, const char *format, va_list args)
int i;

pos = string;
end = string + size;

if (size != ACPI_UINT32_MAX) {
end = string + size;
} else {
end = ACPI_CAST_PTR(char, ACPI_UINT32_MAX);
}

for (; *format; ++format) {
if (*format != '%') {
Expand Down
33 changes: 7 additions & 26 deletions drivers/acpi/cppc_acpi.c
Expand Up @@ -438,13 +438,10 @@ int acpi_get_psd_map(struct cppc_cpudata **all_cpu_data)
* domain info.
*/
for_each_possible_cpu(i) {
pr = all_cpu_data[i];
if (!pr)
continue;

if (cpumask_test_cpu(i, covered_cpus))
continue;

pr = all_cpu_data[i];
cpc_ptr = per_cpu(cpc_desc_ptr, i);
if (!cpc_ptr) {
retval = -EFAULT;
Expand Down Expand Up @@ -495,44 +492,28 @@ int acpi_get_psd_map(struct cppc_cpudata **all_cpu_data)
cpumask_set_cpu(j, pr->shared_cpu_map);
}

for_each_possible_cpu(j) {
for_each_cpu(j, pr->shared_cpu_map) {
if (i == j)
continue;

match_pr = all_cpu_data[j];
if (!match_pr)
continue;

match_cpc_ptr = per_cpu(cpc_desc_ptr, j);
if (!match_cpc_ptr) {
retval = -EFAULT;
goto err_ret;
}

match_pdomain = &(match_cpc_ptr->domain_info);
if (match_pdomain->domain != pdomain->domain)
continue;

match_pr->shared_type = pr->shared_type;
cpumask_copy(match_pr->shared_cpu_map,
pr->shared_cpu_map);
}
}
goto out;

err_ret:
for_each_possible_cpu(i) {
pr = all_cpu_data[i];
if (!pr)
continue;

/* Assume no coordination on any error parsing domain info */
if (retval) {
cpumask_clear(pr->shared_cpu_map);
cpumask_set_cpu(i, pr->shared_cpu_map);
pr->shared_type = CPUFREQ_SHARED_TYPE_ALL;
}
cpumask_clear(pr->shared_cpu_map);
cpumask_set_cpu(i, pr->shared_cpu_map);
pr->shared_type = CPUFREQ_SHARED_TYPE_ALL;
}

out:
free_cpumask_var(covered_cpus);
return retval;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/device_pm.c
Expand Up @@ -1321,8 +1321,8 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on)
*/
static const struct acpi_device_id special_pm_ids[] = {
{"PNP0C0B", }, /* Generic ACPI fan */
{"INT1044", }, /* Fan for Tiger Lake generation */
{"INT3404", }, /* Fan */
{"INTC1044", }, /* Fan for Tiger Lake generation */
{}
};
struct acpi_device *adev = ACPI_COMPANION(dev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/dptf/dptf_power.c
Expand Up @@ -97,8 +97,8 @@ static int dptf_power_remove(struct platform_device *pdev)
}

static const struct acpi_device_id int3407_device_ids[] = {
{"INT1047", 0},
{"INT3407", 0},
{"INTC1047", 0},
{"", 0},
};
MODULE_DEVICE_TABLE(acpi, int3407_device_ids);
Expand Down

0 comments on commit 7e63420

Please sign in to comment.