Skip to content

Commit 59fff63

Browse files
committed
Merge tag 'platform-drivers-x86-v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
Pull x86 platform driver updates from Ilpo Järvinen: - asus-wmi: Support for screenpad and solve brightness key press duplication - int3472: Eliminate the last use of deprecated GPIO functions - mlxbf-pmc: New HW support - msi-ec: Support new EC configurations - thinkpad_acpi: Support reading aux MAC address during passthrough - wmi: Fixes & improvements - x86-android-tablets: Detection fix and avoid use of GPIO private APIs - Debug & metrics interface improvements - Miscellaneous cleanups / fixes / improvements * tag 'platform-drivers-x86-v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (80 commits) platform/x86: inspur-platform-profile: Add platform profile support platform/x86: thinkpad_acpi: Add battery quirk for Thinkpad X120e platform/x86: wmi: Decouple WMI device removal from wmi_block_list platform/x86: wmi: Fix opening of char device platform/x86: wmi: Fix probe failure when failing to register WMI devices platform/x86: wmi: Fix refcounting of WMI devices in legacy functions platform/x86: wmi: Decouple probe deferring from wmi_block_list platform/x86/amd/hsmp: Fix iomem handling platform/x86: asus-wmi: Do not report brightness up/down keys when also reported by acpi_video platform/x86: thinkpad_acpi: replace deprecated strncpy with memcpy tools/power/x86/intel-speed-select: v1.18 release tools/power/x86/intel-speed-select: Use cgroup isolate for CPU 0 tools/power/x86/intel-speed-select: Increase max CPUs in one request tools/power/x86/intel-speed-select: Display error for core-power support tools/power/x86/intel-speed-select: No TRL for non compute domains tools/power/x86/intel-speed-select: turbo-mode enable disable swapped tools/power/x86/intel-speed-select: Update help for TRL tools/power/x86/intel-speed-select: Sanitize integer arguments platform/x86: acer-wmi: Remove void function return platform/x86/amd/pmc: Add dump_custom_stb module parameter ...
2 parents 3475b91 + 94ace9e commit 59fff63

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+3042
-495
lines changed

Documentation/ABI/testing/sysfs-class-firmware-attributes

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,36 @@ Description:
383383
Note that any changes to this attribute requires a reboot
384384
for changes to take effect.
385385

386+
What: /sys/class/firmware-attributes/*/attributes/save_settings
387+
Date: August 2023
388+
KernelVersion: 6.6
389+
Contact: Mark Pearson <mpearson-lenovo@squebb.ca>
390+
Description:
391+
On Lenovo platforms there is a limitation in the number of times an attribute can be
392+
saved. This is an architectural limitation and it limits the number of attributes
393+
that can be modified to 48.
394+
A solution for this is instead of the attribute being saved after every modification,
395+
to allow a user to bulk set the attributes, and then trigger a final save. This allows
396+
unlimited attributes.
397+
398+
Read the attribute to check what save mode is enabled (single or bulk).
399+
E.g:
400+
# cat /sys/class/firmware-attributes/thinklmi/attributes/save_settings
401+
single
402+
403+
Write the attribute with 'bulk' to enable bulk save mode.
404+
Write the attribute with 'single' to enable saving, after every attribute set.
405+
The default setting is single mode.
406+
E.g:
407+
# echo bulk > /sys/class/firmware-attributes/thinklmi/attributes/save_settings
408+
409+
When in bulk mode write 'save' to trigger a save of all currently modified attributes.
410+
Note, once a save has been triggered, in bulk mode, attributes can no longer be set and
411+
will return a permissions error. This is to prevent users hitting the 48+ save limitation
412+
(which requires entering the BIOS to clear the error condition)
413+
E.g:
414+
# echo save > /sys/class/firmware-attributes/thinklmi/attributes/save_settings
415+
386416
What: /sys/class/firmware-attributes/*/attributes/debug_cmd
387417
Date: July 2021
388418
KernelVersion: 5.14

Documentation/admin-guide/laptops/thinkpad-acpi.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ detailed description):
5353
- Lap mode sensor
5454
- Setting keyboard language
5555
- WWAN Antenna type
56+
- Auxmac
5657

5758
A compatibility table by model and feature is maintained on the web
5859
site, http://ibm-acpi.sf.net/. I appreciate any success or failure
@@ -1511,6 +1512,25 @@ Currently 2 antenna types are supported as mentioned below:
15111512
The property is read-only. If the platform doesn't have support the sysfs
15121513
class is not created.
15131514

