Skip to content

Commit 36a96ed

Browse files
committed
Merge branches 'acpi-apei', 'acpi-bus', 'acpi-cppc' and 'acpi-video'
Merge assorted ACPI support fixes for 7.1-rc2: - Fix EINJV2 memory error injection in APEI (Tony Luck) - Add missing notifier_block structure forward declaration to acpi_bus.h (Bartosz Golaszewski) - Fix related_cpus inconsistency during CPU hotplug in the ACPI CPPC library (Jinjie Ruan) - Add a quirk to force native backlight on HP OMEN 16 (8A44) in the ACPI video bus driver (Shivam Kalra) * acpi-apei: ACPI: APEI: EINJ: Fix EINJV2 memory error injection ACPICA: Provide #defines for EINJV2 error types * acpi-bus: ACPI: bus: add missing forward declaration to acpi_bus.h * acpi-cppc: ACPI: CPPC: Fix related_cpus inconsistency during CPU hotplug * acpi-video: ACPI: video: force native backlight on HP OMEN 16 (8A44)
5 parents ad03448 + 0c00cfb + ea216d3 + 75141a7 + 4b506ea commit 36a96ed

5 files changed

Lines changed: 44 additions & 23 deletions

File tree

drivers/acpi/apei/einj-core.c

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,18 @@ static struct acpi_generic_address *einj_get_trigger_parameter_region(
401401

402402
return NULL;
403403
}
404+
405+
static bool is_memory_injection(u32 type, u32 flags)
406+
{
407+
if (flags & SETWA_FLAGS_EINJV2)
408+
return !!(type & ACPI_EINJV2_MEMORY);
409+
if (type & ACPI5_VENDOR_BIT)
410+
return !!(vendor_flags & SETWA_FLAGS_MEM);
411+
return !!(type & MEM_ERROR_MASK) || !!(flags & SETWA_FLAGS_MEM);
412+
}
413+
404414
/* Execute instructions in trigger error action table */
405-
static int __einj_error_trigger(u64 trigger_paddr, u32 type,
415+
static int __einj_error_trigger(u64 trigger_paddr, u32 type, u32 flags,
406416
u64 param1, u64 param2)
407417
{
408418
struct acpi_einj_trigger trigger_tab;
@@ -480,7 +490,7 @@ static int __einj_error_trigger(u64 trigger_paddr, u32 type,
480490
* This will cause resource conflict with regular memory. So
481491
* remove it from trigger table resources.
482492
*/
483-
if ((param_extension || acpi5) && (type & MEM_ERROR_MASK) && param2) {
493+
if ((param_extension || acpi5) && is_memory_injection(type, flags)) {
484494
struct apei_resources addr_resources;
485495

486496
apei_resources_init(&addr_resources);
@@ -660,7 +670,7 @@ static int __einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2,
660670
return rc;
661671
trigger_paddr = apei_exec_ctx_get_output(&ctx);
662672
if (notrigger == 0) {
663-
rc = __einj_error_trigger(trigger_paddr, type, param1, param2);
673+
rc = __einj_error_trigger(trigger_paddr, type, flags, param1, param2);
664674
if (rc)
665675
return rc;
666676
}
@@ -718,35 +728,30 @@ int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, u64 param3,
718728
SETWA_FLAGS_PCIE_SBDF | SETWA_FLAGS_EINJV2)))
719729
return -EINVAL;
720730

731+
/*
732+
* Injections targeting a CXL 1.0/1.1 port have to be injected
733+
* via the einj_cxl_rch_error_inject() path as that does the proper
734+
* validation of the given RCRB base (MMIO) address.
735+
*/
736+
if (einj_is_cxl_error_type(type) && (flags & SETWA_FLAGS_MEM))
737+
return -EINVAL;
738+
721739
/* check if type is a valid EINJv2 error type */
722740
if (is_v2) {
723741
if (!(type & available_error_type_v2))
724742
return -EINVAL;
725743
}
726-
/*
727-
* We need extra sanity checks for memory errors.
728-
* Other types leap directly to injection.
729-
*/
730744

731745
/* ensure param1/param2 existed */
732746
if (!(param_extension || acpi5))
733747
goto inject;
734748

735-
/* ensure injection is memory related */
736-
if (type & ACPI5_VENDOR_BIT) {
737-
if (vendor_flags != SETWA_FLAGS_MEM)
738-
goto inject;
739-
} else if (!(type & MEM_ERROR_MASK) && !(flags & SETWA_FLAGS_MEM)) {
740-
goto inject;
741-
}
742-
743749
/*
744-
* Injections targeting a CXL 1.0/1.1 port have to be injected
745-
* via the einj_cxl_rch_error_inject() path as that does the proper
746-
* validation of the given RCRB base (MMIO) address.
750+
* We need extra sanity checks for memory errors.
751+
* Other types leap directly to injection.
747752
*/
748-
if (einj_is_cxl_error_type(type) && (flags & SETWA_FLAGS_MEM))
749-
return -EINVAL;
753+
if (!is_memory_injection(type, flags))
754+
goto inject;
750755

751756
/*
752757
* Disallow crazy address masks that give BIOS leeway to pick

drivers/acpi/cppc_acpi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ static int send_pcc_cmd(int pcc_ss_id, u16 cmd)
362362
end:
363363
if (cmd == CMD_WRITE) {
364364
if (unlikely(ret)) {
365-
for_each_online_cpu(i) {
365+
for_each_possible_cpu(i) {
366366
struct cpc_desc *desc = per_cpu(cpc_desc_ptr, i);
367367

368368
if (!desc)
@@ -524,13 +524,13 @@ int acpi_get_psd_map(unsigned int cpu, struct cppc_cpudata *cpu_data)
524524
else if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ANY)
525525
cpu_data->shared_type = CPUFREQ_SHARED_TYPE_ANY;
526526

527-
for_each_online_cpu(i) {
527+
for_each_possible_cpu(i) {
528528
if (i == cpu)
529529
continue;
530530

531531
match_cpc_ptr = per_cpu(cpc_desc_ptr, i);
532532
if (!match_cpc_ptr)
533-
goto err_fault;
533+
continue;
534534

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

drivers/acpi/video_detect.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
916916
DMI_MATCH(DMI_PRODUCT_NAME, "82K8"),
917917
},
918918
},
919+
{
920+
.callback = video_detect_force_native,
921+
/* HP OMEN Gaming Laptop 16-n0xxx */
922+
.matches = {
923+
DMI_MATCH(DMI_SYS_VENDOR, "HP"),
924+
DMI_MATCH(DMI_PRODUCT_NAME, "OMEN by HP Gaming Laptop 16-n0xxx"),
925+
},
926+
},
919927

920928
/*
921929
* x86 android tablets which directly control the backlight through

include/acpi/acpi_bus.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include <linux/property.h>
1818
#include <linux/types.h>
1919

20+
struct notifier_block;
21+
2022
struct acpi_handle_list {
2123
u32 count;
2224
acpi_handle *handles;

include/acpi/actbl1.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,6 +1386,12 @@ enum acpi_einj_command_status {
13861386
#define ACPI_EINJ_CXL_MEM_FATAL (1<<17)
13871387
#define ACPI_EINJ_VENDOR_DEFINED (1<<31)
13881388

1389+
/* EINJV2 error types from EINJV2_GET_ERROR_TYPE (ACPI 6.6) */
1390+
1391+
#define ACPI_EINJV2_PROCESSOR (1)
1392+
#define ACPI_EINJV2_MEMORY (1<<1)
1393+
#define ACPI_EINJV2_PCIE (1<<2)
1394+
13891395
/*******************************************************************************
13901396
*
13911397
* ERST - Error Record Serialization Table (ACPI 4.0)

0 commit comments

Comments
 (0)