From 5c1fc1f250293e80b3e9e4213d4c52fef85dc6b2 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Sun, 22 Nov 2026 01:33:01 +1100 Subject: [PATCH 1/2] drm/asahi: g16: Log cooling decisions at debug, ceiling edges at info service_power() logs every change of the cooling decision (governor, budget, backstop, sensor error, ceiling) with dev_info. Under sustained heat those inputs move several times a second. On the J713 (M4 Air, fanless) a desktop load at 97-104 C wrote up to 82 such lines in 10 s, enough to push older lines out of the kernel log buffer within minutes, and every boot writes about 15 while the startup hold lets go. Keep the full decision at dev_dbg. The info log gets only the two edges a user cares about: the ceiling dropping below the board's top state, and coming back to it, with the temperature and the number of decisions in between. The startup hold counts as below the top, so a normal boot logs one line when it lets go. Signed-off-by: Ryan Murray --- drivers/gpu/drm/asahi/g16/power.rs | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/asahi/g16/power.rs b/drivers/gpu/drm/asahi/g16/power.rs index 1de8da0bdcc4c..05d3b7dc8b2b4 100644 --- a/drivers/gpu/drm/asahi/g16/power.rs +++ b/drivers/gpu/drm/asahi/g16/power.rs @@ -173,6 +173,8 @@ pub(crate) struct Power { pub(crate) sensor_errors: u64, pub(crate) decisions: u64, last_decision: Option<(u32, u32, u32, u32, Option)>, + /// The ceiling was below the top state at the last decision (startup holds it low). + throttled: bool, pub(crate) utilization: policy::Governor, } @@ -204,6 +206,7 @@ impl Power { sensor_errors: 0, decisions: 0, last_decision: None, + throttled: true, utilization: policy::Governor::new(), }) } @@ -276,7 +279,31 @@ impl Firmware { .utilization .govern(now, limit, !self.engine.flights.is_empty()); if decision { - dev_info!( + // Each decision goes to the debug log: under sustained heat the governor, budget and + // backstop move several times a second. The info log gets only the edges: the + // ceiling leaving the top state and coming back to it. + let throttled = limit < self.power.top; + if self.power.throttled != throttled { + self.power.throttled = throttled; + if throttled { + dev_info!( + self.dev(), + "M4 cooling: ceiling S{} below the top S{} at {} mC\n", + limit, + self.power.top, + self.power.temperature_mc + ); + } else { + dev_info!( + self.dev(), + "M4 cooling: back at the top S{} at {} mC after {} decisions\n", + limit, + self.power.temperature_mc, + self.power.decisions + ); + } + } + dev_dbg!( self.dev(), "M4 cooling: sample_ns={:?} mc={} sensor={:?} governor={} power={} backstop={} limit=S{}\n", self.power.last_sample_ns, From 482d696ea80875be14acec7673cdf09da13e65c3 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Sun, 6 Dec 2026 17:49:29 +1100 Subject: [PATCH 2/2] drm/asahi: g16: count the decisions of one throttle episode The back-at-top info line printed the driver's lifetime decision count, so each recovery reported a growing total (21, 31 ... 311 on the J713 heat row). Remember the count when the ceiling leaves the top state and report the decisions made since. Signed-off-by: Ryan Murray --- drivers/gpu/drm/asahi/g16/power.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/asahi/g16/power.rs b/drivers/gpu/drm/asahi/g16/power.rs index 9e2f412665ee0..7e0aee12eb862 100644 --- a/drivers/gpu/drm/asahi/g16/power.rs +++ b/drivers/gpu/drm/asahi/g16/power.rs @@ -271,6 +271,8 @@ pub(crate) struct Power { last_decision: Option<(u32, u32, u32, u32, u32, Option)>, /// The ceiling was below the top state at the last decision (startup holds it low). throttled: bool, + /// `decisions` when the ceiling last left the top state. + decisions_at_throttle: u64, pub(crate) utilization: policy::Governor, } @@ -314,6 +316,7 @@ impl Power { decisions: 0, last_decision: None, throttled: true, + decisions_at_throttle: 0, utilization: policy::Governor::new(), }) } @@ -503,6 +506,7 @@ impl Firmware { if self.power.throttled != throttled { self.power.throttled = throttled; if throttled { + self.power.decisions_at_throttle = self.power.decisions; dev_info!( self.dev(), "M4 cooling: ceiling S{} below the top S{} at {} mC\n", @@ -516,7 +520,7 @@ impl Firmware { "M4 cooling: back at the top S{} at {} mC after {} decisions\n", limit, self.power.temperature_mc, - self.power.decisions + self.power.decisions - self.power.decisions_at_throttle ); } }