1515+
Auxmac
1516+
------
1517+
1518+
sysfs: auxmac
1519+
1520+
Some newer Thinkpads have a feature called MAC Address Pass-through. This
1521+
feature is implemented by the system firmware to provide a system unique MAC,
1522+
that can override a dock or USB ethernet dongle MAC, when connected to a
1523+
network. This property enables user-space to easily determine the MAC address
1524+
if the feature is enabled.
1525+
1526+
The values of this auxiliary MAC are:
1527+
1528+
cat /sys/devices/platform/thinkpad_acpi/auxmac
1529+
1530+
If the feature is disabled, the value will be 'disabled'.
1531+
1532+
This property is read-only.
1533+
15141534
Adaptive keyboard
15151535
-----------------
15161536

Documentation/arch/x86/amd_hsmp.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,24 @@ In-kernel integration:
4141
* Locking across callers is taken care by the driver.
4242

4343

44+
HSMP sysfs interface
45+
====================
46+
47+
1. Metrics table binary sysfs
48+
49+
AMD MI300A MCM provides GET_METRICS_TABLE message to retrieve
50+
most of the system management information from SMU in one go.
51+
52+
The metrics table is made available as hexadecimal sysfs binary file
53+
under per socket sysfs directory created at
54+
/sys/devices/platform/amd_hsmp/socket%d/metrics_bin
55+
56+
Note: lseek() is not supported as entire metrics table is read.
57+
58+
Metrics table definitions will be documented as part of Public PPR.
59+
The same is defined in the amd_hsmp.h header.
60+
61+
4462
An example
4563
==========
4664

arch/x86/include/asm/msr-index.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@
222222
#define MSR_INTEGRITY_CAPS_ARRAY_BIST BIT(MSR_INTEGRITY_CAPS_ARRAY_BIST_BIT)
223223
#define MSR_INTEGRITY_CAPS_PERIODIC_BIST_BIT 4
224224
#define MSR_INTEGRITY_CAPS_PERIODIC_BIST BIT(MSR_INTEGRITY_CAPS_PERIODIC_BIST_BIT)
225+
#define MSR_INTEGRITY_CAPS_SAF_GEN_MASK GENMASK_ULL(10, 9)
225226

226227
#define MSR_LBR_NHM_FROM 0x00000680
227228
#define MSR_LBR_NHM_TO 0x000006c0

arch/x86/include/uapi/asm/amd_hsmp.h

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ enum hsmp_message_ids {
4747
HSMP_SET_PCI_RATE, /* 20h Control link rate on PCIe devices */
4848
HSMP_SET_POWER_MODE, /* 21h Select power efficiency profile policy */
4949
HSMP_SET_PSTATE_MAX_MIN, /* 22h Set the max and min DF P-State */
50+
HSMP_GET_METRIC_TABLE_VER, /* 23h Get metrics table version */
51+
HSMP_GET_METRIC_TABLE, /* 24h Get metrics table */
52+
HSMP_GET_METRIC_TABLE_DRAM_ADDR,/* 25h Get metrics table dram address */
5053
HSMP_MSG_ID_MAX,
5154
};
5255

@@ -64,6 +67,14 @@ enum hsmp_msg_type {
6467
HSMP_GET = 1,
6568
};
6669

