platform-drivers-x86 for v6.17-3

Fixes and New HW Support
 
 - 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
 
 The following is an automated shortlog grouped by driver:
 
 acer-wmi:
  -  Stop using ACPI bitmap for platform profile choices
 
 amd: hfi:
  -  Fix pcct_tbl leak in amd_hfi_metadata_parser()
 
 amd/pmc:
  -  Add TUXEDO IB Pro Gen10 AMD to spurious 8042 quirks list
 
 asus-wmi:
  -  Fix racy registrations
  -  Fix ROG button mapping, tablet mode on ASUS ROG Z13
  -  map more keys on ExpertBook B9
  -  Remove extra keys from ignore_key_wlan quirk
 
 hp-wmi:
  -  Add support for Fn+P hotkey
 
 intel/pmc:
  -  Add Bartlett Lake support to intel_pmc_core
 
 intel: power-domains:
  -  Use topology_logical_package_id() for package ID
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQSCSUwRdwTNL2MhaBlZrE9hU+XOMQUCaLretwAKCRBZrE9hU+XO
 MaibAPoDQK7NrixtCvXnm4fmWqttGyTBl73uqoCXL2X8LsQwMAEAkqh319fCZrjx
 /4u7YThOXpLnK+PROV72YRRTeP6hRwY=
 =jtzK
 -----END PGP SIGNATURE-----

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()
This commit is contained in:
Linus Torvalds 2025-09-05 10:28:48 -07:00
commit dd6cbcc589
9 changed files with 74 additions and 72 deletions

View File

