summaryrefslogtreecommitdiff
path: root/tools/power/x86/intel-speed-select/isst-daemon.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-10-05 10:38:24 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2022-10-05 10:38:24 -0700
commit7fb68b6c821be7165d5be5d8801d909912af9159 (patch)
tree2a5437907a8238fc2789f8aa53fec835f7200a9e /tools/power/x86/intel-speed-select/isst-daemon.c
parent1c2daf52185bbc91421f0e84e6bf2706bb350cce (diff)
parent8d05fc039456517d2c246c7b202891188ba40c4d (diff)
downloadlinux-stable-7fb68b6c821be7165d5be5d8801d909912af9159.tar.gz
Merge tag 'platform-drivers-x86-v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
Pull x86 platform driver updates from Hans de Goede: - AMD Platform Management Framework (PMF) driver with AMT and QnQF support - AMD PMC: Improved logging for debugging s2idle issues - Big refactor of the ACPI/x86 backlight handling, ensuring that we only register 1 /sys/class/backlight device per LCD panel - Microsoft Surface: - Surface Laptop Go 2 support - Surface Pro 8 HID sensor support - Asus WMI: - Lots of cleanups - Support for TUF RGB keyboard backlight control - Add support for ROG X13 tablet mode - Siemens Simatic: IPC227G and IPC427G support - Toshiba ACPI laptop driver: Fan hwmon and battery ECO mode support - tools/power/x86/intel-speed-select: Various improvements - Various cleanups - Various small bugfixes * tag 'platform-drivers-x86-v6.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (153 commits) platform/x86: use PLATFORM_DEVID_NONE instead of -1 platform/x86/amd: pmc: Dump idle mask during "check" stage instead platform/x86/intel/wmi: thunderbolt: Use dev_groups callback platform/x86/amd: pmc: remove CONFIG_DEBUG_FS checks platform/surface: Split memcpy() of struct ssam_event flexible array platform/x86: compal-laptop: Get rid of a few forward declarations platform/x86: intel-uncore-freq: Use sysfs_emit() to instead of scnprintf() platform/x86: dell-smbios-base: Use sysfs_emit() platform/x86/amd/pmf: Remove unused power_delta instances platform/x86/amd/pmf: install notify handler after acpi init Documentation/ABI/testing/sysfs-amd-pmf: Add ABI doc for AMD PMF platform/x86/amd/pmf: Add sysfs to toggle CnQF platform/x86/amd/pmf: Add support for CnQF platform/x86/amd: pmc: Fix build without debugfs platform/x86: hp-wmi: Support touchpad on/off platform/x86: int3472/discrete: Drop a forward declaration platform/x86: toshiba_acpi: change turn_on_panel_on_resume to static platform/x86: wmi: Drop forward declaration of static functions platform/x86: toshiba_acpi: Remove duplicate include platform/x86: msi-laptop: Change DMI match / alias strings to fix module autoloading ...
Diffstat (limited to 'tools/power/x86/intel-speed-select/isst-daemon.c')
-rw-r--r--tools/power/x86/intel-speed-select/isst-daemon.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/tools/power/x86/intel-speed-select/isst-daemon.c b/tools/power/x86/intel-speed-select/isst-daemon.c
index d0400c6684ba..0699137c0901 100644
--- a/tools/power/x86/intel-speed-select/isst-daemon.c
+++ b/tools/power/x86/intel-speed-select/isst-daemon.c
@@ -32,62 +32,60 @@ static void init_levels(void)
per_package_levels_info[i][j] = -1;
}
-void process_level_change(int cpu)
+void process_level_change(struct isst_id *id)
{
struct isst_pkg_ctdp_level_info ctdp_level;
- int pkg_id = get_physical_package_id(cpu);
- int die_id = get_physical_die_id(cpu);
struct isst_pkg_ctdp pkg_dev;
time_t tm;
int ret;
- if (pkg_id >= MAX_PACKAGE_COUNT || die_id >= MAX_DIE_PER_PACKAGE) {
- debug_printf("Invalid package/die info for cpu:%d\n", cpu);
+ if (id->pkg < 0 || id->die < 0) {
+ debug_printf("Invalid package/die info for cpu:%d\n", id->cpu);
return;
}
tm = time(NULL);
- if (tm - per_package_levels_tm[pkg_id][die_id] < 2 )
+ if (tm - per_package_levels_tm[id->pkg][id->die] < 2)
return;
- per_package_levels_tm[pkg_id][die_id] = tm;
+ per_package_levels_tm[id->pkg][id->die] = tm;
- ret = isst_get_ctdp_levels(cpu, &pkg_dev);
+ ret = isst_get_ctdp_levels(id, &pkg_dev);
if (ret) {
- debug_printf("Can't get tdp levels for cpu:%d\n", cpu);
+ debug_printf("Can't get tdp levels for cpu:%d\n", id->cpu);
return;
}
- debug_printf("Get Config level %d pkg:%d die:%d current_level:%d \n", cpu,
- pkg_id, die_id, pkg_dev.current_level);
+ debug_printf("Get Config level %d pkg:%d die:%d current_level:%d\n", id->cpu,
+ id->pkg, id->die, pkg_dev.current_level);
if (pkg_dev.locked) {
debug_printf("config TDP s locked \n");
return;
}
- if (per_package_levels_info[pkg_id][die_id] == pkg_dev.current_level)
+ if (per_package_levels_info[id->pkg][id->die] == pkg_dev.current_level)
return;
debug_printf("**Config level change for cpu:%d pkg:%d die:%d from %d to %d\n",
- cpu, pkg_id, die_id, per_package_levels_info[pkg_id][die_id],
+ id->cpu, id->pkg, id->die, per_package_levels_info[id->pkg][id->die],
pkg_dev.current_level);
- per_package_levels_info[pkg_id][die_id] = pkg_dev.current_level;
+ per_package_levels_info[id->pkg][id->die] = pkg_dev.current_level;
ctdp_level.core_cpumask_size =
alloc_cpu_set(&ctdp_level.core_cpumask);
- ret = isst_get_coremask_info(cpu, pkg_dev.current_level, &ctdp_level);
+ ret = isst_get_coremask_info(id, pkg_dev.current_level, &ctdp_level);
if (ret) {
free_cpu_set(ctdp_level.core_cpumask);
- debug_printf("Can't get core_mask:%d\n", cpu);
+ debug_printf("Can't get core_mask:%d\n", id->cpu);
return;
}
if (ctdp_level.cpu_count) {
int i, max_cpus = get_topo_max_cpus();
for (i = 0; i < max_cpus; ++i) {
- if (pkg_id != get_physical_package_id(i) || die_id != get_physical_die_id(i))
+ if (!is_cpu_in_power_domain(i, id))
continue;
if (CPU_ISSET_S(i, ctdp_level.core_cpumask_size, ctdp_level.core_cpumask)) {
fprintf(stderr, "online cpu %d\n", i);
@@ -102,10 +100,10 @@ void process_level_change(int cpu)
free_cpu_set(ctdp_level.core_cpumask);
}
-static void _poll_for_config_change(int cpu, void *arg1, void *arg2,
+static void _poll_for_config_change(struct isst_id *id, void *arg1, void *arg2,
void *arg3, void *arg4)
{
- process_level_change(cpu);
+ process_level_change(id);
}
static void poll_for_config_change(void)