mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] soc: qcom: icc-bwmon: drop the bandwidth vote across system suspend
@ 2026-10-18 15:54 Ramón Jesús Miranda
  2026-10-19  8:40 ` Konrad Dybcio
  0 siblings, 1 reply; 2+ messages in thread
From: Ramón Jesús Miranda @ 2026-10-18 15:54 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Krzysztof Kozlowski
  Cc: linux-arm-msm, linux-kernel

icc-bwmon has no PM ops: the interconnect vote derived from the last
sample stays in place while the system is suspended. On X1E80100 the CPU
bwmon was left voting 800 MB/s peak on the DDR path during s2idle, which
keeps DDR out of its low power modes (the qcom_stats "ddr" counter never
advances).

Disable the monitor, drop the OPP vote on suspend and restart monitoring
on resume. With this change DDR reaches its low power mode for >99% of
s2idle on a Microsoft Surface Pro 11 (X1E80100).

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramón Jesús Miranda <ramonjesusmiranda@gmail.com>
---
diff --git a/drivers/soc/qcom/icc-bwmon.c b/drivers/soc/qcom/icc-bwmon.c
--- a/drivers/soc/qcom/icc-bwmon.c
+++ b/drivers/soc/qcom/icc-bwmon.c
@@ -815,6 +815,35 @@
 	free_irq(bwmon->irq, bwmon);
 }
 
+/*
+ * The bandwidth vote of the last sample stays in place across system
+ * suspend and keeps DDR out of its low power modes. Drop it while
+ * suspended and restart monitoring on resume.
+ */
+static int bwmon_suspend(struct device *dev)
+{
+	struct icc_bwmon *bwmon = dev_get_drvdata(dev);
+
+	disable_irq(bwmon->irq);
+	bwmon_disable(bwmon);
+	dev_pm_opp_set_opp(dev, NULL);
+	bwmon->current_kbps = 0;
+
+	return 0;
+}
+
+static int bwmon_resume(struct device *dev)
+{
+	struct icc_bwmon *bwmon = dev_get_drvdata(dev);
+
+	bwmon_start(bwmon);
+	enable_irq(bwmon->irq);
+
+	return 0;
+}
+
+static DEFINE_SIMPLE_DEV_PM_OPS(bwmon_pm_ops, bwmon_suspend, bwmon_resume);
+
 static const struct icc_bwmon_data msm8998_bwmon_data = {
 	.sample_ms = 4,
 	.count_unit_kb = 1024,
@@ -879,6 +907,7 @@
 	.driver = {
 		.name = "qcom-bwmon",
 		.of_match_table = bwmon_of_match,
+		.pm = pm_sleep_ptr(&bwmon_pm_ops),
 	},
 };
 module_platform_driver(bwmon_driver);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] soc: qcom: icc-bwmon: drop the bandwidth vote across system suspend
  2026-10-18 15:54 [PATCH] soc: qcom: icc-bwmon: drop the bandwidth vote across system suspend Ramón Jesús Miranda
@ 2026-10-19  8:40 ` Konrad Dybcio
  0 siblings, 0 replies; 2+ messages in thread
From: Konrad Dybcio @ 2026-10-19  8:40 UTC (permalink / raw)
  To: Ramón Jesús Miranda, Bjorn Andersson, Konrad Dybcio,
	Krzysztof Kozlowski
  Cc: linux-arm-msm, linux-kernel

On 10/18/26 5:54 PM, Ramón Jesús Miranda wrote:
> icc-bwmon has no PM ops: the interconnect vote derived from the last
> sample stays in place while the system is suspended. On X1E80100 the CPU
> bwmon was left voting 800 MB/s peak on the DDR path during s2idle, which
> keeps DDR out of its low power modes (the qcom_stats "ddr" counter never
> advances).
> 
> Disable the monitor, drop the OPP vote on suspend and restart monitoring
> on resume. With this change DDR reaches its low power mode for >99% of
> s2idle on a Microsoft Surface Pro 11 (X1E80100).

Have you done a negative test (does reverting this patch alone break
ddr collapse for you)? The DT uses ACTIVE_ONLY icc votes for BWMON,
so as the CPU subsystem goes to sleep, these votes are removed in
hardware.

Konrad

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-19  8:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-18 15:54 [PATCH] soc: qcom: icc-bwmon: drop the bandwidth vote across system suspend Ramón Jesús Miranda
2026-10-19  8:40 ` Konrad Dybcio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®