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 'platform-drivers-x86-v6.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver fixes from Ilpo Järvinen:

- acer-wmi: Stop using ACPI bitmap for platform profile choices

- amd/hfi: Fix pcct_tbl leak

- amd/pmc: Add TUXEDO IB Pro Gen10 AMD to spurious 8042 quirks

- asus-wmi:
- Fix registration races
- Fix ROG button mapping, tablet mode on ASUS ROG Z13
- Support more keys on ExpertBook B9

- hp-wmi: Add support for Fn+P hotkey

- intel/pmc: Add Bartlett Lake support

- intel/power-domains: Use topology_logical_package_id() for package ID

* tag 'platform-drivers-x86-v6.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
platform/x86/intel: power-domains: Use topology_logical_package_id() for package ID
platform/x86: acer-wmi: Stop using ACPI bitmap for platform profile choices
platform/x86: hp-wmi: Add support for Fn+P hotkey
platform/x86/intel/pmc: Add Bartlett Lake support to intel_pmc_core
platform/x86: asus-wmi: Fix racy registrations
platform/x86/amd/pmc: Add TUXEDO IB Pro Gen10 AMD to spurious 8042 quirks list
platform/x86: asus-wmi: map more keys on ExpertBook B9
platform/x86: asus-wmi: Fix ROG button mapping, tablet mode on ASUS ROG Z13
platform/x86: asus-wmi: Remove extra keys from ignore_key_wlan quirk
platform/x86/amd: hfi: Fix pcct_tbl leak in amd_hfi_metadata_parser()

