Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Platform profile: switch fan profile #145

Conversation

iwanders
Copy link
Contributor

Followup from #144 that adds support to switch the fan profile whenever the platform profile is switched.

Values recorded with IRPMon as sent to the FAN together with the numbers sent to the TMP module:

2023-12-16 6:54:41 PM   Seq OUT TMP:03 t01 i00 c 0x03 (  4): 01 00 00 00 
2023-12-16 6:54:41 PM   Seq OUT FAN:05 t01 i01 c 0x0e (  1): 02 

2023-12-16 6:54:45 PM   Seq OUT TMP:03 t01 i00 c 0x03 (  4): 02 00 00 00 
2023-12-16 6:54:45 PM   Seq OUT FAN:05 t01 i01 c 0x0e (  1): 01 

2023-12-16 6:54:30 PM   Seq OUT TMP:03 t01 i00 c 0x03 (  4): 03 00 00 00 
2023-12-16 6:54:30 PM   Seq OUT FAN:05 t01 i01 c 0x0e (  1): 03 

2023-12-16 6:54:33 PM   Seq OUT TMP:03 t01 i00 c 0x03 (  4): 04 00 00 00 
2023-12-16 6:54:33 PM   Seq OUT FAN:05 t01 i01 c 0x0e (  1): 04 

I've confirmed the changes in this PR using the following methodology;

  • Switch platform profile in gnome (and with echo balanced-performance > /sys/firmware/acpi/platform_profile for normal)
  • Start recording fan speed.
  • Start stress -c 12.
  • Cancel stress -c 12 after steady state has been reached, plus a bit (didn't time this). Mark time.
  • Wait for fan to become completely idle again.

This obtains us the following fan curves:

comparison

We clearly get 4 different fan max speeds, with performance as the highest level.

Copy link
Contributor Author

@iwanders iwanders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qzed , filed a draft PR for the additions to the platform profile, still some outstanding questions here and there on the approach, but the overall functionality is there.

@iwanders iwanders mentioned this pull request Dec 19, 2023
@iwanders iwanders force-pushed the platform_profile_switch_fan_profile branch from 54d09a8 to 274e706 Compare December 22, 2023 01:25
@iwanders iwanders marked this pull request as ready for review December 22, 2023 01:27
@iwanders
Copy link
Contributor Author

I've marked this as ready for review. I cleaned up some comments here and there, and renamed the node in the registry. I've also squashed the commits and put a reasonable commit message / title on it.

@iwanders iwanders force-pushed the platform_profile_switch_fan_profile branch from 274e706 to 1f32229 Compare December 31, 2023 18:08
@iwanders iwanders force-pushed the platform_profile_switch_fan_profile branch from 1f32229 to 5000708 Compare January 7, 2024 20:51
Change naming from tmp to platform profile to clarify the module may
interact with both the TMP and FAN subystems. Add functionality that
switches the fan profile when the platform profile is changed.

Signed-off-by: Ivor Wanders <ivor@iwanders.net>
@iwanders iwanders force-pushed the platform_profile_switch_fan_profile branch from 5000708 to 58baf8a Compare January 13, 2024 18:18
@qzed
Copy link
Member

qzed commented Mar 2, 2024

@StollD if you have some time, feel free to merge this and add it to the patches. Otherwise I'll try to make some time, but I'm not sure I can get to much before March 15th.

@iwanders
Copy link
Contributor Author

iwanders commented Mar 2, 2024

Upstream lore entry for v1.

@StollD
Copy link
Member

StollD commented Mar 9, 2024

I cherry-picked this to our 6.6 and 6.7 branches. Thank you!

@StollD StollD closed this Mar 9, 2024
StollD added a commit to linux-surface/linux-surface that referenced this pull request Mar 9, 2024
Changes:
 - Add driver for changing the fan profile (Surface Pro 9)

Links:
 - kernel: linux-surface/kernel@fcc3a67
 - fan profile driver: linux-surface/kernel#145
StollD added a commit to linux-surface/linux-surface that referenced this pull request Mar 9, 2024
Changes:
 - Add driver for changing the fan profile (Surface Pro 9)
 - Added fixes for IPU3 cameras
 - Reverted DW9719 driver to previous version (Surface Go 2)

Links:
 - kernel: linux-surface/kernel@530f557
 - fan profile driver: linux-surface/kernel#145
 - camera fixes: linux-surface/kernel#146
qzed pushed a commit that referenced this pull request Mar 31, 2024
Change naming from tmp to platform profile to clarify the module may
interact with both the TMP and FAN subystems. Add functionality that
switches the fan profile when the platform profile is changed when
a fan is present.

Signed-off-by: Ivor Wanders <ivor@iwanders.net>
Link: #145
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
qzed pushed a commit that referenced this pull request Mar 31, 2024
Change naming from tmp to platform profile to clarify the module may
interact with both the TMP and FAN subystems. Add functionality that
switches the fan profile when the platform profile is changed when
a fan is present.

Signed-off-by: Ivor Wanders <ivor@iwanders.net>
Link: #145
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
qzed pushed a commit that referenced this pull request Apr 1, 2024
Change naming from tmp to platform profile to clarify the module may
interact with both the TMP and FAN subystems. Add functionality that
switches the fan profile when the platform profile is changed when
a fan is present.

Signed-off-by: Ivor Wanders <ivor@iwanders.net>
Link: #145
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
jwrdegoede pushed a commit to jwrdegoede/linux-sunxi that referenced this pull request Apr 1, 2024
Change naming from tmp to platform profile to clarify the module may
interact with both the TMP and FAN subystems. Add functionality that
switches the fan profile when the platform profile is changed when
a fan is present.

Signed-off-by: Ivor Wanders <ivor@iwanders.net>
Link: linux-surface/kernel#145
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com>
Link: https://lore.kernel.org/r/20240314223733.6236-2-ivor@iwanders.net
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants