-
Notifications
You must be signed in to change notification settings - Fork 50
Backport uncore freq driver fixes and support for agent_types and die_id sysfs attributes #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
zhang-rui
wants to merge
25
commits into
openvelinux:6.6-velinux
Choose a base branch
from
openvelinux:intel-uncore-agent
base: 6.6-velinux
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Backport uncore freq driver fixes and support for agent_types and die_id sysfs attributes #108
zhang-rui
wants to merge
25
commits into
openvelinux:6.6-velinux
from
openvelinux:intel-uncore-agent
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 9cba82b upstream. Patch series "Add helper macro DEFINE_SHOW_STORE_ATTRIBUTE() at seq_file.c", v6. We already own DEFINE_SHOW_ATTRIBUTE() helper macro for defining attribute for read-only file, but we found many of drivers also want a helper macro for read-write file too. So we add this helper macro to reduce duplicated code. This patch (of 3): We already own DEFINE_SHOW_ATTRIBUTE() helper macro for defining attribute for read-only file, but many of drivers want a helper macro for read-write file too. So we add DEFINE_SHOW_STORE_ATTRIBUTE() helper to reduce duplicated code. Intel-SIG: commit 9cba82b seq_file: add helper macro to define attribute for rw file Backport PLR (Power Limit Reasons) TPMI driver Link: https://lkml.kernel.org/r/20230905024835.43219-1-yangxingui@huawei.com Link: https://lkml.kernel.org/r/20230905024835.43219-2-yangxingui@huawei.com Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com> Co-developed-by: Xingui Yang <yangxingui@huawei.com> Signed-off-by: Xingui Yang <yangxingui@huawei.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Animesh Manna <animesh.manna@intel.com> Cc: Anshuman Gupta <anshuman.gupta@intel.com> Cc: Damien Le Moal <damien.lemoal@opensource.wdc.com> Cc: Felipe Balbi <felipe.balbi@linux.intel.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Himanshu Madhani <himanshu.madhani@cavium.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: John Garry <john.g.garry@oracle.com> Cc: Martin K. Petersen <martin.petersen@oracle.com> Cc: Uma Shankar <uma.shankar@intel.com> Cc: Xiang Chen <chenxiang66@hisilicon.com> Cc: Zeng Tao <prime.zeng@hisilicon.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> [ Zhang Rui: amend commit log ] Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 3cd39bc upstream. Touching files so used for the kernel, forces 'make' to recompile most of the kernel. Having those definitions in more granular files helps avoid recompiling so much of the kernel. Intel-SIG: commit 3cd39bc kernel.h: Move ARRAY_SIZE() to a separate header Backport PLR (Power Limit Reasons) TPMI driver Signed-off-by: Alejandro Colomar <alx@kernel.org> Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20230817143352.132583-2-lucas.segarra.fernandez@intel.com [andy: reduced to cover only string.h for now] Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> [ Zhang Rui: amend commit log ] Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit c3ed16a upstream. The commit 3cd39bc ("kernel.h: Move ARRAY_SIZE() to a separate header") introduced a new header for the ARRAY_SIZE macro which was previously exposed via linux/kernel.h. Intel-SIG: commit c3ed16a batman-adv: Switch to linux/array_size.h Backport PLR (Power Limit Reasons) TPMI driver Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> [ Zhang Rui: amend commit log ] Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit b44d79d upstream. Add TPMI ID 0x0C (Perf Limit Reasons) to the list of supported TPMI IDs. Intel-SIG: commit b44d79d platform/x86/intel/tpmi: Add support for performance limit reasons Backport PLR (Power Limit Reasons) TPMI driver Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Tero Kristo <tero.kristo@linux.intel.com> Link: https://lore.kernel.org/r/20240527133400.483634-2-tero.kristo@linux.intel.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> [ Zhang Rui: amend commit log ] Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit d36842b upstream. Add new API to get the debugfs root directory for TPMI. This allows any TPMI devices to add their own debugfs items under the same directory structure. Intel-SIG: commit d36842b platform/x86/intel/tpmi: Add API to get debugfs root Backport PLR (Power Limit Reasons) TPMI driver Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Tero Kristo <tero.kristo@linux.intel.com> Link: https://lore.kernel.org/r/20240527133400.483634-3-tero.kristo@linux.intel.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> [ Zhang Rui: amend commit log ] Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 17ca278 upstream. Each TPMI power domain includes a group of CPUs. Several power management settings in this case applicable to a group of CPUs. There can be several power domains in a CPU package. So, provide interfaces for: - Get power domain id for a Linux CPU - Get mask of Linux CPUs in a power domain Hardware Punit uses different CPU numbering, which is not based on APIC (Advanced Programmable Interrupt Controller) CPU numbering. The Linux CPU numbering is based on APIC CPU numbering. Some PM features like Intel Speed Select, the CPU core mask provided by the hardware is based on the Punit CPU numbering. To use the core mask, this mask needs to be converted to a Linux CPUs mask. So, provide interfaces for: - Convert to a Linux CPU number from a Punit CPU number - Convert to a Punit CPU number from a Linux CPU number On each CPU online, MSR 0x54 is used to read the mapping and stores in a per cpu array. Create a hash for faster searching of a Linux CPU number from a Punit CPU number. Intel-SIG: commit 17ca278 platform/x86/intel: TPMI domain id and CPU mapping Backport PLR (Power Limit Reasons) TPMI driver Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> [tero.kristo: minor updates] Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Tero Kristo <tero.kristo@linux.intel.com> Link: https://lore.kernel.org/r/20240528073457.497816-1-tero.kristo@linux.intel.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> [ Zhang Rui: amend commit log ] Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 811f67c upstream. Add new auxiliary driver that exposes the SoC performance limit reasons via debugfs interface. Intel-SIG: commit 811f67c platform/x86/intel/tpmi: Add new auxiliary driver for performance limits Backport PLR (Power Limit Reasons) TPMI driver Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Tero Kristo <tero.kristo@linux.intel.com> Link: https://lore.kernel.org/r/20240527133400.483634-5-tero.kristo@linux.intel.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> [ Zhang Rui: amend commit log ] Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 9e9397a upstream. Add support for reading fine grained power limit reasons via the PLR mailbox. Intel-SIG: commit 9e9397a platform/x86/intel/tpmi/plr: Add support for the plr mailbox Backport PLR (Power Limit Reasons) TPMI driver Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Tero Kristo <tero.kristo@linux.intel.com> Link: https://lore.kernel.org/r/20240527133400.483634-6-tero.kristo@linux.intel.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> [ Zhang Rui: amend commit log ] Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 182c694 upstream. Smatch complains that 'str' can be used without being initialized: drivers/platform/x86/intel/intel_plr_tpmi.c:178 plr_print_bits() error: uninitialized symbol 'str'. In this loop, we iterate over all the set bits and print the name of the bit. The intention is that if there is a bit which is between 0-31 we look for the name in the first array plr_coarse_reasons[] which has 10 elements. If the bit is in the 32-63 range we look for it in the plr_fine_reasons[] array which has 30 elements. If the bit is in the invalid ranges, 10-31 or 62-63, then we should print "UNKNOWN(%d)". The problem is that 'str' needs to be initialized at the start of each iteration, otherwise if we can't find the string then instead of printing "UNKNOWN(%d)", we will re-print whatever the previous bit was. Intel-SIG: commit 182c694 platform/x86/intel/tpmi/plr: Fix output in plr_print_bits() Backport PLR (Power Limit Reasons) TPMI driver Fixes: 9e9397a ("platform/x86/intel/tpmi/plr: Add support for the plr mailbox") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/b0084e70-4144-445a-9b89-fb19f6b8336a@stanley.mountain Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> [ Zhang Rui: amend commit log ] Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit bee9a0838fd223823e5a6d85c055ab1691dc738e upstream. Add Clearwater Forest support (INTEL_ATOM_DARKMONT_X) to tpmi_cpu_ids to support domaid id mappings. Intel-SIG: commit bee9a0838fd2 platform/x86/intel: power-domains: Add Clearwater Forest support Backport PLR (Power Limit Reasons) TPMI driver Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Link: https://lore.kernel.org/r/20250103155255.1488139-1-srinivas.pandruvada@linux.intel.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> [ Zhang Rui: amend commit log ] Signed-off-by: Zhang Rui <rui.zhang@intel.com>
…for package ID commit aa28991fd5dc4c01a40caab2bd9af8c5e06f9899 upstream. Currently, tpmi_get_logical_id() calls topology_physical_package_id() to set the pkg_id of the info structure. Since some VM hosts assign non contiguous package IDs, topology_physical_package_id() can return a larger value than topology_max_packages(). This will result in an invalid reference into tpmi_power_domain_mask[] as that is allocatead based on topology_max_packages() as the maximum package ID. Intel-SIG: commit aa28991fd5dc platform/x86/intel: power-domains: Use topology_logical_package_id() for package ID Backport PLR (Power Limit Reasons) TPMI driver Fixes: 17ca278 ("platform/x86/intel: TPMI domain id and CPU mapping") Signed-off-by: David Arcari <darcari@redhat.com> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Link: https://lore.kernel.org/r/20250829113859.1772827-1-darcari@redhat.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> [ Zhang Rui: amend commit log ] Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Enable PLR (Perf Limit Reasons) driver. Signed-off-by: Zhang Rui <rui.zhang@intel.com>
…omain commit bb9a9bf upstream. The scope of uncore control is per power domain with TPMI. There are two types of processor topologies can be presented by CPUID extended topology leaf irrespective of the hardware architecture: 1. A die is not enumerated in CPUID. In this case there is only one die in a package is visible. In this case there can be multiple power domains in a single die. 2. A power domain in a package is enumerated as a die in CPUID. So there is one power domain per die. To allow die level controls, the current implementation creates a root domain and aggregates all information from power domains in it. This is well suited for configuration 1 above. But for configuration 2 above, the root domain will present the same information as present by power domain. So, no use of aggregating. To check the configuration, call topology_max_dies_per_package(). If it is more than one, avoid creating root domain. Intel-SIG: commit bb9a9bf platform/x86/intel-uncore-freq: Do not present separate package-die domain. Backport Intel uncore-freq driver elc support and update Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20240820204558.1296319-1-srinivas.pandruvada@linux.intel.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> [ Yingbao Jia: amend commit log ] Signed-off-by: Yingbao Jia <yingbao.jia@intel.com>
…ntrol commit bb516dc upstream. Add efficiency latency control support to the TPMI uncore driver. This defines two new threshold values for controlling uncore frequency, low threshold and high threshold. When CPU utilization is below low threshold, the user configurable floor latency control frequency can be used by the system. When CPU utilization is above high threshold, the uncore frequency is increased in 100MHz steps until power limit is reached. Intel-SIG: commit bb516dc platform/x86/intel-uncore-freq: Add support for efficiency latency control. Backport Intel uncore-freq driver elc support and update Signed-off-by: Tero Kristo <tero.kristo@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20240828153657.1296410-3-tero.kristo@linux.intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com> [ Yingbao Jia: amend commit log ] Signed-off-by: Yingbao Jia <yingbao.jia@intel.com>
…fs interface commit 24b6616 upstream. Add the TPMI efficiency latency control fields to the sysfs interface. The sysfs files are mapped to the TPMI uncore driver via the registered uncore_read and uncore_write driver callbacks. These fields are not populated on older non TPMI hardware. Intel-SIG: commit 24b6616 platform/x86/intel-uncore-freq: Add efficiency latency control to sysfs interface. Backport Intel uncore-freq driver elc support and update Signed-off-by: Tero Kristo <tero.kristo@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20240828153657.1296410-4-tero.kristo@linux.intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com> [ Yingbao Jia: amend commit log ] Signed-off-by: Yingbao Jia <yingbao.jia@intel.com>
commit b98fa870fce2335433f20b2213e526b8d99e15dc upstream. Currently, users need detailed hardware information to understand the scope of controls within each uncore domain. Uncore frequency controls manage subsystems such as core, cache, memory, and I/O. The UFS TPMI provides this information, which can be used to present the scope more clearly. Each uncore domain consists of one or more agent types, with each agent type controlling one or more uncore hardware subsystems. For example, a single agent might control both the core and cache. Introduce a new attribute called "agent_types." This attribute displays a list of agents, separated by space character. The string representations for agent types are as follows: For core agent: core For cache agent: cache For memory agent: memory For I/O agent: io These agent types are read during probe time for each cluster and stored as part of the struct uncore_data. Intel-SIG: commit b98fa870fce2 platform/x86/intel-uncore-freq: Add attributes to show agent types Backport uncore freq driver fixes and support for agent_types and die_id sysfs attributes Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Link: https://lore.kernel.org/r/20250508230250.1186619-2-srinivas.pandruvada@linux.intel.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> [ Zhang Rui: amend commit log ] Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit bfbe7729d6dd2e2c8ef44f9179ad11ab766150e6 upstream. Add documentation to describe agent_types attribute. Intel-SIG: commit bfbe7729d6dd Documentation: admin-guide: pm: Add documentation for agent_types Backport uncore freq driver fixes and support for agent_types and die_id sysfs attributes Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20250508230250.1186619-3-srinivas.pandruvada@linux.intel.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> [ Zhang Rui: amend commit log ] Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit e37be5d85c602e07c1e2930c2cc98ebd46f9ecf7 upstream. The die ID in the Linux topology sysfs is a logical identifier that differs from the one presented in CPUID leaf 0x1F or via MSR 0x54. Introduce an interface that returns the Linux CPU die ID based on a given package ID and power domain ID. This mapping is stored during the CPU online callback in an array. Intel-SIG: commit e37be5d85c60 platform/x86/intel: power-domains: Add interface to get Linux die ID Backport uncore freq driver fixes and support for agent_types and die_id sysfs attributes Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20250508230250.1186619-4-srinivas.pandruvada@linux.intel.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> [ Zhang Rui: resolve conflict and amend commit log ] Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 247b43fcd8722914282fbd432e9cc41cd3971e31 upstream. For domains with agents to control cores (compute dies) show matching Linux CPU die ID. Linux CPU ID is a logical die ID, so this may not match physical die ID or domain_id. So, a mapping is required to get Linux CPU die ID. This attribute is only presented when CPUID enumerates die ids. This attribute can be used by orchestration software like Kubernetes to target specific dies for uncore frequency control. Intel-SIG: commit 247b43fcd872 platform/x86/intel-uncore-freq: Add attributes to show die_id Backport uncore freq driver fixes and support for agent_types and die_id sysfs attributes Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20250508230250.1186619-5-srinivas.pandruvada@linux.intel.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> [ Zhang Rui: resolve conflict (use old x86 Macro) and amend commit log ] Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit e636e3f7421b2ff8e706a835f78f071cb0d8e197 upstream. Add documentation to describe die_id attribute. Intel-SIG: commit e636e3f7421b Documentation: admin-guide: pm: Add documentation for die_id Backport uncore freq driver fixes and support for agent_types and die_id sysfs attributes Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20250508230250.1186619-6-srinivas.pandruvada@linux.intel.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> [ Zhang Rui: amend commit log ] Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 0c44b46f51a17baa7ab67de1464427116e9c4eaa upstream.
Using a string variable in place of a format string causes a W=1 build warning:
drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c:61:40: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
61 | length += sysfs_emit_at(buf, length, agent_name[agent]);
| ^~~~~~~~~~~~~~~~~
Use the safer "%s" format string to print it instead.
Intel-SIG: commit 0c44b46f51a1 platform/x86/intel-uncore-freq: avoid non-literal format string
Backport uncore freq driver fixes and support for agent_types and die_id sysfs attributes
Fixes: b98fa870fce2 ("platform/x86/intel-uncore-freq: Add attributes to show agent types")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/r/20250610093459.2646337-1-arnd@kernel.org
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 6d47b4f08436cb682fb2644e6265a3897fd42a77 upstream. A partitioned system configured with only one package and one compute die, warning will be generated for duplicate sysfs entry. This typically occurs during the platform bring-up phase. Partitioned systems expose dies, equivalent to TPMI compute domains, through the CPUID. Each partitioned system must contains at least one compute die per partition, resulting in a minimum of two dies per package. Hence the function topology_max_dies_per_package() returns at least two, and the condition "topology_max_dies_per_package() > 1" prevents the creation of a root domain. In this case topology_max_dies_per_package() will return 1 and root domain will be created for partition 0 and a duplicate sysfs warning for partition 1 as both partitions have same package ID. To address this also check for non zero partition in addition to topology_max_dies_per_package() > 1. Intel-SIG: commit 6d47b4f08436 platform/x86/intel-uncore-freq: Fix warning in partitioned system Backport uncore freq driver fixes and support for agent_types and die_id sysfs attributes Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Link: https://lore.kernel.org/r/20250819211034.3776284-1-srinivas.pandruvada@linux.intel.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> [ Zhang Rui: resolve conflict (use old topo Macro) and amend commit log ] Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit a191224186ec16a4cb1775b2a647ea91f5c139e1 upstream. In partitioned systems, the domain ID is unique in the partition and a package can have multiple partitions. Some user-space tools, such as turbostat, assume the domain ID is unique per package. These tools map CPU power domains, which are unique to a package. However, this approach does not work in partitioned systems. There is no architectural definition of "partition" to present to user space. To support these tools, set the domain_id to be unique per package. For compute die IDs, uniqueness can be achieved using the platform info cdie_mask, mirroring the behavior observed in non-partitioned systems. For IO dies, which lack a direct CPU relationship, any unique logical ID can be assigned. Here domain IDs for IO dies are configured after all compute domain IDs. During the probe, keep the index of the next IO domain ID after the last IO domain ID of the current partition. Since CPU packages are symmetric, partition information is same for all packages. The Intel Speed Select driver has already implemented a similar change to make the domain ID unique, with compute dies listed first, followed by I/O dies. Intel-SIG: commit a191224186ec platform/x86/intel-uncore-freq: Present unique domain ID per package Backport uncore freq driver fixes and support for agent_types and die_id sysfs attributes Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Link: https://lore.kernel.org/r/20250903191154.1081159-1-srinivas.pandruvada@linux.intel.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> [ Zhang Rui: resolve conflict (use old topo Macro) and amend commit log ] Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit 1d0a61940e22e165e6acc4a9c6fb26edbe69112e upstream.
Return -ENOMEM instead of success if kcalloc() fails.
Intel-SIG: commit 1d0a61940e22 platform/x86/intel: power-domains: Fix error code in tpmi_init()
Backport uncore freq driver fixes and support for agent_types and die_id sysfs attributes
Fixes: e37be5d85c60 ("platform/x86/intel: power-domains: Add interface to get Linux die ID")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/aEKvIGCt6d8Gcx4S@stanley.mountain
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
[ Zhang Rui: amend commit log ]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
commit db30233361f94e1a84450c607989bdb671100fb6 upstream. In file uncore-frequency/uncore-frequency-common.h, correct all kernel-doc warnings by adding missing leading " *" to some lines, adding a missing kernel-doc entry, and fixing a name typo. Warning: uncore-frequency-common.h:50 bad line: Storage for kobject attribute elc_low_threshold_percent Warning: uncore-frequency-common.h:52 bad line: Storage for kobject attribute elc_high_threshold_percent Warning: uncore-frequency-common.h:54 bad line: Storage for kobject attribute elc_high_threshold_enable Warning: uncore-frequency-common.h:92 struct member 'min_freq_khz_kobj_attr' not described in 'uncore_data' Warning: uncore-frequency-common.h:92 struct member 'die_id_kobj_attr' not described in 'uncore_data' Intel-SIG: commit db30233361f9 platform/x86: intel-uncore-freq: fix all header kernel-doc warnings Backport uncore freq driver fixes and support for agent_types and die_id sysfs attributes Fixes: 24b6616 ("platform/x86/intel-uncore-freq: Add efficiency latency control to sysfs interface") Fixes: 416de02 ("platform/x86: intel-uncore-freq: Fix types in sysfs callbacks") Fixes: 247b43fcd872 ("platform/x86/intel-uncore-freq: Add attributes to show die_id") Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Link: https://patch.msgid.link/20251111060938.1998542-1-rdunlap@infradead.org Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> [ Zhang Rui: amend commit log ] Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport uncore freq driver fixes and support for agent_types and die_id sysfs attributes
Test:
Tested on GNR and CWF.
/sys/devices/system/cpu/intel_uncore_frequency/uncoreXX/agent_types attribute becomes available after applying this patch series, with correct agent type information shown.
Note that, this PR depends on PR #95 and PR #48.
commits 1-12 are from PR #95.
commits 13-15 are from PR #48.
1: seq_file: add helper macro to define attribute for rw file
2: kernel.h: Move ARRAY_SIZE() to a separate header
3: batman-adv: Switch to linux/array_size.h
4: platform/x86/intel/tpmi: Add support for performance limit reasons
5: platform/x86/intel/tpmi: Add API to get debugfs root
6: platform/x86/intel: TPMI domain id and CPU mapping
7: platform/x86/intel/tpmi: Add new auxiliary driver for performance limits
8: platform/x86/intel/tpmi/plr: Add support for the plr mailbox
9: platform/x86/intel/tpmi/plr: Fix output in plr_print_bits()
10: platform/x86/intel: power-domains: Add Clearwater Forest support
11: platform/x86/intel: power-domains: Use topology_logical_package_id() for package ID
12: config: enable CONFIG_INTEL_PLR_TPMI
13: platform/x86/intel-uncore-freq: Do not present separate package-die domain
14: platform/x86/intel-uncore-freq: Add support for efficiency latency control
15: platform/x86/intel-uncore-freq: Add efficiency latency control to sysfs interface
16: platform/x86/intel-uncore-freq: Add attributes to show agent types
17: Documentation: admin-guide: pm: Add documentation for agent_types
18: platform/x86/intel: power-domains: Add interface to get Linux die ID
19: platform/x86/intel-uncore-freq: Add attributes to show die_id
20: Documentation: admin-guide: pm: Add documentation for die_id
21: platform/x86/intel-uncore-freq: avoid non-literal format string
22: platform/x86/intel-uncore-freq: Fix warning in partitioned system
23: platform/x86/intel-uncore-freq: Present unique domain ID per package
24: platform/x86/intel: power-domains: Fix error code in tpmi_init()
25: platform/x86: intel-uncore-freq: fix all header kernel-doc warnings