70+
enum hsmp_proto_versions {
71+
HSMP_PROTO_VER2 = 2,
72+
HSMP_PROTO_VER3,
73+
HSMP_PROTO_VER4,
74+
HSMP_PROTO_VER5,
75+
HSMP_PROTO_VER6
76+
};
77+
6778
struct hsmp_msg_desc {
6879
int num_args;
6980
int response_sz;
@@ -295,6 +306,104 @@ static const struct hsmp_msg_desc hsmp_msg_desc_table[] = {
295306
* input: args[0] = min df pstate[15:8] + max df pstate[7:0]
296307
*/
297308
{1, 0, HSMP_SET},
309+
310+
/*
311+
* HSMP_GET_METRIC_TABLE_VER, num_args = 0, response_sz = 1
312+
* output: args[0] = metrics table version
313+
*/
314+
{0, 1, HSMP_GET},
315+
316+
/*
317+
* HSMP_GET_METRIC_TABLE, num_args = 0, response_sz = 0
318+
*/
319+
{0, 0, HSMP_GET},
320+
321+
/*
322+
* HSMP_GET_METRIC_TABLE_DRAM_ADDR, num_args = 0, response_sz = 2
323+
* output: args[0] = lower 32 bits of the address
324+
* output: args[1] = upper 32 bits of the address
325+
*/
326+
{0, 2, HSMP_GET},
327+
};
328+
329+
/* Metrics table (supported only with proto version 6) */
330+
struct hsmp_metric_table {
331+
__u32 accumulation_counter;
332+
333+
/* TEMPERATURE */
334+
__u32 max_socket_temperature;
335+
__u32 max_vr_temperature;
336+
__u32 max_hbm_temperature;
337+
__u64 max_socket_temperature_acc;
338+
__u64 max_vr_temperature_acc;
339+
__u64 max_hbm_temperature_acc;
340+
341+
/* POWER */
342+
__u32 socket_power_limit;
343+
__u32 max_socket_power_limit;
344+
__u32 socket_power;
345+
346+
/* ENERGY */
347+
__u64 timestamp;
348+
__u64 socket_energy_acc;
349+
__u64 ccd_energy_acc;
350+
__u64 xcd_energy_acc;
351+
__u64 aid_energy_acc;
352+
__u64 hbm_energy_acc;
353+
354+
/* FREQUENCY */
355+
__u32 cclk_frequency_limit;
356+
__u32 gfxclk_frequency_limit;
357+
__u32 fclk_frequency;
358+
__u32 uclk_frequency;
359+
__u32 socclk_frequency[4];
360+
__u32 vclk_frequency[4];
361+
__u32 dclk_frequency[4];
362+
__u32 lclk_frequency[4];
363+
__u64 gfxclk_frequency_acc[8];
364+
__u64 cclk_frequency_acc[96];
365+
366+
/* FREQUENCY RANGE */
367+
__u32 max_cclk_frequency;
368+
__u32 min_cclk_frequency;
369+
__u32 max_gfxclk_frequency;
370+
__u32 min_gfxclk_frequency;
371+
__u32 fclk_frequency_table[4];
372+
__u32 uclk_frequency_table[4];
373+
__u32 socclk_frequency_table[4];
374+
__u32 vclk_frequency_table[4];
375+
__u32 dclk_frequency_table[4];
376+
__u32 lclk_frequency_table[4];
377+
__u32 max_lclk_dpm_range;
378+
__u32 min_lclk_dpm_range;
379+
380+
/* XGMI */
381+
__u32 xgmi_width;
382+
__u32 xgmi_bitrate;
383+
__u64 xgmi_read_bandwidth_acc[8];
384+
__u64 xgmi_write_bandwidth_acc[8];
385+
386+
/* ACTIVITY */
387+
__u32 socket_c0_residency;
388+
__u32 socket_gfx_busy;
389+
__u32 dram_bandwidth_utilization;
390+
__u64 socket_c0_residency_acc;
391+
__u64 socket_gfx_busy_acc;
392+
__u64 dram_bandwidth_acc;
393+
__u32 max_dram_bandwidth;
394+
__u64 dram_bandwidth_utilization_acc;
395+
__u64 pcie_bandwidth_acc[4];
396+
397+
/* THROTTLERS */
398+
__u32 prochot_residency_acc;
399+
__u32 ppt_residency_acc;
400+
__u32 socket_thm_residency_acc;
401+
__u32 vr_thm_residency_acc;
402+
__u32 hbm_thm_residency_acc;
403+
__u32 spare;
404+
405+
/* New items at the end to maintain driver compatibility */
406+
__u32 gfxclk_frequency[8];
298407
};
299408

300409
/* Reset to default packing */

drivers/platform/mellanox/mlxbf-bootctl.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,17 +1028,15 @@ static int mlxbf_bootctl_probe(struct platform_device *pdev)
10281028
return ret;
10291029
}
10301030

1031-
static int mlxbf_bootctl_remove(struct platform_device *pdev)
1031+
static void mlxbf_bootctl_remove(struct platform_device *pdev)
10321032
{
10331033
sysfs_remove_bin_file(&pdev->dev.kobj,
10341034
&mlxbf_bootctl_bootfifo_sysfs_attr);
1035-
1036-
return 0;
10371035
}
10381036

10391037
static struct platform_driver mlxbf_bootctl_driver = {
10401038
.probe = mlxbf_bootctl_probe,
1041-
.remove = mlxbf_bootctl_remove,
1039+
.remove_new = mlxbf_bootctl_remove,
10421040
.driver = {
10431041
.name = "mlxbf-bootctl",
10441042
.dev_groups = mlxbf_bootctl_groups,

0 commit comments

Comments
 (0)