* [PATCH AUTOSEL 6.12 002/486] x86/fred: Fix system hang during S4 resume with FRED enabled
[not found] <20250505223922.2682012-1-sashal@kernel.org>
@ 2025-05-05 22:31 ` Sasha Levin
2025-05-05 22:31 ` [PATCH AUTOSEL 6.12 037/486] thermal/drivers/mediatek/lvts: Start sensor interrupts disabled Sasha Levin
` (7 subsequent siblings)
8 siblings, 0 replies; 9+ messages in thread
From: Sasha Levin @ 2025-05-05 22:31 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Xin Li (Intel), Xi Pardee, Todd Brandt, H . Peter Anvin,
Ingo Molnar, Rafael J . Wysocki, Andy Lutomirski, Brian Gerst,
Juergen Gross, Linus Torvalds, Sasha Levin, rafael, pavel, tglx,
mingo, bp, dave.hansen, x86, linux-pm
From: "Xin Li (Intel)" <xin@zytor.com>
[ Upstream commit e5f1e8af9c9e151ecd665f6d2e36fb25fec3b110 ]
Upon a wakeup from S4, the restore kernel starts and initializes the
FRED MSRs as needed from its perspective. It then loads a hibernation
image, including the image kernel, and attempts to load image pages
directly into their original page frames used before hibernation unless
those frames are currently in use. Once all pages are moved to their
original locations, it jumps to a "trampoline" page in the image kernel.
At this point, the image kernel takes control, but the FRED MSRs still
contain values set by the restore kernel, which may differ from those
set by the image kernel before hibernation. Therefore, the image kernel
must ensure the FRED MSRs have the same values as before hibernation.
Since these values depend only on the location of the kernel text and
data, they can be recomputed from scratch.
Reported-by: Xi Pardee <xi.pardee@intel.com>
Reported-by: Todd Brandt <todd.e.brandt@intel.com>
Tested-by: Todd Brandt <todd.e.brandt@intel.com>
Suggested-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Signed-off-by: Xin Li (Intel) <xin@zytor.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20250401075728.3626147-1-xin@zytor.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/power/cpu.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c
index 63230ff8cf4f0..08e76a5ca1553 100644
--- a/arch/x86/power/cpu.c
+++ b/arch/x86/power/cpu.c
@@ -27,6 +27,7 @@
#include <asm/mmu_context.h>
#include <asm/cpu_device_id.h>
#include <asm/microcode.h>
+#include <asm/fred.h>
#ifdef CONFIG_X86_32
__visible unsigned long saved_context_ebx;
@@ -231,6 +232,19 @@ static void notrace __restore_processor_state(struct saved_context *ctxt)
*/
#ifdef CONFIG_X86_64
wrmsrl(MSR_GS_BASE, ctxt->kernelmode_gs_base);
+
+ /*
+ * Reinitialize FRED to ensure the FRED MSRs contain the same values
+ * as before hibernation.
+ *
+ * Note, the setup of FRED RSPs requires access to percpu data
+ * structures. Therefore, FRED reinitialization can only occur after
+ * the percpu access pointer (i.e., MSR_GS_BASE) is restored.
+ */
+ if (ctxt->cr4 & X86_CR4_FRED) {
+ cpu_init_fred_exceptions();
+ cpu_init_fred_rsps();
+ }
#else
loadsegment(fs, __KERNEL_PERCPU);
#endif
--
2.39.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH AUTOSEL 6.12 037/486] thermal/drivers/mediatek/lvts: Start sensor interrupts disabled
[not found] <20250505223922.2682012-1-sashal@kernel.org>
2025-05-05 22:31 ` [PATCH AUTOSEL 6.12 002/486] x86/fred: Fix system hang during S4 resume with FRED enabled Sasha Levin
@ 2025-05-05 22:31 ` Sasha Levin
2025-05-05 22:31 ` [PATCH AUTOSEL 6.12 038/486] thermal/drivers/qoriq: Power down TMU on system suspend Sasha Levin
` (6 subsequent siblings)
8 siblings, 0 replies; 9+ messages in thread
From: Sasha Levin @ 2025-05-05 22:31 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Nícolas F. R. A. Prado, AngeloGioacchino Del Regno,
Daniel Lezcano, Sasha Levin, rafael, matthias.bgg, jpanis, npitre,
colin.i.king, u.kleine-koenig, wenst, linux-pm, linux-arm-kernel,
linux-mediatek
From: Nícolas F. R. A. Prado <nfraprado@collabora.com>
[ Upstream commit 2738fb3ec6838a10d2c4ce65cefdb3b90b11bd61 ]
Interrupts are enabled per sensor in lvts_update_irq_mask() as needed,
there's no point in enabling all of them during initialization. Change
the MONINT register initial value so all sensor interrupts start
disabled.
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Link: https://lore.kernel.org/r/20250113-mt8192-lvts-filtered-suspend-fix-v2-4-07a25200c7c6@collabora.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/thermal/mediatek/lvts_thermal.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c
index 4b3225377e8f8..3295b27ab70d2 100644
--- a/drivers/thermal/mediatek/lvts_thermal.c
+++ b/drivers/thermal/mediatek/lvts_thermal.c
@@ -65,7 +65,6 @@
#define LVTS_HW_FILTER 0x0
#define LVTS_TSSEL_CONF 0x13121110
#define LVTS_CALSCALE_CONF 0x300
-#define LVTS_MONINT_CONF 0x0300318C
#define LVTS_MONINT_OFFSET_SENSOR0 0xC
#define LVTS_MONINT_OFFSET_SENSOR1 0x180
@@ -929,7 +928,7 @@ static int lvts_irq_init(struct lvts_ctrl *lvts_ctrl)
* The LVTS_MONINT register layout is the same as the LVTS_MONINTSTS
* register, except we set the bits to enable the interrupt.
*/
- writel(LVTS_MONINT_CONF, LVTS_MONINT(lvts_ctrl->base));
+ writel(0, LVTS_MONINT(lvts_ctrl->base));
return 0;
}
--
2.39.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH AUTOSEL 6.12 038/486] thermal/drivers/qoriq: Power down TMU on system suspend
[not found] <20250505223922.2682012-1-sashal@kernel.org>
2025-05-05 22:31 ` [PATCH AUTOSEL 6.12 002/486] x86/fred: Fix system hang during S4 resume with FRED enabled Sasha Levin
2025-05-05 22:31 ` [PATCH AUTOSEL 6.12 037/486] thermal/drivers/mediatek/lvts: Start sensor interrupts disabled Sasha Levin
@ 2025-05-05 22:31 ` Sasha Levin
2025-05-05 22:34 ` [PATCH AUTOSEL 6.12 167/486] cpufreq: tegra186: Share policy per cluster Sasha Levin
` (5 subsequent siblings)
8 siblings, 0 replies; 9+ messages in thread
From: Sasha Levin @ 2025-05-05 22:31 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Alice Guo, Frank Li, Daniel Lezcano, Sasha Levin, rafael,
linux-pm
From: Alice Guo <alice.guo@nxp.com>
[ Upstream commit 229f3feb4b0442835b27d519679168bea2de96c2 ]
Enable power-down of TMU (Thermal Management Unit) for TMU version 2 during
system suspend to save power. Save approximately 4.3mW on VDD_ANA_1P8 on
i.MX93 platforms.
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20241209164859.3758906-2-Frank.Li@nxp.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/thermal/qoriq_thermal.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/thermal/qoriq_thermal.c b/drivers/thermal/qoriq_thermal.c
index 52e26be8c53df..aed2729f63d06 100644
--- a/drivers/thermal/qoriq_thermal.c
+++ b/drivers/thermal/qoriq_thermal.c
@@ -18,6 +18,7 @@
#define SITES_MAX 16
#define TMR_DISABLE 0x0
#define TMR_ME 0x80000000
+#define TMR_CMD BIT(29)
#define TMR_ALPF 0x0c000000
#define TMR_ALPF_V2 0x03000000
#define TMTMIR_DEFAULT 0x0000000f
@@ -356,6 +357,12 @@ static int qoriq_tmu_suspend(struct device *dev)
if (ret)
return ret;
+ if (data->ver > TMU_VER1) {
+ ret = regmap_set_bits(data->regmap, REGS_TMR, TMR_CMD);
+ if (ret)
+ return ret;
+ }
+
clk_disable_unprepare(data->clk);
return 0;
@@ -370,6 +377,12 @@ static int qoriq_tmu_resume(struct device *dev)
if (ret)
return ret;
+ if (data->ver > TMU_VER1) {
+ ret = regmap_clear_bits(data->regmap, REGS_TMR, TMR_CMD);
+ if (ret)
+ return ret;
+ }
+
/* Enable monitoring */
return regmap_update_bits(data->regmap, REGS_TMR, TMR_ME, TMR_ME);
}
--
2.39.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH AUTOSEL 6.12 167/486] cpufreq: tegra186: Share policy per cluster
[not found] <20250505223922.2682012-1-sashal@kernel.org>
` (2 preceding siblings ...)
2025-05-05 22:31 ` [PATCH AUTOSEL 6.12 038/486] thermal/drivers/qoriq: Power down TMU on system suspend Sasha Levin
@ 2025-05-05 22:34 ` Sasha Levin
2025-05-05 22:35 ` [PATCH AUTOSEL 6.12 260/486] cpuidle: menu: Avoid discarding useful information Sasha Levin
` (4 subsequent siblings)
8 siblings, 0 replies; 9+ messages in thread
From: Sasha Levin @ 2025-05-05 22:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Aaron Kling, Sumit Gupta, Thierry Reding, Aaron Kling,
Viresh Kumar, Sasha Levin, rafael, thierry.reding, jonathanh,
linux-pm, linux-tegra
From: Aaron Kling <luceoscutum@gmail.com>
[ Upstream commit be4ae8c19492cd6d5de61ccb34ffb3f5ede5eec8 ]
This functionally brings tegra186 in line with tegra210 and tegra194,
sharing a cpufreq policy between all cores in a cluster.
Reviewed-by: Sumit Gupta <sumitg@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cpufreq/tegra186-cpufreq.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/cpufreq/tegra186-cpufreq.c b/drivers/cpufreq/tegra186-cpufreq.c
index 7b8fcfa55038b..4e5b6f9a56d1b 100644
--- a/drivers/cpufreq/tegra186-cpufreq.c
+++ b/drivers/cpufreq/tegra186-cpufreq.c
@@ -73,11 +73,18 @@ static int tegra186_cpufreq_init(struct cpufreq_policy *policy)
{
struct tegra186_cpufreq_data *data = cpufreq_get_driver_data();
unsigned int cluster = data->cpus[policy->cpu].bpmp_cluster_id;
+ u32 cpu;
policy->freq_table = data->clusters[cluster].table;
policy->cpuinfo.transition_latency = 300 * 1000;
policy->driver_data = NULL;
+ /* set same policy for all cpus in a cluster */
+ for (cpu = 0; cpu < ARRAY_SIZE(tegra186_cpus); cpu++) {
+ if (data->cpus[cpu].bpmp_cluster_id == cluster)
+ cpumask_set_cpu(cpu, policy->cpus);
+ }
+
return 0;
}
--
2.39.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH AUTOSEL 6.12 260/486] cpuidle: menu: Avoid discarding useful information
[not found] <20250505223922.2682012-1-sashal@kernel.org>
` (3 preceding siblings ...)
2025-05-05 22:34 ` [PATCH AUTOSEL 6.12 167/486] cpufreq: tegra186: Share policy per cluster Sasha Levin
@ 2025-05-05 22:35 ` Sasha Levin
2025-05-05 22:36 ` [PATCH AUTOSEL 6.12 292/486] power: supply: axp20x_battery: Update temp sensor for AXP717 from device tree Sasha Levin
` (3 subsequent siblings)
8 siblings, 0 replies; 9+ messages in thread
From: Sasha Levin @ 2025-05-05 22:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Rafael J. Wysocki, Artem Bityutskiy, Christian Loehle,
Aboorva Devarajan, Sasha Levin, rafael, daniel.lezcano, linux-pm
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
[ Upstream commit 85975daeaa4d6ec560bfcd354fc9c08ad7f38888 ]
When giving up on making a high-confidence prediction,
get_typical_interval() always returns UINT_MAX which means that the
next idle interval prediction will be based entirely on the time till
the next timer. However, the information represented by the most
recent intervals may not be completely useless in those cases.
Namely, the largest recent idle interval is an upper bound on the
recently observed idle duration, so it is reasonable to assume that
the next idle duration is unlikely to exceed it. Moreover, this is
still true after eliminating the suspected outliers if the sample
set still under consideration is at least as large as 50% of the
maximum sample set size.
Accordingly, make get_typical_interval() return the current maximum
recent interval value in that case instead of UINT_MAX.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reported-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Tested-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Reviewed-by: Christian Loehle <christian.loehle@arm.com>
Tested-by: Christian Loehle <christian.loehle@arm.com>
Tested-by: Aboorva Devarajan <aboorvad@linux.ibm.com>
Link: https://patch.msgid.link/7770672.EvYhyI6sBW@rjwysocki.net
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
| 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
--git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index f3c9d49f0f2a5..97ffadc7e57a6 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -239,8 +239,19 @@ static unsigned int get_typical_interval(struct menu_device *data)
* This can deal with workloads that have long pauses interspersed
* with sporadic activity with a bunch of short pauses.
*/
- if ((divisor * 4) <= INTERVALS * 3)
+ if (divisor * 4 <= INTERVALS * 3) {
+ /*
+ * If there are sufficiently many data points still under
+ * consideration after the outliers have been eliminated,
+ * returning without a prediction would be a mistake because it
+ * is likely that the next interval will not exceed the current
+ * maximum, so return the latter in that case.
+ */
+ if (divisor >= INTERVALS / 2)
+ return max;
+
return UINT_MAX;
+ }
thresh = max - 1;
goto again;
--
2.39.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH AUTOSEL 6.12 292/486] power: supply: axp20x_battery: Update temp sensor for AXP717 from device tree
[not found] <20250505223922.2682012-1-sashal@kernel.org>
` (4 preceding siblings ...)
2025-05-05 22:35 ` [PATCH AUTOSEL 6.12 260/486] cpuidle: menu: Avoid discarding useful information Sasha Levin
@ 2025-05-05 22:36 ` Sasha Levin
2025-05-05 22:36 ` [PATCH AUTOSEL 6.12 308/486] pmdomain: imx: gpcv2: use proper helper for property detection Sasha Levin
` (2 subsequent siblings)
8 siblings, 0 replies; 9+ messages in thread
From: Sasha Levin @ 2025-05-05 22:36 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Chris Morgan, Philippe Simons, Sebastian Reichel, Sasha Levin,
sre, wens, linux-pm
From: Chris Morgan <macromorgan@hotmail.com>
[ Upstream commit bbcfe510ecd47f2db4c8653c7dfa9dc7a55b1583 ]
Allow a boolean property of "x-powers,no-thermistor" to specify devices
where the ts pin is not connected to anything. This works around an
issue found with some devices where the efuse is not programmed
correctly from the factory or when the register gets set erroneously.
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Tested-by: Philippe Simons <simons.philippe@gmail.com>
Link: https://lore.kernel.org/r/20250204155835.161973-4-macroalpha82@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/axp20x_battery.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/power/supply/axp20x_battery.c b/drivers/power/supply/axp20x_battery.c
index 57eba1ddb17ba..88fbae613e8bc 100644
--- a/drivers/power/supply/axp20x_battery.c
+++ b/drivers/power/supply/axp20x_battery.c
@@ -89,6 +89,8 @@
#define AXP717_BAT_CC_MIN_UA 0
#define AXP717_BAT_CC_MAX_UA 3008000
+#define AXP717_TS_PIN_DISABLE BIT(4)
+
struct axp20x_batt_ps;
struct axp_data {
@@ -117,6 +119,7 @@ struct axp20x_batt_ps {
/* Maximum constant charge current */
unsigned int max_ccc;
const struct axp_data *data;
+ bool ts_disable;
};
static int axp20x_battery_get_max_voltage(struct axp20x_batt_ps *axp20x_batt,
@@ -983,6 +986,24 @@ static void axp717_set_battery_info(struct platform_device *pdev,
int ccc = info->constant_charge_current_max_ua;
int val;
+ axp_batt->ts_disable = (device_property_read_bool(axp_batt->dev,
+ "x-powers,no-thermistor"));
+
+ /*
+ * Under rare conditions an incorrectly programmed efuse for
+ * the temp sensor on the PMIC may trigger a fault condition.
+ * Allow users to hard-code if the ts pin is not used to work
+ * around this problem. Note that this requires the battery
+ * be correctly defined in the device tree with a monitored
+ * battery node.
+ */
+ if (axp_batt->ts_disable) {
+ regmap_update_bits(axp_batt->regmap,
+ AXP717_TS_PIN_CFG,
+ AXP717_TS_PIN_DISABLE,
+ AXP717_TS_PIN_DISABLE);
+ }
+
if (vmin > 0 && axp717_set_voltage_min_design(axp_batt, vmin))
dev_err(&pdev->dev,
"couldn't set voltage_min_design\n");
--
2.39.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH AUTOSEL 6.12 308/486] pmdomain: imx: gpcv2: use proper helper for property detection
[not found] <20250505223922.2682012-1-sashal@kernel.org>
` (5 preceding siblings ...)
2025-05-05 22:36 ` [PATCH AUTOSEL 6.12 292/486] power: supply: axp20x_battery: Update temp sensor for AXP717 from device tree Sasha Levin
@ 2025-05-05 22:36 ` Sasha Levin
2025-05-05 22:38 ` [PATCH AUTOSEL 6.12 413/486] tools/power turbostat: Clustered Uncore MHz counters should honor show/hide options Sasha Levin
2025-05-05 22:38 ` [PATCH AUTOSEL 6.12 423/486] cpufreq: amd-pstate: Remove unnecessary driver_lock in set_boost Sasha Levin
8 siblings, 0 replies; 9+ messages in thread
From: Sasha Levin @ 2025-05-05 22:36 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Ahmad Fatoum, Ulf Hansson, Sasha Levin, shawnguo, shengjiu.wang,
peng.fan, joe, dario.binacchi, krzysztof.kozlowski, linux-pm, imx,
linux-arm-kernel
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
[ Upstream commit 6568cb40e73163fa25e2779f7234b169b2e1a32e ]
Starting with commit c141ecc3cecd7 ("of: Warn when of_property_read_bool()
is used on non-boolean properties"), probing the gpcv2 device on i.MX8M
SoCs leads to warnings when LOCKDEP is enabled.
Fix this by checking property presence with of_property_present as
intended.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.kernel.org/r/20250218-gpcv2-of-property-present-v1-1-3bb1a9789654@pengutronix.de
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pmdomain/imx/gpcv2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pmdomain/imx/gpcv2.c b/drivers/pmdomain/imx/gpcv2.c
index e03c2cb39a693..0dbf1893abfa3 100644
--- a/drivers/pmdomain/imx/gpcv2.c
+++ b/drivers/pmdomain/imx/gpcv2.c
@@ -1361,7 +1361,7 @@ static int imx_pgc_domain_probe(struct platform_device *pdev)
}
if (IS_ENABLED(CONFIG_LOCKDEP) &&
- of_property_read_bool(domain->dev->of_node, "power-domains"))
+ of_property_present(domain->dev->of_node, "power-domains"))
lockdep_set_subclass(&domain->genpd.mlock, 1);
ret = of_genpd_add_provider_simple(domain->dev->of_node,
--
2.39.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH AUTOSEL 6.12 413/486] tools/power turbostat: Clustered Uncore MHz counters should honor show/hide options
[not found] <20250505223922.2682012-1-sashal@kernel.org>
` (6 preceding siblings ...)
2025-05-05 22:36 ` [PATCH AUTOSEL 6.12 308/486] pmdomain: imx: gpcv2: use proper helper for property detection Sasha Levin
@ 2025-05-05 22:38 ` Sasha Levin
2025-05-05 22:38 ` [PATCH AUTOSEL 6.12 423/486] cpufreq: amd-pstate: Remove unnecessary driver_lock in set_boost Sasha Levin
8 siblings, 0 replies; 9+ messages in thread
From: Sasha Levin @ 2025-05-05 22:38 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Len Brown, Artem Bityutskiy, Sasha Levin, lenb, linux-pm
From: Len Brown <len.brown@intel.com>
[ Upstream commit 1c7c7388e6c31f46b26a884d80b45efbad8237b2 ]
The clustered uncore frequency counters, UMHz*.*
should honor the --show and --hide options.
All non-specified counters should be implicityly hidden.
But when --show was used, UMHz*.* showed up anyway:
$ sudo turbostat -q -S --show Busy%
Busy% UMHz0.0 UMHz1.0 UMHz2.0 UMHz3.0 UMHz4.0
Indeed, there was no string that can be used to explicitly
show or hide clustered uncore counters.
Even through they are dynamically probed and added,
group the clustered UMHz*.* counters with the legacy
built-in-counter "UncMHz" for show/hide.
turbostat --show Busy%
does not show UMHz*.*.
turbostat --show UncMHz
shows either UncMHz or UMHz*.*, if present
turbostat --hide UncMHz
hides either UncMHz or UMHz*.*, if present
Reported-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Tested-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/power/x86/turbostat/turbostat.8 | 1 +
tools/power/x86/turbostat/turbostat.c | 13 ++++++++++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/tools/power/x86/turbostat/turbostat.8 b/tools/power/x86/turbostat/turbostat.8
index a3cf1d17163ae..e4b00e13302b3 100644
--- a/tools/power/x86/turbostat/turbostat.8
+++ b/tools/power/x86/turbostat/turbostat.8
@@ -199,6 +199,7 @@ The system configuration dump (if --quiet is not used) is followed by statistics
\fBUncMHz\fP per-package uncore MHz, instantaneous sample.
.PP
\fBUMHz1.0\fP per-package uncore MHz for domain=1 and fabric_cluster=0, instantaneous sample. System summary is the average of all packages.
+For the "--show" and "--hide" options, use "UncMHz" to operate on all UMHz*.* as a group.
.SH TOO MUCH INFORMATION EXAMPLE
By default, turbostat dumps all possible information -- a system configuration header, followed by columns for all counters.
This is ideal for remote debugging, use the "--out" option to save everything to a text file, and get that file to the expert helping you debug.
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index 77ef60980ee58..12424bf08551d 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -6445,7 +6445,18 @@ static void probe_intel_uncore_frequency_cluster(void)
sprintf(path, "%s/current_freq_khz", path_base);
sprintf(name_buf, "UMHz%d.%d", domain_id, cluster_id);
- add_counter(0, path, name_buf, 0, SCOPE_PACKAGE, COUNTER_K2M, FORMAT_AVERAGE, 0, package_id);
+ /*
+ * Once add_couter() is called, that counter is always read
+ * and reported -- So it is effectively (enabled & present).
+ * Only call add_counter() here if legacy BIC_UNCORE_MHZ (UncMHz)
+ * is (enabled). Since we are in this routine, we
+ * know we will not probe and set (present) the legacy counter.
+ *
+ * This allows "--show/--hide UncMHz" to be effective for
+ * the clustered MHz counters, as a group.
+ */
+ if BIC_IS_ENABLED(BIC_UNCORE_MHZ)
+ add_counter(0, path, name_buf, 0, SCOPE_PACKAGE, COUNTER_K2M, FORMAT_AVERAGE, 0, package_id);
if (quiet)
continue;
--
2.39.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH AUTOSEL 6.12 423/486] cpufreq: amd-pstate: Remove unnecessary driver_lock in set_boost
[not found] <20250505223922.2682012-1-sashal@kernel.org>
` (7 preceding siblings ...)
2025-05-05 22:38 ` [PATCH AUTOSEL 6.12 413/486] tools/power turbostat: Clustered Uncore MHz counters should honor show/hide options Sasha Levin
@ 2025-05-05 22:38 ` Sasha Levin
8 siblings, 0 replies; 9+ messages in thread
From: Sasha Levin @ 2025-05-05 22:38 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Dhananjay Ugwekar, Mario Limonciello, Viresh Kumar, Sasha Levin,
ray.huang, gautham.shenoy, rafael, linux-pm
From: Dhananjay Ugwekar <dhananjay.ugwekar@amd.com>
[ Upstream commit db1cafc77aaaf871509da06f4a864e9af6d6791f ]
set_boost is a per-policy function call, hence a driver wide lock is
unnecessary. Also this mutex_acquire can collide with the mutex_acquire
from the mode-switch path in status_store(), which can lead to a
deadlock. So, remove it.
Signed-off-by: Dhananjay Ugwekar <dhananjay.ugwekar@amd.com>
Acked-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cpufreq/amd-pstate.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 9db5354fdb027..7a16d19322286 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -696,7 +696,6 @@ static int amd_pstate_set_boost(struct cpufreq_policy *policy, int state)
pr_err("Boost mode is not supported by this processor or SBIOS\n");
return -EOPNOTSUPP;
}
- guard(mutex)(&amd_pstate_driver_lock);
ret = amd_pstate_cpu_boost_update(policy, state);
WRITE_ONCE(cpudata->boost_state, !ret ? state : false);
--
2.39.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-05-05 22:54 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20250505223922.2682012-1-sashal@kernel.org>
2025-05-05 22:31 ` [PATCH AUTOSEL 6.12 002/486] x86/fred: Fix system hang during S4 resume with FRED enabled Sasha Levin
2025-05-05 22:31 ` [PATCH AUTOSEL 6.12 037/486] thermal/drivers/mediatek/lvts: Start sensor interrupts disabled Sasha Levin
2025-05-05 22:31 ` [PATCH AUTOSEL 6.12 038/486] thermal/drivers/qoriq: Power down TMU on system suspend Sasha Levin
2025-05-05 22:34 ` [PATCH AUTOSEL 6.12 167/486] cpufreq: tegra186: Share policy per cluster Sasha Levin
2025-05-05 22:35 ` [PATCH AUTOSEL 6.12 260/486] cpuidle: menu: Avoid discarding useful information Sasha Levin
2025-05-05 22:36 ` [PATCH AUTOSEL 6.12 292/486] power: supply: axp20x_battery: Update temp sensor for AXP717 from device tree Sasha Levin
2025-05-05 22:36 ` [PATCH AUTOSEL 6.12 308/486] pmdomain: imx: gpcv2: use proper helper for property detection Sasha Levin
2025-05-05 22:38 ` [PATCH AUTOSEL 6.12 413/486] tools/power turbostat: Clustered Uncore MHz counters should honor show/hide options Sasha Levin
2025-05-05 22:38 ` [PATCH AUTOSEL 6.12 423/486] cpufreq: amd-pstate: Remove unnecessary driver_lock in set_boost Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).