@ -129,6 +129,7 @@ enum acer_wmi_predator_v4_oc {
enum acer_wmi_gaming_misc_setting {
ACER_WMID_MISC_SETTING_OC_1 = 0x0005,
ACER_WMID_MISC_SETTING_OC_2 = 0x0007,
/* Unreliable on some models */
ACER_WMID_MISC_SETTING_SUPPORTED_PROFILES = 0x000A,
ACER_WMID_MISC_SETTING_PLATFORM_PROFILE = 0x000B,
};
@ -794,9 +795,6 @@ static bool platform_profile_support;
*/
static int last_non_turbo_profile = INT_MIN;
/* The most performant supported profile */
static int acer_predator_v4_max_perf;
enum acer_predator_v4_thermal_profile {
ACER_PREDATOR_V4_THERMAL_PROFILE_QUIET = 0x00,
ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED = 0x01,
@ -2014,7 +2012,7 @@ acer_predator_v4_platform_profile_set(struct device *dev,
if (err)
return err;
if (tp != acer_predator_v4_max_perf)
if (tp != ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO)
last_non_turbo_profile = tp;
return 0;
@ -2023,55 +2021,14 @@ acer_predator_v4_platform_profile_set(struct device *dev,
static int
acer_predator_v4_platform_profile_probe(void *drvdata, unsigned long *choices)
{
unsigned long supported_profiles;
int err;
set_bit(PLATFORM_PROFILE_PERFORMANCE, choices);
set_bit(PLATFORM_PROFILE_BALANCED_PERFORMANCE, choices);
set_bit(PLATFORM_PROFILE_BALANCED, choices);
set_bit(PLATFORM_PROFILE_QUIET, choices);
set_bit(PLATFORM_PROFILE_LOW_POWER, choices);
err = WMID_gaming_get_misc_setting(ACER_WMID_MISC_SETTING_SUPPORTED_PROFILES,
(u8 *)&supported_profiles);
if (err)
return err;
/* Iterate through supported profiles in order of increasing performance */
if (test_bit(ACER_PREDATOR_V4_THERMAL_PROFILE_ECO, &supported_profiles)) {
set_bit(PLATFORM_PROFILE_LOW_POWER, choices);
acer_predator_v4_max_perf = ACER_PREDATOR_V4_THERMAL_PROFILE_ECO;
last_non_turbo_profile = ACER_PREDATOR_V4_THERMAL_PROFILE_ECO;
}
if (test_bit(ACER_PREDATOR_V4_THERMAL_PROFILE_QUIET, &supported_profiles)) {
set_bit(PLATFORM_PROFILE_QUIET, choices);
acer_predator_v4_max_perf = ACER_PREDATOR_V4_THERMAL_PROFILE_QUIET;
last_non_turbo_profile = ACER_PREDATOR_V4_THERMAL_PROFILE_QUIET;
}
if (test_bit(ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED, &supported_profiles)) {
set_bit(PLATFORM_PROFILE_BALANCED, choices);
acer_predator_v4_max_perf = ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED;
last_non_turbo_profile = ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED;
}
if (test_bit(ACER_PREDATOR_V4_THERMAL_PROFILE_PERFORMANCE, &supported_profiles)) {
set_bit(PLATFORM_PROFILE_BALANCED_PERFORMANCE, choices);
acer_predator_v4_max_perf = ACER_PREDATOR_V4_THERMAL_PROFILE_PERFORMANCE;
/* We only use this profile as a fallback option in case no prior
* profile is supported.
*/
if (last_non_turbo_profile < 0)
last_non_turbo_profile = ACER_PREDATOR_V4_THERMAL_PROFILE_PERFORMANCE;
}
if (test_bit(ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO, &supported_profiles)) {
set_bit(PLATFORM_PROFILE_PERFORMANCE, choices);
acer_predator_v4_max_perf = ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO;
/* We need to handle the hypothetical case where only the turbo profile
* is supported. In this case the turbo toggle will essentially be a
* no-op.
*/
if (last_non_turbo_profile < 0)
last_non_turbo_profile = ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO;
}
/* Set default non-turbo profile */
last_non_turbo_profile = ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED;
return 0;
}
@ -2108,19 +2065,15 @@ static int acer_thermal_profile_change(void)
if (cycle_gaming_thermal_profile) {
platform_profile_cycle();
} else {
/* Do nothing if no suitable platform profiles where found */
if (last_non_turbo_profile < 0)
return 0;
err = WMID_gaming_get_misc_setting(
ACER_WMID_MISC_SETTING_PLATFORM_PROFILE, &current_tp);
if (err)
return err;
if (current_tp == acer_predator_v4_max_perf)
if (current_tp == ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO)
tp = last_non_turbo_profile;
else
tp = acer_predator_v4_max_perf;
tp = ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO;
err = WMID_gaming_set_misc_setting(
ACER_WMID_MISC_SETTING_PLATFORM_PROFILE, tp);
@ -2128,7 +2081,7 @@ static int acer_thermal_profile_change(void)
return err;
/* Store last profile for toggle */
if (current_tp != acer_predator_v4_max_perf)
if (current_tp != ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO)
last_non_turbo_profile = current_tp;
platform_profile_notify(platform_profile_device);

View File

@ -385,12 +385,16 @@ static int amd_hfi_metadata_parser(struct platform_device *pdev,
amd_hfi_data->pcct_entry = pcct_entry;
pcct_ext = (struct acpi_pcct_ext_pcc_slave *)pcct_entry;
if (pcct_ext->length <= 0)
return -EINVAL;
if (pcct_ext->length <= 0) {
ret = -EINVAL;
goto out;
}
amd_hfi_data->shmem = devm_kzalloc(amd_hfi_data->dev, pcct_ext->length, GFP_KERNEL);
if (!amd_hfi_data->shmem)
return -ENOMEM;
if (!amd_hfi_data->shmem) {
ret = -ENOMEM;
goto out;
}
pcc_chan->shmem_base_addr = pcct_ext->base_address;
pcc_chan->shmem_size = pcct_ext->length;
@ -398,6 +402,8 @@ static int amd_hfi_metadata_parser(struct platform_device *pdev,
/* parse the shared memory info from the PCCT table */
ret = amd_hfi_fill_metadata(amd_hfi_data);
out:
/* Don't leak any ACPI memory */
acpi_put_table(pcct_tbl);
return ret;

View File

@ -248,6 +248,20 @@ static const struct dmi_system_id fwbug_list[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "Lafite Pro V 14M"),
}
},
{
.ident = "TUXEDO InfinityBook Pro 14/15 AMD Gen10",
.driver_data = &quirk_spurious_8042,
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "XxHP4NAx"),
}
},
{
.ident = "TUXEDO InfinityBook Pro 14/15 AMD Gen10",
.driver_data = &quirk_spurious_8042,
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "XxKK4NAx_XxSP4NAx"),
}
},
{}
};

