Skip to content

Revert "thermal: boost: phytium: Automatic enable/disable of BOOST feature" #807

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

Open
wants to merge 1 commit into
base: linux-6.6.y
Choose a base branch
from

Conversation

opsiff
Copy link
Member

@opsiff opsiff commented May 19, 2025

It causes boot error in some phytium device.
Reverts #762

Summary by Sourcery

Revert the previously added automatic CPU frequency boost enable/disable logic in the thermal and cpufreq drivers to restore boot stability on affected Phytium devices.

Bug Fixes:

  • Remove automatic boost triggering in the thermal core to prevent boot failures on Phytium hardware.

Enhancements:

  • Eliminate thermal_boost_enable, thermal_boost_disable and related polling logic from the thermal driver.
  • Restrict cpufreq_boost_supported to a static function and remove its sysfs export and declaration.

Chores:

  • Drop overheated and boost_polling fields from the thermal_zone_device struct.

Copy link

sourcery-ai bot commented May 19, 2025

Reviewer's Guide

This PR reverts the automatic CPU frequency boost toggling introduced for Phytium devices by removing the thermal driver’s boost enable/disable handlers, related polling logic and flags, converting the cpufreq boost query function to an internal API, and cleaning up associated declarations in cpufreq and thermal headers to restore prior behavior.

Sequence diagram for thermal zone update process changes

sequenceDiagram
    participant thermal_zone_device_check
    participant thermal_zone_device_update

    thermal_zone_device_check->>thermal_zone_device_update: THERMAL_EVENT_UNSPECIFIED
    note right of thermal_zone_device_check: Removed call to thermal_boost_enable

    thermal_zone_device_update->>thermal_zone_device_update: update_temperature()
    note right of thermal_zone_device_update: Removed logic for thermal_boost_disable
    thermal_zone_device_update->>thermal_zone_device_update: __thermal_zone_set_trips()
Loading

Class diagram for struct thermal_zone_device

classDiagram
    class thermal_zone_device {
        -bool overheated
        -bool boost_polling
        -thermal_zone_device_ops *ops
        -thermal_zone_params *tzp
        -thermal_governor *governor
    }

    note for thermal_zone_device "overheated and boost_polling fields removed"
Loading

File-Level Changes

Change Details Files
Strip automatic boost handlers and logic from the thermal core
  • Deleted thermal_boost_enable and thermal_boost_disable functions
  • Removed cpufreq_boost_supported() checks and boost trigger calls in update and polling paths
  • Removed unnecessary includes for cpufreq and stacktrace
drivers/thermal/thermal_core.c
Remove boost state fields from thermal_zone_device
  • Dropped ‘overheated’ and ‘boost_polling’ flags from struct
  • Eliminated related polling management paths
include/linux/thermal.h
Convert cpufreq boost support to internal API and clean up declarations
  • Changed cpufreq_boost_supported to a static function and removed its EXPORT_SYMBOL
  • Removed its declaration from cpufreq header
  • Cleaned up driver null checks in boost support implementation
drivers/cpufreq/cpufreq.c
include/linux/cpufreq.h

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot deepin-ci-robot requested a review from huangbibo May 19, 2025 08:23
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from opsiff. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. cpufreq.c文件中,cpufreq_boost_supported函数被声明为static,但之前的版本中是EXPORT_SYMBOL_GPL导出的。这可能会影响其他模块或驱动程序,因为它们可能依赖于这个符号。建议重新考虑是否需要导出这个函数,或者如果需要导出,应该保持声明不变。

  2. thermal_core.c文件中,thermal_boost_enablethermal_boost_disable函数被移除,这可能会影响依赖于这些函数的其他代码。需要确认这些函数的移除是否是有意为之,并且是否有替代的实现来处理热管理中的CPU频率提升。

  3. thermal_core.c文件中,thermal_zone_device_check函数中移除了对cpufreq_boost_supported的检查。如果cpufreq_boost_supported返回false,那么thermal_boost_enable函数将不会被调用。这可能会导致热管理模块在没有CPU频率提升支持的情况下尝试启用它,从而可能导致错误。建议重新评估这一更改,并确保热管理模块能够正确处理没有CPU频率提升支持的情况。

  4. thermal_core.c文件中,thermal_zone_device结构体中的overheatedboost_polling字段被移除。如果这些字段在其他地方被使用,那么这可能会导致编译错误或运行时错误。需要确认这些字段的移除是否是有意为之,并且是否有替代的实现来处理热管理中的CPU频率提升。

  5. thermal_core.c文件中,thermal_zone_device_check函数中移除了对thermal_boost_enable的调用。如果热管理模块需要根据温度变化来动态调整CPU频率,那么这可能会导致问题。建议重新评估这一更改,并确保热管理模块能够正确处理CPU频率的动态调整。

  6. thermal.h文件中,thermal_zone_device结构体中的overheatedboost_polling字段被移除。如果这些字段在其他地方被使用,那么这可能会导致编译错误或运行时错误。需要确认这些字段的移除是否是有意为之,并且是否有替代的实现来处理热管理中的CPU频率提升。

总的来说,这些更改可能会影响热管理模块和CPU频率管理模块的功能和稳定性。需要仔细审查这些更改,并确保它们不会引入新的问题。

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @opsiff - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Wenlp
Copy link
Contributor

Wenlp commented May 19, 2025

check if tz->trips is NULL before access tz->trips[0], because psy devices also register thermal_zone without any trips

…ature"

It causes boot error in some phytium device.
Reverts #762

This reverts commit b6c9d54.

Signed-off-by: Wentao Guan <[email protected]>
@opsiff opsiff force-pushed the revert-762-linux-6.6.y-thermal branch from f1df575 to b8d0ccd Compare May 20, 2025 09:03
@opsiff opsiff marked this pull request as ready for review May 20, 2025 09:04
@deepin-ci-robot deepin-ci-robot requested a review from winnscode May 20, 2025 09:04
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @opsiff - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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.

3 participants