Skip to content

Commit 7e63420

Browse files
committed
Merge tag 'acpi-5.7-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/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()
2 parents ef05db1 + 33ae7f7 commit 7e63420

File tree

27 files changed

+155
-77
lines changed

27 files changed

+155
-77
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@
2222
default: 0
2323

2424
acpi_backlight= [HW,ACPI]
25-
acpi_backlight=vendor
26-
acpi_backlight=video
27-
If set to vendor, prefer vendor specific driver
25+
{ vendor | video | native | none }
26+
If set to vendor, prefer vendor-specific driver
2827
(e.g. thinkpad_acpi, sony_acpi, etc.) instead
2928
of the ACPI video.ko driver.
29+
If set to video, use the ACPI video.ko driver.
30+
If set to native, use the device's native backlight mode.
31+
If set to none, disable the ACPI backlight interface.
3032

3133
acpi_force_32bit_fadt_addr
3234
force FADT to use 32 bit addresses rather than the

arch/x86/kernel/acpi/cstate.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu,
161161

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

164-
retval = work_on_cpu(cpu, acpi_processor_ffh_cstate_probe_cpu, cx);
164+
retval = call_on_cpu(cpu, acpi_processor_ffh_cstate_probe_cpu, cx,
165+
false);
165166
if (retval == 0) {
166167
/* Use the hint in CST */
167168
percpu_entry->states[cx->index].eax = cx->address;

drivers/acpi/acpica/acnamesp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ u32
256256
acpi_ns_build_normalized_path(struct acpi_namespace_node *node,
257257
char *full_path, u32 path_size, u8 no_trailing);
258258

259+
void acpi_ns_normalize_pathname(char *original_path);
260+
259261
char *acpi_ns_get_normalized_pathname(struct acpi_namespace_node *node,
260262
u8 no_trailing);
261263

drivers/acpi/acpica/dbinput.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -468,16 +468,14 @@ char *acpi_db_get_next_token(char *string,
468468
return (NULL);
469469
}
470470

471-
/* Remove any spaces at the beginning */
471+
/* Remove any spaces at the beginning, ignore blank lines */
472472

473-
if (*string == ' ') {
474-
while (*string && (*string == ' ')) {
475-
string++;
476-
}
473+
while (*string && isspace(*string)) {
474+
string++;
475+
}
477476

478-
if (!(*string)) {
479-
return (NULL);
480-
}
477+
if (!(*string)) {
478+
return (NULL);
481479
}
482480

483481
switch (*string) {
@@ -570,7 +568,7 @@ char *acpi_db_get_next_token(char *string,
570568

571569
/* Find end of token */
572570

573-
while (*string && (*string != ' ')) {
571+
while (*string && !isspace(*string)) {
574572
string++;
575573
}
576574
break;

drivers/acpi/acpica/dbxface.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ acpi_status acpi_initialize_debugger(void)
409409
acpi_gbl_db_output_flags = ACPI_DB_CONSOLE_OUTPUT;
410410

411411
acpi_gbl_db_opt_no_ini_methods = FALSE;
412+
acpi_gbl_db_opt_no_region_support = FALSE;
412413

413414
acpi_gbl_db_buffer = acpi_os_allocate(ACPI_DEBUG_BUFFER_SIZE);
414415
if (!acpi_gbl_db_buffer) {

drivers/acpi/acpica/dswexec.c

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
#include "acinterp.h"
1717
#include "acnamesp.h"
1818
#include "acdebug.h"
19+
#ifdef ACPI_EXEC_APP
20+
#include "aecommon.h"
21+
#endif
1922

2023
#define _COMPONENT ACPI_DISPATCHER
2124
ACPI_MODULE_NAME("dswexec")
@@ -329,6 +332,10 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
329332
u32 op_class;
330333
union acpi_parse_object *next_op;
331334
union acpi_parse_object *first_arg;
335+
#ifdef ACPI_EXEC_APP
336+
char *namepath;
337+
union acpi_operand_object *obj_desc;
338+
#endif
332339

333340
ACPI_FUNCTION_TRACE_PTR(ds_exec_end_op, walk_state);
334341

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

538545
status =
539546
acpi_ds_eval_buffer_field_operands(walk_state, op);
547+
if (ACPI_FAILURE(status)) {
548+
break;
549+
}
550+
#ifdef ACPI_EXEC_APP
551+
/*
552+
* acpi_exec support for namespace initialization file (initialize
553+
* buffer_fields in this code.)
554+
*/
555+
namepath =
556+
acpi_ns_get_external_pathname(op->common.node);
557+
status = ae_lookup_init_file_entry(namepath, &obj_desc);
558+
if (ACPI_SUCCESS(status)) {
559+
status =
560+
acpi_ex_write_data_to_field(obj_desc,
561+
op->common.
562+
node->object,
563+
NULL);
564+
if ACPI_FAILURE
565+
(status) {
566+
ACPI_EXCEPTION((AE_INFO, status,
567+
"While writing to buffer field"));
568+
}
569+
}
570+
ACPI_FREE(namepath);
571+
status = AE_OK;
572+
#endif
540573
break;
541574

542575
case AML_TYPE_CREATE_OBJECT:

drivers/acpi/acpica/dswload.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "acdispat.h"
1515
#include "acinterp.h"
1616
#include "acnamesp.h"
17-
1817
#ifdef ACPI_ASL_COMPILER
1918
#include "acdisasm.h"
2019
#endif
@@ -399,7 +398,6 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state)
399398
union acpi_parse_object *op;
400399
acpi_object_type object_type;
401400
acpi_status status = AE_OK;
402-
403401
#ifdef ACPI_ASL_COMPILER
404402
u8 param_count;
405403
#endif

drivers/acpi/acpica/dswload2.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
#include "acinterp.h"
1616
#include "acnamesp.h"
1717
#include "acevents.h"
18+
#ifdef ACPI_EXEC_APP
19+
#include "aecommon.h"
20+
#endif
1821

1922
#define _COMPONENT ACPI_DISPATCHER
2023
ACPI_MODULE_NAME("dswload2")
@@ -373,6 +376,10 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
373376
struct acpi_namespace_node *new_node;
374377
u32 i;
375378
u8 region_space;
379+
#ifdef ACPI_EXEC_APP
380+
union acpi_operand_object *obj_desc;
381+
char *namepath;
382+
#endif
376383

377384
ACPI_FUNCTION_TRACE(ds_load2_end_op);
378385

@@ -466,6 +473,11 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
466473
* be evaluated later during the execution phase
467474
*/
468475
status = acpi_ds_create_buffer_field(op, walk_state);
476+
if (ACPI_FAILURE(status)) {
477+
ACPI_EXCEPTION((AE_INFO, status,
478+
"CreateBufferField failure"));
479+
goto cleanup;
480+
}
469481
break;
470482

471483
case AML_TYPE_NAMED_FIELD:
@@ -604,6 +616,29 @@ acpi_status acpi_ds_load2_end_op(struct acpi_walk_state *walk_state)
604616
case AML_NAME_OP:
605617

606618
status = acpi_ds_create_node(walk_state, node, op);
619+
if (ACPI_FAILURE(status)) {
620+
goto cleanup;
621+
}
622+
#ifdef ACPI_EXEC_APP
623+
/*
624+
* acpi_exec support for namespace initialization file (initialize
625+
* Name opcodes in this code.)
626+
*/
627+
namepath = acpi_ns_get_external_pathname(node);
628+
status = ae_lookup_init_file_entry(namepath, &obj_desc);
629+
if (ACPI_SUCCESS(status)) {
630+
631+
/* Detach any existing object, attach new object */
632+
633+
if (node->object) {
634+
acpi_ns_detach_object(node);
635+
}
636+
acpi_ns_attach_object(node, obj_desc,
637+
obj_desc->common.type);
638+
}
639+
ACPI_FREE(namepath);
640+
status = AE_OK;
641+
#endif
607642
break;
608643

609644
case AML_METHOD_OP:

drivers/acpi/acpica/nsnames.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
#define _COMPONENT ACPI_NAMESPACE
1414
ACPI_MODULE_NAME("nsnames")
1515

16-
/* Local Prototypes */
17-
static void acpi_ns_normalize_pathname(char *original_path);
18-
1916
/*******************************************************************************
2017
*
2118
* FUNCTION: acpi_ns_get_external_pathname
@@ -30,7 +27,6 @@ static void acpi_ns_normalize_pathname(char *original_path);
3027
* for error and debug statements.
3128
*
3229
******************************************************************************/
33-
3430
char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node)
3531
{
3632
char *name_buffer;
@@ -411,7 +407,7 @@ char *acpi_ns_build_prefixed_pathname(union acpi_generic_state *prefix_scope,
411407
*
412408
******************************************************************************/
413409

414-
static void acpi_ns_normalize_pathname(char *original_path)
410+
void acpi_ns_normalize_pathname(char *original_path)
415411
{
416412
char *input_path = original_path;
417413
char *new_path_buffer;

drivers/acpi/acpica/utdecode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS] = {
7878
"IPMI", /* 0x07 */
7979
"GeneralPurposeIo", /* 0x08 */
8080
"GenericSerialBus", /* 0x09 */
81-
"PlatformCommChannel" /* 0x0A */
81+
"PCC" /* 0x0A */
8282
};
8383

8484
const char *acpi_ut_get_region_name(u8 space_id)

drivers/acpi/acpica/utdelete.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,13 +452,13 @@ acpi_ut_update_ref_count(union acpi_operand_object *object, u32 action)
452452
*
453453
* FUNCTION: acpi_ut_update_object_reference
454454
*
455-
* PARAMETERS: object - Increment ref count for this object
456-
* and all sub-objects
455+
* PARAMETERS: object - Increment or decrement the ref count for
456+
* this object and all sub-objects
457457
* action - Either REF_INCREMENT or REF_DECREMENT
458458
*
459459
* RETURN: Status
460460
*
461-
* DESCRIPTION: Increment the object reference count
461+
* DESCRIPTION: Increment or decrement the object reference count
462462
*
463463
* Object references are incremented when:
464464
* 1) An object is attached to a Node (namespace object)
@@ -492,7 +492,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
492492
}
493493

494494
/*
495-
* All sub-objects must have their reference count incremented
495+
* All sub-objects must have their reference count updated
496496
* also. Different object types have different subobjects.
497497
*/
498498
switch (object->common.type) {
@@ -559,6 +559,7 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
559559
break;
560560
}
561561
}
562+
562563
next_object = NULL;
563564
break;
564565

drivers/acpi/acpica/utprint.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,12 @@ int vsnprintf(char *string, acpi_size size, const char *format, va_list args)
332332
int i;
333333

334334
pos = string;
335-
end = string + size;
335+
336+
if (size != ACPI_UINT32_MAX) {
337+
end = string + size;
338+
} else {
339+
end = ACPI_CAST_PTR(char, ACPI_UINT32_MAX);
340+
}
336341

337342
for (; *format; ++format) {
338343
if (*format != '%') {

drivers/acpi/cppc_acpi.c

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -438,13 +438,10 @@ int acpi_get_psd_map(struct cppc_cpudata **all_cpu_data)
438438
* domain info.
439439
*/
440440
for_each_possible_cpu(i) {
441-
pr = all_cpu_data[i];
442-
if (!pr)
443-
continue;
444-
445441
if (cpumask_test_cpu(i, covered_cpus))
446442
continue;
447443

444+
pr = all_cpu_data[i];
448445
cpc_ptr = per_cpu(cpc_desc_ptr, i);
449446
if (!cpc_ptr) {
450447
retval = -EFAULT;
@@ -495,44 +492,28 @@ int acpi_get_psd_map(struct cppc_cpudata **all_cpu_data)
495492
cpumask_set_cpu(j, pr->shared_cpu_map);
496493
}
497494

498-
for_each_possible_cpu(j) {
495+
for_each_cpu(j, pr->shared_cpu_map) {
499496
if (i == j)
500497
continue;
501498

502499
match_pr = all_cpu_data[j];
503-
if (!match_pr)
504-
continue;
505-
506-
match_cpc_ptr = per_cpu(cpc_desc_ptr, j);
507-
if (!match_cpc_ptr) {
508-
retval = -EFAULT;
509-
goto err_ret;
510-
}
511-
512-
match_pdomain = &(match_cpc_ptr->domain_info);
513-
if (match_pdomain->domain != pdomain->domain)
514-
continue;
515-
516500
match_pr->shared_type = pr->shared_type;
517501
cpumask_copy(match_pr->shared_cpu_map,
518502
pr->shared_cpu_map);
519503
}
520504
}
505+
goto out;
521506

522507
err_ret:
523508
for_each_possible_cpu(i) {
524509
pr = all_cpu_data[i];
525-
if (!pr)
526-
continue;
527510

528511
/* Assume no coordination on any error parsing domain info */
529-
if (retval) {
530-
cpumask_clear(pr->shared_cpu_map);
531-
cpumask_set_cpu(i, pr->shared_cpu_map);
532-
pr->shared_type = CPUFREQ_SHARED_TYPE_ALL;
533-
}
512+
cpumask_clear(pr->shared_cpu_map);
513+
cpumask_set_cpu(i, pr->shared_cpu_map);
514+
pr->shared_type = CPUFREQ_SHARED_TYPE_ALL;
534515
}
535-
516+
out:
536517
free_cpumask_var(covered_cpus);
537518
return retval;
538519
}

drivers/acpi/device_pm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1321,8 +1321,8 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on)
13211321
*/
13221322
static const struct acpi_device_id special_pm_ids[] = {
13231323
{"PNP0C0B", }, /* Generic ACPI fan */
1324-
{"INT1044", }, /* Fan for Tiger Lake generation */
13251324
{"INT3404", }, /* Fan */
1325+
{"INTC1044", }, /* Fan for Tiger Lake generation */
13261326
{}
13271327
};
13281328
struct acpi_device *adev = ACPI_COMPANION(dev);

drivers/acpi/dptf/dptf_power.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ static int dptf_power_remove(struct platform_device *pdev)
9797
}
9898

9999
static const struct acpi_device_id int3407_device_ids[] = {
100-
{"INT1047", 0},
101100
{"INT3407", 0},
101+
{"INTC1047", 0},
102102
{"", 0},
103103
};
104104
MODULE_DEVICE_TABLE(acpi, int3407_device_ids);

0 commit comments

Comments
 (0)