You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SB3: system total power limit at 25 watts, including display backlight #117
This is observed by using s-tui to continuously monitor the power consumption, core frequency and utilization while compiling the kernel.
Running a "cold start", the system power peaks at 40 watts, and then drops to 25 watts (could be a thermal trip point, or a "long time power limit"?), where the CPU package draws 16 watts, resulting in all-core frequency at 1.6GHz. Core temperature stabilizes at 71C.
Curiously, I lowered the screen brightness to 5%, and the CPU package starts to draw more power (20+ watts) and all-core frequency goes up to 2.0GHz. Core temperature stabilizes at 78C.
So this does not solely look like a thermal throttle -- but where does that 25W limit come from?
I don't have "performance mode" -- there's no /sys/bus/surface_aggregator/devices/01:03:01:00:01/perf_mode.
I did try all the profiles -- no difference it seems.
After some more experiment with a stress tool I find it's thermal-related and not bound to a sustained loaded time. The peak power could sustain for 2 seconds, 5 seconds and so on.
And the power limit kicks in when the core goes over 90C degrees.
I'll see if I can work out a thermald configuration for this model.
Reacted by Maximilian Luz and Lars Schellhas van Kisfeld
Have to reopen this because thermald/rapl is not effective against this problem. It's like a power budget, not thermal throttle -- the same 25 watts can well push the core to 80C (dimmed screen) but a thermal limit at 70C (like ~20 watts in total) already triggers the power limit!
btw, the fan is not as fast (loud) as in Windows. A profile configuration issue?
AFAIK the fan is entirely controlled by SAM, and the only influence we or Windows can have on that is the platform profile/performance mode. Try setting that to "best performance".
So, is there a way I can intercept SAM messages under windows?
Update: I've found where Windows gets its power and thermal behaviour on this device, and it changes the plan for this issue.
On Windows, the limits are set at runtime by the Surface System Management Framework (SMF). Its configuration is a blob provided by
the firmware (UEFI variable SMF_DATA_BLOB-…, readable from Linux, and also included in Microsoft's public firmware packages).
For the SB3 15" it shows:
psys is not fixed on Windows. SMF sets psys PL1 to the available input power reported by the EC (BAT 0x53) + 23 W, and PL2
to that + 34.5 W. That's why psys never binds on Windows, while Linux stays at the boot value of 25/40 W.
The controlled variable is the EC skin temperature I_VTS1, at 48 °C, not the CPU temperature. When it gets close, PL1 is cut
from 30 W to 21 W (in Best performance) and then adjusted in small steps every 10 s. This matches my earlier Windows measurements
(30 → 21 W cut, ~32 W system power plateau).
The dGPU has its own loop on the base skin temperature. On Linux it isn't limited at all.
The same SMF driver is used on many newer Surface devices, each with its own blob. So instead of tuning my own controller to
measurements, I now want to reproduce SMF itself: read the installed blob and evaluate it the way Windows does. I've opened a tracking
issue for all SMF devices, with the details, the open questions and the method: linux-surface/linux-surface#2383
The prototype controller and the measurements from this issue remain the SB3 reference for validating that.
Activity
qzed commentedon Feb 18, 2022
Could be some total system limit for sustained power imposed by firmware. Did you try changing the performance mode?
yatli commentedon Feb 18, 2022
I don't have "performance mode" -- there's no
/sys/bus/surface_aggregator/devices/01:03:01:00:01/perf_mode.I did try all the profiles -- no difference it seems.
qzed commentedon Feb 18, 2022
Yeah sorry, meant platform profiles (those and performance modes are the same).
yatli commentedon Feb 18, 2022
Edit: see below.
After some more experiment with a stress tool I find it's thermal-related and not bound to a sustained loaded time. The peak power could sustain for 2 seconds, 5 seconds and so on.And the power limit kicks in when the core goes over 90C degrees.I'll see if I can work out a thermald configuration for this model.
yatli commentedon Feb 18, 2022
Just feel this is funny that I should share the story with you guys :D
yatli commentedon Feb 18, 2022
Have to reopen this because thermald/rapl is not effective against this problem. It's like a power budget, not thermal throttle -- the same 25 watts can well push the core to 80C (dimmed screen) but a thermal limit at 70C (like ~20 watts in total) already triggers the power limit!
yatli commentedon Feb 18, 2022
btw, the fan is not as fast (loud) as in Windows. A profile configuration issue?
yatli commentedon Feb 18, 2022
So, is there a way I can intercept SAM messages under windows?
qzed commentedon Feb 18, 2022
AFAIK the fan is entirely controlled by SAM, and the only influence we or Windows can have on that is the platform profile/performance mode. Try setting that to "best performance".
Yes, although it requires a bit of configuration and the dumps are not easily readable (you're of course welcome to write a better parser for that). There's an overview on how to do that here: https://github.com/linux-surface/surface-aggregator-module/wiki/Development. A script for transforming the output into json files is here. Documentation on the commands we know so far is here. An overall documentation on the protocol can be found at https://www.kernel.org/doc/html/latest/driver-api/surface_aggregator/ssh.html.
yatli commentedon Feb 18, 2022
Here are the two related entries when I toggle between Better Performance vs. Best Performance:
{"ctrl": {"type": 128, "len": 12, "pad": 0, "seq": 42}, "cmd": {"type": 128, "tc": 3, "outgoing": 1, "incoming": 0, "iid": 0, "rqid_lo": 83, "rqid_hi": 3, "cid": 3}, "payload": [3, 0, 0, 0]} {"ctrl": {"type": 128, "len": 12, "pad": 0, "seq": 46}, "cmd": {"type": 128, "tc": 3, "outgoing": 1, "incoming": 0, "iid": 0, "rqid_lo": 87, "rqid_hi": 3, "cid": 3}, "payload": [4, 0, 0, 0]}...which matches the documented values.
le32 though?
yatli commentedon Feb 18, 2022
Just checked the module. le32 indeed no problem.
qzed commentedon Feb 18, 2022
Yeah, le32 is correct.
qzed commentedon Feb 18, 2022
All multi-byte values in the protocol are little-endian.
56 remaining items
larsschellhas commentedon Nov 14, 2026
Update: I've found where Windows gets its power and thermal behaviour on this device, and it changes the plan for this issue.
On Windows, the limits are set at runtime by the Surface System Management Framework (SMF). Its configuration is a blob provided by
the firmware (UEFI variable
SMF_DATA_BLOB-…, readable from Linux, and also included in Microsoft's public firmware packages).For the SB3 15" it shows:
0x53) + 23 W, and PL2to that + 34.5 W. That's why psys never binds on Windows, while Linux stays at the boot value of 25/40 W.
I_VTS1, at 48 °C, not the CPU temperature. When it gets close, PL1 is cutfrom 30 W to 21 W (in Best performance) and then adjusted in small steps every 10 s. This matches my earlier Windows measurements
(30 → 21 W cut, ~32 W system power plateau).
The same SMF driver is used on many newer Surface devices, each with its own blob. So instead of tuning my own controller to
measurements, I now want to reproduce SMF itself: read the installed blob and evaluate it the way Windows does. I've opened a tracking
issue for all SMF devices, with the details, the open questions and the method: linux-surface/linux-surface#2383
The prototype controller and the measurements from this issue remain the SB3 reference for validating that.
hwmon: surface_temp: Add support for the KIP thermal sensors
platform/surface: aggregator_registry: Add base thermal sensors for S…
hwmon: surface_fan: Add support for the KIP fans
platform/surface: aggregator_registry: Add base fans for Surface Book 3
platform/surface: aggregator_registry: Add thermal sensors and fan sp…
hwmon: surface_temp: Add support for the KIP thermal sensors
platform/surface: aggregator_registry: Add base thermal sensors for S…
hwmon: surface_fan: Add support for the KIP fans
platform/surface: aggregator_registry: Add base fans for Surface Book 3
platform/surface: aggregator_registry: Add thermal sensors and fan sp…
hwmon: surface_temp: Add support for the KIP thermal sensors
platform/surface: aggregator_registry: Add base thermal sensors for S…
hwmon: surface_fan: Add support for the KIP fans
platform/surface: aggregator_registry: Add base fans for Surface Book 3