Skip to content

Surface Laptop 5 Fan problem  #1463

Closed
Closed

Description

@sevenzip2

[Description of the bug or feature]
The fan barely runs until the temperature gets to 90 degrees and then suddenly the fan starts running like crazy. Is there a workaround to get the fan to work properly like in Windows?

and There is a popping sound when I start the computer.

Environment

  • Hardware model: Surface Laptop 5
  • Kernel version: Linux sevenzip 6.8.8-arch1-1-surface Update to upstream #1 SMP PREEMPT_DYNAMIC Tue, 30 Apr 2024 07:52:55 +0000 x86_64 GNU/Linux
  • Distribution: Arch Linux
`dmesg` output

Activity

  1. sevenzip2 commented on Jun 9, 2024

    @sevenzip2
    Author

    In fact, there is no fan sound at all. Please help me.

  2. sevenzip2 commented on Jun 9, 2024

    @sevenzip2
    Author

    popping sound problem can solved by add ~/.xinit pactl set-sink-mute 0 0

  3. CiaranWinna commented on Jun 10, 2024

    @CiaranWinna

    Similar issue to what I am having on the SLS2. Fans don't start at all. Core temperature reaches critical level and the laptop shuts down as a safety measure. This is happening even when the laptop is at idle.

  4. qzed commented on Jun 10, 2024

    @qzed
    Member

    Both SL5 and SLS2 likely have an EC interface via SAM. We currently have support for this on the SP9 and SL6. While we can't control the exact fan speed, it allows setting a fan curve. Specifically, this is tied to the platform profile, so changing that (e.g. with surface profile set performance) should also change the fan curve.

    Below are two patches which should hopefully enable that for the SL5 and SLS2 respectively. It would be great if you can test them. If you don't know how to compile a kernel, I can also prepare a branch of the out-of-tree SAM driver, but it might take me some time to get around to it.

    For testing, switch the platform profile (surface profile set <x>) a couple of times and check if behavior under load improves. I've also added thermal sensor support, so also run sensors and check if they that shows some new SAM related sensors (maybe post that here if you're not sure). During all of that, keep an eye on the dmesg log to ensure that there are no errors when running the commends (and ideally upload it here).

    From 22f5f945498e0d9d0dc35c9ec8295899b8ac32ca Mon Sep 17 00:00:00 2001
    From: Maximilian Luz <[email protected]>
    Date: Mon, 10 Jun 2024 21:47:47 +0200
    Subject: [PATCH 1/2] platform/surface: aggregator_registry: Add fan and
     thermal sensor support for Surface Laptop 5
    
    ---
     drivers/platform/surface/surface_aggregator_registry.c | 4 +++-
     1 file changed, 3 insertions(+), 1 deletion(-)
    
    diff --git a/drivers/platform/surface/surface_aggregator_registry.c b/drivers/platform/surface/surface_aggregator_registry.c
    index 07a4c4e1120d3..4dc79f791d390 100644
    --- a/drivers/platform/surface/surface_aggregator_registry.c
    +++ b/drivers/platform/surface/surface_aggregator_registry.c
    @@ -265,7 +265,9 @@ static const struct software_node *ssam_node_group_sl5[] = {
     	&ssam_node_root,
     	&ssam_node_bat_ac,
     	&ssam_node_bat_main,
    -	&ssam_node_tmp_perf_profile,
    +	&ssam_node_tmp_perf_profile_with_fan,
    +	&ssam_node_tmp_sensors,
    +	&ssam_node_fan_speed,
     	&ssam_node_hid_main_keyboard,
     	&ssam_node_hid_main_touchpad,
     	&ssam_node_hid_main_iid5,
    -- 
    2.45.1
    From 2294324190ce5366889069534a40e00962c9b692 Mon Sep 17 00:00:00 2001
    From: Maximilian Luz <[email protected]>
    Date: Mon, 10 Jun 2024 21:48:02 +0200
    Subject: [PATCH 2/2] platform/surface: aggregator_registry: Add fan and
     thermal sensor support for Surface Laptop Studio 2
    
    ---
     drivers/platform/surface/surface_aggregator_registry.c | 4 +++-
     1 file changed, 3 insertions(+), 1 deletion(-)
    
    diff --git a/drivers/platform/surface/surface_aggregator_registry.c b/drivers/platform/surface/surface_aggregator_registry.c
    index 4dc79f791d390..77f903a04d128 100644
    --- a/drivers/platform/surface/surface_aggregator_registry.c
    +++ b/drivers/platform/surface/surface_aggregator_registry.c
    @@ -312,7 +312,9 @@ static const struct software_node *ssam_node_group_sls2[] = {
     	&ssam_node_root,
     	&ssam_node_bat_ac,
     	&ssam_node_bat_main,
    -	&ssam_node_tmp_perf_profile,
    +	&ssam_node_tmp_perf_profile_with_fan,
    +	&ssam_node_tmp_sensors,
    +	&ssam_node_fan_speed,
     	&ssam_node_pos_tablet_switch,
     	&ssam_node_hid_sam_keyboard,
     	&ssam_node_hid_sam_penstash,
    -- 
    2.45.1
  5. sevenzip2 commented on Jun 11, 2024

    @sevenzip2
    Author

    Very sorry for that, I don't know how to patch a kernel.

  6. CiaranWinna commented on Jun 14, 2024

    @CiaranWinna

    Hi @qzed!
    I currently hitting the following issue:#1461. If I am able to find a work around I will test the code changes you mentioned above
    BR,
    Ciaran

  7. sevenzip2 commented on Jun 26, 2024

    @sevenzip2
    Author

    I compiled the kernel manually... and it worked! Please merge it into an official patch soon.

  8. sevenzip2 commented on Jun 26, 2024

    @sevenzip2
    Author

    However, unlike Windows, there is a delay of about 30 seconds between the temperature increase and the fan starting, and the default fan speed when using battery is a whopping 0. Is there a solution?

  9. sevenzip2 commented on Jun 26, 2024

    @sevenzip2
    Author

    It seems like the default fan speed should be 3000, but there seems to be a bug.

  10. sevenzip2 commented on Jun 27, 2024

    @sevenzip2
    Author

    This appears to be probably due to a kernel patch that enabled fan speed adjustment but not cpu clock adjustment. (Under overload, CPU temperature exceeds 80 degrees Celsius in Linux, but does not exceed 60 degrees Celsius in Windows due to aggressive CPU scheduling.)

  11. added a commit that references this issue on Jun 30, 2024
  12. qzed commented on Jun 30, 2024

    @qzed
    Member

    The patches I proposed above are included in the next release (v6.9.7).

  13. qzed commented on Jun 30, 2024

    @qzed
    Member

    This appears to be probably due to a kernel patch that enabled fan speed adjustment but not cpu clock adjustment. (Under overload, CPU temperature exceeds 80 degrees Celsius in Linux, but does not exceed 60 degrees Celsius in Windows due to aggressive CPU scheduling.)

    Could you elaborate on that?

  14. sevenzip2 commented on Jun 30, 2024

    @sevenzip2
    Author

    In Windows, the clock is adjusted so that the temperature does not exceed 50 degrees when operating on battery and 60 degrees when connected to power, but Linux does not do this and randomly turns on turbo boost up to 4400mhz. That's why the temperature can soar to 90 degrees even when the fan is running.

  15. qzed commented on Jun 30, 2024

    @qzed
    Member

    Ah yeah. The linux kernel itself does not do any sort of management of this. You might want try and set up thermald, which can do things like scale down the frequency when the CPU gets hot.

  16. sevenzip2 commented on Jul 1, 2024

    @sevenzip2
    Author

    Are there any examples of settings for the Sensor on Surface Laptop 5?

  17. sevenzip2 commented on Jul 1, 2024

    @sevenzip2
    Author

    Sorry, thermald didn't really help either. I'm thinking of giving up using Linux on this computer.

  18. qzed commented on Jul 2, 2024

    @qzed
    Member

    You should probably be able to adapt one of the configs here (maybe from the Pro 7): https://github.com/linux-surface/linux-surface/tree/master/contrib/thermald. You probably need to make sure that it's not trying to load things from ACPI because at least in the past that didn't work.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions