Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'acpi-7.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI support fixes from Rafael Wysocki:
"These fix leftover issues in the ACPI Time and Alarm Device (TAD)
driver on top of the recently merged updates of it and address
assorted issues in the ACPI support code:

- Fix removal code ordering in the ACPI TAD driver, refine timer
value computations and checks in its RTC class device interface,
make it use the __ATTRIBUTE_GROUPS() macro, and fix a comment in it
(Rafael Wysocki)

- 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)"

* tag 'acpi-7.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI: bus: add missing forward declaration to acpi_bus.h
ACPI: video: force native backlight on HP OMEN 16 (8A44)
ACPI: TAD: Fix up a comment in acpi_tad_probe()
ACPI: TAD: RTC: Refine timer value computations and checks
ACPI: TAD: Use devres for all driver cleanup
ACPI: TAD: Use __ATTRIBUTE_GROUPS() macro
ACPI: CPPC: Fix related_cpus inconsistency during CPU hotplug
ACPI: APEI: EINJ: Fix EINJV2 memory error injection
ACPICA: Provide #defines for EINJV2 error types

+68 -44
+19 -16
drivers/acpi/acpi_tad.c
··· 605 605 return 0; 606 606 } 607 607 608 - static const struct attribute_group acpi_tad_attr_group = { 608 + static const struct attribute_group acpi_tad_group = { 609 609 .attrs = acpi_tad_attrs, 610 610 .is_visible = acpi_tad_attr_is_visible, 611 611 }; 612 612 613 - static const struct attribute_group *acpi_tad_attr_groups[] = { 614 - &acpi_tad_attr_group, 615 - NULL, 616 - }; 613 + __ATTRIBUTE_GROUPS(acpi_tad); 617 614 618 615 #ifdef CONFIG_RTC_CLASS 619 616 /* RTC class device interface */ ··· 680 683 681 684 acpi_tad_rt_to_tm(&rt, &tm_now); 682 685 683 - value = ktime_divns(ktime_sub(rtc_tm_to_ktime(t->time), 684 - rtc_tm_to_ktime(tm_now)), NSEC_PER_SEC); 685 - if (value <= 0 || value > U32_MAX) 686 + value = rtc_tm_to_time64(&t->time) - rtc_tm_to_time64(&tm_now); 687 + if (value <= 0 || value >= U32_MAX) 686 688 return -EINVAL; 687 689 } 688 690 ··· 744 748 745 749 if (retval != ACPI_TAD_WAKE_DISABLED) { 746 750 t->enabled = 1; 747 - t->time = rtc_ktime_to_tm(ktime_add_ns(rtc_tm_to_ktime(tm_now), 748 - (u64)retval * NSEC_PER_SEC)); 751 + rtc_time64_to_tm(rtc_tm_to_time64(&tm_now) + retval, &t->time); 749 752 } else { 750 753 t->enabled = 0; 751 754 t->time = tm_now; ··· 790 795 return acpi_tad_wake_set(dev, "_STV", timer_id, ACPI_TAD_WAKE_DISABLED); 791 796 } 792 797 793 - static void acpi_tad_remove(struct platform_device *pdev) 798 + static void acpi_tad_remove(void *data) 794 799 { 795 - struct device *dev = &pdev->dev; 800 + struct device *dev = data; 796 801 struct acpi_tad_driver_data *dd = dev_get_drvdata(dev); 797 802 798 803 device_init_wakeup(dev, false); ··· 819 824 struct acpi_tad_driver_data *dd; 820 825 acpi_status status; 821 826 unsigned long long caps; 827 + int ret; 822 828 823 829 /* 824 830 * Initialization failure messages are mostly about firmware issues, so ··· 859 863 } 860 864 861 865 /* 862 - * The platform bus type layer tells the ACPI PM domain powers up the 863 - * device, so set the runtime PM status of it to "active". 866 + * The platform bus type probe callback tells the ACPI PM domain to 867 + * power up the device, so set the runtime PM status of it to "active". 864 868 */ 865 869 pm_runtime_set_active(dev); 866 870 pm_runtime_enable(dev); 867 871 pm_runtime_suspend(dev); 872 + 873 + /* 874 + * acpi_tad_remove() needs to run after unregistering the RTC class 875 + * device to avoid racing with the latter's callbacks. 876 + */ 877 + ret = devm_add_action_or_reset(&pdev->dev, acpi_tad_remove, &pdev->dev); 878 + if (ret) 879 + return ret; 868 880 869 881 if (caps & ACPI_TAD_RT) 870 882 acpi_tad_register_rtc(dev, caps); ··· 889 885 .driver = { 890 886 .name = "acpi-tad", 891 887 .acpi_match_table = acpi_tad_ids, 892 - .dev_groups = acpi_tad_attr_groups, 888 + .dev_groups = acpi_tad_groups, 893 889 }, 894 890 .probe = acpi_tad_probe, 895 - .remove = acpi_tad_remove, 896 891 }; 897 892 MODULE_DEVICE_TABLE(acpi, acpi_tad_ids); 898 893
+30 -25
drivers/acpi/apei/einj-core.c
··· 401 401 402 402 return NULL; 403 403 } 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 + 404 414 /* 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, 406 416 u64 param1, u64 param2) 407 417 { 408 418 struct acpi_einj_trigger trigger_tab; ··· 490 480 * This will cause resource conflict with regular memory. So 491 481 * remove it from trigger table resources. 492 482 */ 493 - if ((param_extension || acpi5) && (type & MEM_ERROR_MASK) && param2) { 483 + if ((param_extension || acpi5) && is_memory_injection(type, flags)) { 494 484 struct apei_resources addr_resources; 495 485 496 486 apei_resources_init(&addr_resources); ··· 670 660 return rc; 671 661 trigger_paddr = apei_exec_ctx_get_output(&ctx); 672 662 if (notrigger == 0) { 673 - rc = __einj_error_trigger(trigger_paddr, type, param1, param2); 663 + rc = __einj_error_trigger(trigger_paddr, type, flags, param1, param2); 674 664 if (rc) 675 665 return rc; 676 666 } ··· 728 718 SETWA_FLAGS_PCIE_SBDF | SETWA_FLAGS_EINJV2))) 729 719 return -EINVAL; 730 720 731 - /* check if type is a valid EINJv2 error type */ 732 - if (is_v2) { 733 - if (!(type & available_error_type_v2)) 734 - return -EINVAL; 735 - } 736 - /* 737 - * We need extra sanity checks for memory errors. 738 - * Other types leap directly to injection. 739 - */ 740 - 741 - /* ensure param1/param2 existed */ 742 - if (!(param_extension || acpi5)) 743 - goto inject; 744 - 745 - /* ensure injection is memory related */ 746 - if (type & ACPI5_VENDOR_BIT) { 747 - if (vendor_flags != SETWA_FLAGS_MEM) 748 - goto inject; 749 - } else if (!(type & MEM_ERROR_MASK) && !(flags & SETWA_FLAGS_MEM)) { 750 - goto inject; 751 - } 752 - 753 721 /* 754 722 * Injections targeting a CXL 1.0/1.1 port have to be injected 755 723 * via the einj_cxl_rch_error_inject() path as that does the proper ··· 735 747 */ 736 748 if (einj_is_cxl_error_type(type) && (flags & SETWA_FLAGS_MEM)) 737 749 return -EINVAL; 750 + 751 + /* check if type is a valid EINJv2 error type */ 752 + if (is_v2) { 753 + if (!(type & available_error_type_v2)) 754 + return -EINVAL; 755 + } 756 + 757 + /* ensure param1/param2 existed */ 758 + if (!(param_extension || acpi5)) 759 + goto inject; 760 + 761 + /* 762 + * We need extra sanity checks for memory errors. 763 + * Other types leap directly to injection. 764 + */ 765 + if (!is_memory_injection(type, flags)) 766 + goto inject; 738 767 739 768 /* 740 769 * Disallow crazy address masks that give BIOS leeway to pick
+3 -3
drivers/acpi/cppc_acpi.c
··· 362 362 end: 363 363 if (cmd == CMD_WRITE) { 364 364 if (unlikely(ret)) { 365 - for_each_online_cpu(i) { 365 + for_each_possible_cpu(i) { 366 366 struct cpc_desc *desc = per_cpu(cpc_desc_ptr, i); 367 367 368 368 if (!desc) ··· 524 524 else if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ANY) 525 525 cpu_data->shared_type = CPUFREQ_SHARED_TYPE_ANY; 526 526 527 - for_each_online_cpu(i) { 527 + for_each_possible_cpu(i) { 528 528 if (i == cpu) 529 529 continue; 530 530 531 531 match_cpc_ptr = per_cpu(cpc_desc_ptr, i); 532 532 if (!match_cpc_ptr) 533 - goto err_fault; 533 + continue; 534 534 535 535 match_pdomain = &(match_cpc_ptr->domain_info); 536 536 if (match_pdomain->domain != pdomain->domain)
+8
drivers/acpi/video_detect.c
··· 916 916 DMI_MATCH(DMI_PRODUCT_NAME, "82K8"), 917 917 }, 918 918 }, 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 + }, 919 927 920 928 /* 921 929 * x86 android tablets which directly control the backlight through
+2
include/acpi/acpi_bus.h
··· 17 17 #include <linux/property.h> 18 18 #include <linux/types.h> 19 19 20 + struct notifier_block; 21 + 20 22 struct acpi_handle_list { 21 23 u32 count; 22 24 acpi_handle *handles;
+6
include/acpi/actbl1.h
··· 1386 1386 #define ACPI_EINJ_CXL_MEM_FATAL (1<<17) 1387 1387 #define ACPI_EINJ_VENDOR_DEFINED (1<<31) 1388 1388 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 + 1389 1395 /******************************************************************************* 1390 1396 * 1391 1397 * ERST - Error Record Serialization Table (ACPI 4.0)