+74 -72
+12 -59
drivers/platform/x86/acer-wmi.c
··· 129 129 enum acer_wmi_gaming_misc_setting { 130 130 ACER_WMID_MISC_SETTING_OC_1 = 0x0005, 131 131 ACER_WMID_MISC_SETTING_OC_2 = 0x0007, 132 + /* Unreliable on some models */ 132 133 ACER_WMID_MISC_SETTING_SUPPORTED_PROFILES = 0x000A, 133 134 ACER_WMID_MISC_SETTING_PLATFORM_PROFILE = 0x000B, 134 135 }; ··· 794 793 * returning from turbo mode when the mode key is in toggle mode. 795 794 */ 796 795 static int last_non_turbo_profile = INT_MIN; 797 - 798 - /* The most performant supported profile */ 799 - static int acer_predator_v4_max_perf; 800 796 801 797 enum acer_predator_v4_thermal_profile { 802 798 ACER_PREDATOR_V4_THERMAL_PROFILE_QUIET = 0x00, ··· 2012 2014 if (err) 2013 2015 return err; 2014 2016 2015 - if (tp != acer_predator_v4_max_perf) 2017 + if (tp != ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO) 2016 2018 last_non_turbo_profile = tp; 2017 2019 2018 2020 return 0; ··· 2021 2023 static int 2022 2024 acer_predator_v4_platform_profile_probe(void *drvdata, unsigned long *choices) 2023 2025 { 2024 - unsigned long supported_profiles; 2025 - int err; 2026 + set_bit(PLATFORM_PROFILE_PERFORMANCE, choices); 2027 + set_bit(PLATFORM_PROFILE_BALANCED_PERFORMANCE, choices); 2028 + set_bit(PLATFORM_PROFILE_BALANCED, choices); 2029 + set_bit(PLATFORM_PROFILE_QUIET, choices); 2030 + set_bit(PLATFORM_PROFILE_LOW_POWER, choices); 2026 2031 2027 - err = WMID_gaming_get_misc_setting(ACER_WMID_MISC_SETTING_SUPPORTED_PROFILES, 2028 - (u8 *)&supported_profiles); 2029 - if (err) 2030 - return err; 2031 - 2032 - /* Iterate through supported profiles in order of increasing performance */ 2033 - if (test_bit(ACER_PREDATOR_V4_THERMAL_PROFILE_ECO, &supported_profiles)) { 2034 - set_bit(PLATFORM_PROFILE_LOW_POWER, choices); 2035 - acer_predator_v4_max_perf = ACER_PREDATOR_V4_THERMAL_PROFILE_ECO; 2036 - last_non_turbo_profile = ACER_PREDATOR_V4_THERMAL_PROFILE_ECO; 2037 - } 2038 - 2039 - if (test_bit(ACER_PREDATOR_V4_THERMAL_PROFILE_QUIET, &supported_profiles)) { 2040 - set_bit(PLATFORM_PROFILE_QUIET, choices); 2041 - acer_predator_v4_max_perf = ACER_PREDATOR_V4_THERMAL_PROFILE_QUIET; 2042 - last_non_turbo_profile = ACER_PREDATOR_V4_THERMAL_PROFILE_QUIET; 2043 - } 2044 - 2045 - if (test_bit(ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED, &supported_profiles)) { 2046 - set_bit(PLATFORM_PROFILE_BALANCED, choices); 2047 - acer_predator_v4_max_perf = ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED; 2048 - last_non_turbo_profile = ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED; 2049 - } 2050 - 2051 - if (test_bit(ACER_PREDATOR_V4_THERMAL_PROFILE_PERFORMANCE, &supported_profiles)) { 2052 - set_bit(PLATFORM_PROFILE_BALANCED_PERFORMANCE, choices); 2053 - acer_predator_v4_max_perf = ACER_PREDATOR_V4_THERMAL_PROFILE_PERFORMANCE; 2054 - 2055 - /* We only use this profile as a fallback option in case no prior 2056 - * profile is supported. 2057 - */ 2058 - if (last_non_turbo_profile < 0) 2059 - last_non_turbo_profile = ACER_PREDATOR_V4_THERMAL_PROFILE_PERFORMANCE; 2060 - } 2061 - 2062 - if (test_bit(ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO, &supported_profiles)) { 2063 - set_bit(PLATFORM_PROFILE_PERFORMANCE, choices); 2064 - acer_predator_v4_max_perf = ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO; 2065 - 2066 - /* We need to handle the hypothetical case where only the turbo profile 2067 - * is supported. In this case the turbo toggle will essentially be a 2068 - * no-op. 2069 - */ 2070 - if (last_non_turbo_profile < 0) 2071 - last_non_turbo_profile = ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO; 2072 - } 2032 + /* Set default non-turbo profile */ 2033 + last_non_turbo_profile = ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED; 2073 2034 2074 2035 return 0; 2075 2036 } ··· 2065 2108 if (cycle_gaming_thermal_profile) { 2066 2109 platform_profile_cycle(); 2067 2110 } else { 2068 - /* Do nothing if no suitable platform profiles where found */ 2069 - if (last_non_turbo_profile < 0) 2070 - return 0; 2071 - 2072 2111 err = WMID_gaming_get_misc_setting( 2073 2112 ACER_WMID_MISC_SETTING_PLATFORM_PROFILE, &current_tp); 2074 2113 if (err) 2075 2114 return err; 2076 2115 2077 - if (current_tp == acer_predator_v4_max_perf) 2116 + if (current_tp == ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO) 2078 2117 tp = last_non_turbo_profile; 2079 2118 else 2080 - tp = acer_predator_v4_max_perf; 2119 + tp = ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO; 2081 2120 2082 2121 err = WMID_gaming_set_misc_setting( 2083 2122 ACER_WMID_MISC_SETTING_PLATFORM_PROFILE, tp); ··· 2081 2128 return err; 2082 2129 2083 2130 /* Store last profile for toggle */ 2084 - if (current_tp != acer_predator_v4_max_perf) 2131 + if (current_tp != ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO) 2085 2132 last_non_turbo_profile = current_tp; 2086 2133 2087 2134 platform_profile_notify(platform_profile_device);
+10 -4
drivers/platform/x86/amd/hfi/hfi.c
··· 385 385 amd_hfi_data->pcct_entry = pcct_entry; 386 386 pcct_ext = (struct acpi_pcct_ext_pcc_slave *)pcct_entry; 387 387 388 - if (pcct_ext->length <= 0) 389 - return -EINVAL; 388 + if (pcct_ext->length <= 0) { 389 + ret = -EINVAL; 390 + goto out; 391 + } 390 392 391 393 amd_hfi_data->shmem = devm_kzalloc(amd_hfi_data->dev, pcct_ext->length, GFP_KERNEL); 392 - if (!amd_hfi_data->shmem) 393 - return -ENOMEM; 394 + if (!amd_hfi_data->shmem) { 395 + ret = -ENOMEM; 396 + goto out; 397 + } 394 398 395 399 pcc_chan->shmem_base_addr = pcct_ext->base_address; 396 400 pcc_chan->shmem_size = pcct_ext->length; ··· 402 398 /* parse the shared memory info from the PCCT table */ 403 399 ret = amd_hfi_fill_metadata(amd_hfi_data); 404 400 401 + out: 402 + /* Don't leak any ACPI memory */ 405 403 acpi_put_table(pcct_tbl); 406 404 407 405 return ret;
+14
drivers/platform/x86/amd/pmc/pmc-quirks.c
··· 248 248 DMI_MATCH(DMI_PRODUCT_NAME, "Lafite Pro V 14M"), 249 249 } 250 250 }, 251 + { 252 + .ident = "TUXEDO InfinityBook Pro 14/15 AMD Gen10", 253 + .driver_data = &quirk_spurious_8042, 254 + .matches = { 255 + DMI_MATCH(DMI_BOARD_NAME, "XxHP4NAx"), 256 + } 257 + }, 258 + { 259 + .ident = "TUXEDO InfinityBook Pro 14/15 AMD Gen10", 260 + .driver_data = &quirk_spurious_8042, 261 + .matches = { 262 + DMI_MATCH(DMI_BOARD_NAME, "XxKK4NAx_XxSP4NAx"), 263 + } 264 + }, 251 265 {} 252 266 }; 253 267
+22 -6
drivers/platform/x86/asus-nb-wmi.c
··· 147 147 }; 148 148 149 149 static struct quirk_entry quirk_asus_zenbook_duo_kbd = { 150 - .ignore_key_wlan = true, 150 + .key_wlan_event = ASUS_WMI_KEY_IGNORE, 151 + }; 152 + 153 + static struct quirk_entry quirk_asus_z13 = { 154 + .key_wlan_event = ASUS_WMI_KEY_ARMOURY, 155 + .tablet_switch_mode = asus_wmi_kbd_dock_devid, 151 156 }; 152 157 153 158 static int dmi_matched(const struct dmi_system_id *dmi) ··· 544 539 }, 545 540 .driver_data = &quirk_asus_zenbook_duo_kbd, 546 541 }, 542 + { 543 + .callback = dmi_matched, 544 + .ident = "ASUS ROG Z13", 545 + .matches = { 546 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 547 + DMI_MATCH(DMI_PRODUCT_NAME, "ROG Flow Z13"), 548 + }, 549 + .driver_data = &quirk_asus_z13, 550 + }, 547 551 {}, 548 552 }; 549 553 ··· 632 618 { KE_KEY, 0x93, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + DVI */ 633 619 { KE_KEY, 0x95, { KEY_MEDIA } }, 634 620 { KE_KEY, 0x99, { KEY_PHONE } }, /* Conflicts with fan mode switch */ 621 + { KE_KEY, 0X9D, { KEY_FN_F } }, 635 622 { KE_KEY, 0xA0, { KEY_SWITCHVIDEOMODE } }, /* SDSP HDMI only */ 636 623 { KE_KEY, 0xA1, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + HDMI */ 637 624 { KE_KEY, 0xA2, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + HDMI */ ··· 647 632 { KE_IGNORE, 0xC0, }, /* External display connect/disconnect notification */ 648 633 { KE_KEY, 0xC4, { KEY_KBDILLUMUP } }, 649 634 { KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } }, 635 + { KE_KEY, 0xCA, { KEY_F13 } }, /* Noise cancelling on Expertbook B9 */ 636 + { KE_KEY, 0xCB, { KEY_F14 } }, /* Fn+noise-cancel */ 650 637 { KE_IGNORE, 0xC6, }, /* Ambient Light Sensor notification */ 651 638 { KE_IGNORE, 0xCF, }, /* AC mode */ 652 639 { KE_KEY, 0xFA, { KEY_PROG2 } }, /* Lid flip action */ 653 640 { KE_KEY, 0xBD, { KEY_PROG2 } }, /* Lid flip action on ROG xflow laptops */ 641 + { KE_KEY, ASUS_WMI_KEY_ARMOURY, { KEY_PROG3 } }, 654 642 { KE_END, 0}, 655 643 }; 656 644 ··· 673 655 if (atkbd_reports_vol_keys) 674 656 *code = ASUS_WMI_KEY_IGNORE; 675 657 break; 676 - case 0x5D: /* Wireless console Toggle */ 677 - case 0x5E: /* Wireless console Enable */ 678 - case 0x5F: /* Wireless console Disable */ 679 - if (quirks->ignore_key_wlan) 680 - *code = ASUS_WMI_KEY_IGNORE; 658 + case 0x5F: /* Wireless console Disable / Special Key */ 659 + if (quirks->key_wlan_event) 660 + *code = quirks->key_wlan_event; 681 661 break; 682 662 } 683 663 }
+8 -1
drivers/platform/x86/asus-wmi.c
··· 5088 5088 5089 5089 asus_s2idle_check_register(); 5090 5090 5091 - return asus_wmi_add(pdev); 5091 + ret = asus_wmi_add(pdev); 5092 + if (ret) 5093 + asus_s2idle_check_unregister(); 5094 + 5095 + return ret; 5092 5096 } 5093 5097 5094 5098 static bool used; 5099 + static DEFINE_MUTEX(register_mutex); 5095 5100 5096 5101 int __init_or_module asus_wmi_register_driver(struct asus_wmi_driver *driver) 5097 5102 { 5098 5103 struct platform_driver *platform_driver; 5099 5104 struct platform_device *platform_device; 5100 5105 5106 + guard(mutex)(&register_mutex); 5101 5107 if (used) 5102 5108 return -EBUSY; 5103 5109 ··· 5126 5120 5127 5121 void asus_wmi_unregister_driver(struct asus_wmi_driver *driver) 5128 5122 { 5123 + guard(mutex)(&register_mutex); 5129 5124 asus_s2idle_check_unregister(); 5130 5125 5131 5126 platform_device_unregister(driver->platform_device);
+2 -1
drivers/platform/x86/asus-wmi.h
··· 18 18 #include <linux/i8042.h> 19 19 20 20 #define ASUS_WMI_KEY_IGNORE (-1) 21 + #define ASUS_WMI_KEY_ARMOURY 0xffff01 21 22 #define ASUS_WMI_BRN_DOWN 0x2e 22 23 #define ASUS_WMI_BRN_UP 0x2f 23 24 ··· 41 40 bool wmi_force_als_set; 42 41 bool wmi_ignore_fan; 43 42 bool filter_i8042_e1_extended_codes; 44 - bool ignore_key_wlan; 43 + int key_wlan_event; 45 44 enum asus_wmi_tablet_switch_mode tablet_switch_mode; 46 45 int wapf; 47 46 /*
+4
drivers/platform/x86/hp/hp-wmi.c
··· 122 122 HPWMI_BATTERY_CHARGE_PERIOD = 0x10, 123 123 HPWMI_SANITIZATION_MODE = 0x17, 124 124 HPWMI_CAMERA_TOGGLE = 0x1A, 125 + HPWMI_FN_P_HOTKEY = 0x1B, 125 126 HPWMI_OMEN_KEY = 0x1D, 126 127 HPWMI_SMART_EXPERIENCE_APP = 0x21, 127 128 }; ··· 981 980 if (!sparse_keymap_report_event(hp_wmi_input_dev, 982 981 key_code, 1, true)) 983 982 pr_info("Unknown key code - 0x%x\n", key_code); 983 + break; 984 + case HPWMI_FN_P_HOTKEY: 985 + platform_profile_cycle(); 984 986 break; 985 987 case HPWMI_OMEN_KEY: 986 988 if (event_data) /* Only should be true for HP Omen */
+1
drivers/platform/x86/intel/pmc/core.c
··· 1625 1625 X86_MATCH_VFM(INTEL_RAPTORLAKE_P, &tgl_l_pmc_dev), 1626 1626 X86_MATCH_VFM(INTEL_RAPTORLAKE, &adl_pmc_dev), 1627 1627 X86_MATCH_VFM(INTEL_RAPTORLAKE_S, &adl_pmc_dev), 1628 + X86_MATCH_VFM(INTEL_BARTLETTLAKE, &adl_pmc_dev), 1628 1629 X86_MATCH_VFM(INTEL_METEORLAKE_L, &mtl_pmc_dev), 1629 1630 X86_MATCH_VFM(INTEL_ARROWLAKE, &arl_pmc_dev), 1630 1631 X86_MATCH_VFM(INTEL_ARROWLAKE_H, &arl_h_pmc_dev),
+1 -1
drivers/platform/x86/intel/tpmi_power_domains.c
··· 178 178 179 179 info->punit_thread_id = FIELD_GET(LP_ID_MASK, data); 180 180 info->punit_core_id = FIELD_GET(MODULE_ID_MASK, data); 181 - info->pkg_id = topology_physical_package_id(cpu); 181 + info->pkg_id = topology_logical_package_id(cpu); 182 182 info->linux_cpu = cpu; 183 183 184 184 return 0;