View File

@ -147,7 +147,12 @@ static struct quirk_entry quirk_asus_ignore_fan = {
};
static struct quirk_entry quirk_asus_zenbook_duo_kbd = {
.ignore_key_wlan = true,
.key_wlan_event = ASUS_WMI_KEY_IGNORE,
};
static struct quirk_entry quirk_asus_z13 = {
.key_wlan_event = ASUS_WMI_KEY_ARMOURY,
.tablet_switch_mode = asus_wmi_kbd_dock_devid,
};
static int dmi_matched(const struct dmi_system_id *dmi)
@ -539,6 +544,15 @@ static const struct dmi_system_id asus_quirks[] = {
},
.driver_data = &quirk_asus_zenbook_duo_kbd,
},
{
.callback = dmi_matched,
.ident = "ASUS ROG Z13",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "ROG Flow Z13"),
},
.driver_data = &quirk_asus_z13,
},
{},
};
@ -618,6 +632,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_KEY, 0x93, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + CRT + TV + DVI */
{ KE_KEY, 0x95, { KEY_MEDIA } },
{ KE_KEY, 0x99, { KEY_PHONE } }, /* Conflicts with fan mode switch */
{ KE_KEY, 0X9D, { KEY_FN_F } },
{ KE_KEY, 0xA0, { KEY_SWITCHVIDEOMODE } }, /* SDSP HDMI only */
{ KE_KEY, 0xA1, { KEY_SWITCHVIDEOMODE } }, /* SDSP LCD + HDMI */
{ KE_KEY, 0xA2, { KEY_SWITCHVIDEOMODE } }, /* SDSP CRT + HDMI */
@ -632,10 +647,13 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
{ KE_IGNORE, 0xC0, }, /* External display connect/disconnect notification */
{ KE_KEY, 0xC4, { KEY_KBDILLUMUP } },
{ KE_KEY, 0xC5, { KEY_KBDILLUMDOWN } },
{ KE_KEY, 0xCA, { KEY_F13 } }, /* Noise cancelling on Expertbook B9 */
{ KE_KEY, 0xCB, { KEY_F14 } }, /* Fn+noise-cancel */
{ KE_IGNORE, 0xC6, }, /* Ambient Light Sensor notification */
{ KE_IGNORE, 0xCF, }, /* AC mode */
{ KE_KEY, 0xFA, { KEY_PROG2 } }, /* Lid flip action */
{ KE_KEY, 0xBD, { KEY_PROG2 } }, /* Lid flip action on ROG xflow laptops */
{ KE_KEY, ASUS_WMI_KEY_ARMOURY, { KEY_PROG3 } },
{ KE_END, 0},
};
@ -655,11 +673,9 @@ static void asus_nb_wmi_key_filter(struct asus_wmi_driver *asus_wmi, int *code,
if (atkbd_reports_vol_keys)
*code = ASUS_WMI_KEY_IGNORE;
break;
case 0x5D: /* Wireless console Toggle */
case 0x5E: /* Wireless console Enable */
case 0x5F: /* Wireless console Disable */
if (quirks->ignore_key_wlan)
*code = ASUS_WMI_KEY_IGNORE;
case 0x5F: /* Wireless console Disable / Special Key */
if (quirks->key_wlan_event)
*code = quirks->key_wlan_event;
break;
}
}

View File

@ -5088,16 +5088,22 @@ static int asus_wmi_probe(struct platform_device *pdev)
asus_s2idle_check_register();
return asus_wmi_add(pdev);
ret = asus_wmi_add(pdev);
if (ret)
asus_s2idle_check_unregister();
return ret;
}
static bool used;
static DEFINE_MUTEX(register_mutex);
int __init_or_module asus_wmi_register_driver(struct asus_wmi_driver *driver)
{
struct platform_driver *platform_driver;
struct platform_device *platform_device;
guard(mutex)(&register_mutex);
if (used)
return -EBUSY;
@ -5120,6 +5126,7 @@ EXPORT_SYMBOL_GPL(asus_wmi_register_driver);
void asus_wmi_unregister_driver(struct asus_wmi_driver *driver)
{
guard(mutex)(&register_mutex);
asus_s2idle_check_unregister();
platform_device_unregister(driver->platform_device);

View File

@ -18,6 +18,7 @@
#include <linux/i8042.h>
#define ASUS_WMI_KEY_IGNORE (-1)
#define ASUS_WMI_KEY_ARMOURY 0xffff01
#define ASUS_WMI_BRN_DOWN 0x2e
#define ASUS_WMI_BRN_UP 0x2f
@ -40,7 +41,7 @@ struct quirk_entry {
bool wmi_force_als_set;
bool wmi_ignore_fan;
bool filter_i8042_e1_extended_codes;
bool ignore_key_wlan;
int key_wlan_event;
enum asus_wmi_tablet_switch_mode tablet_switch_mode;
int wapf;
/*

View File

@ -122,6 +122,7 @@ enum hp_wmi_event_ids {
HPWMI_BATTERY_CHARGE_PERIOD = 0x10,
HPWMI_SANITIZATION_MODE = 0x17,
HPWMI_CAMERA_TOGGLE = 0x1A,
HPWMI_FN_P_HOTKEY = 0x1B,
HPWMI_OMEN_KEY = 0x1D,
HPWMI_SMART_EXPERIENCE_APP = 0x21,
};
@ -981,6 +982,9 @@ static void hp_wmi_notify(union acpi_object *obj, void *context)
key_code, 1, true))
pr_info("Unknown key code - 0x%x\n", key_code);
break;
case HPWMI_FN_P_HOTKEY:
platform_profile_cycle();
break;
case HPWMI_OMEN_KEY:
if (event_data) /* Only should be true for HP Omen */
key_code = event_data;

View File

@ -1625,6 +1625,7 @@ static const struct x86_cpu_id intel_pmc_core_ids[] = {
X86_MATCH_VFM(INTEL_RAPTORLAKE_P, &tgl_l_pmc_dev),
X86_MATCH_VFM(INTEL_RAPTORLAKE, &adl_pmc_dev),
X86_MATCH_VFM(INTEL_RAPTORLAKE_S, &adl_pmc_dev),
X86_MATCH_VFM(INTEL_BARTLETTLAKE, &adl_pmc_dev),
X86_MATCH_VFM(INTEL_METEORLAKE_L, &mtl_pmc_dev),
X86_MATCH_VFM(INTEL_ARROWLAKE, &arl_pmc_dev),
X86_MATCH_VFM(INTEL_ARROWLAKE_H, &arl_h_pmc_dev),

View File

@ -178,7 +178,7 @@ static int tpmi_get_logical_id(unsigned int cpu, struct tpmi_cpu_info *info)
info->punit_thread_id = FIELD_GET(LP_ID_MASK, data);
info->punit_core_id = FIELD_GET(MODULE_ID_MASK, data);
info->pkg_id = topology_physical_package_id(cpu);
info->pkg_id = topology_logical_package_id(cpu);
info->linux_cpu = cpu;
return 0;