Skip to content

SB3: system total power limit at 25 watts, including display backlight #117

Open

Description

@yatli

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?

Activity

  1. qzed commented on Feb 18, 2022

    @qzed
    Member

    Could be some total system limit for sustained power imposed by firmware. Did you try changing the performance mode?

  2. yatli commented on Feb 18, 2022

    @yatli
    Author

    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.

  3. qzed commented on Feb 18, 2022

    @qzed
    Member

    Yeah sorry, meant platform profiles (those and performance modes are the same).

  4. yatli commented on Feb 18, 2022

    @yatli
    Author

    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.

  5. yatli commented on Feb 18, 2022

    @yatli
    Author

    Just feel this is funny that I should share the story with you guys :D

  6. reopened this on Feb 18, 2022
  7. yatli commented on Feb 18, 2022

    @yatli
    Author

    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!

  8. yatli commented on Feb 18, 2022

    @yatli
    Author

    btw, the fan is not as fast (loud) as in Windows. A profile configuration issue?

  9. yatli commented on Feb 18, 2022

    @yatli
    Author

    So, is there a way I can intercept SAM messages under windows?

  10. qzed commented on Feb 18, 2022

    @qzed
    Member

    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?

    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.

  11. yatli commented on Feb 18, 2022

    @yatli
    Author

    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?

  12. yatli commented on Feb 18, 2022

    @yatli
    Author

    Just checked the module. le32 indeed no problem.

  13. qzed commented on Feb 18, 2022

    @qzed
    Member

    Yeah, le32 is correct.

  14. qzed commented on Feb 18, 2022

    @qzed
    Member

    All multi-byte values in the protocol are little-endian.

  15. 56 remaining items

  16. larsschellhas commented on Nov 14, 2026

    @larsschellhas
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions