Skip to content

[Deepin-Kernel-SIG] [linux 6.18-y] [Upstream] [Intel] intel_idle: Add Panther Lake C-states table#1628

Merged
opsiff merged 1 commit intodeepin-community:linux-6.18.yfrom
Avenger-285714:Panther-6.18
Apr 15, 2026
Merged

[Deepin-Kernel-SIG] [linux 6.18-y] [Upstream] [Intel] intel_idle: Add Panther Lake C-states table#1628
opsiff merged 1 commit intodeepin-community:linux-6.18.yfrom
Avenger-285714:Panther-6.18

Conversation

@Avenger-285714
Copy link
Copy Markdown
Member

@Avenger-285714 Avenger-285714 commented Apr 15, 2026

[Upstream commit d51de21b4c3a34a2cc592319df63864e14b18b29]

Panther Lake supports the following requestable C-states: C1, C1E, C6S, C10.

The parameters of these C-states should be consistent across all systems based on Panther Lake, so add a custom C-states table for it that will override C-state parameters supplied by platform firmware that may vary from one platform to another and may not represent the most optimum choice.

[ rjw: Changelog expansion ]
Link: https://patch.msgid.link/20260309083818.79588-1-dedekind1@gmail.com

[Backport from v7.1]

Summary by Sourcery

Add Intel Panther Lake low-power idle state support to the intel_idle driver with a dedicated C-states table and CPU match entry.

New Features:

  • Introduce a Panther Lake-specific cpuidle C-states table covering C1, C1E, C6S, and C10.
  • Register Panther Lake low-power CPUs with the intel_idle driver via a new CPU ID match entry.

[Upstream commit d51de21b4c3a34a2cc592319df63864e14b18b29]

Panther Lake supports the following requestable C-states: C1, C1E, C6S,
C10.

The parameters of these C-states should be consistent across all
systems based on Panther Lake, so add a custom C-states table for it
that will override C-state parameters supplied by platform firmware
that may vary from one platform to another and may not represent the
most optimum choice.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
[ rjw: Changelog expansion ]
Link: https://patch.msgid.link/20260309083818.79588-1-dedekind1@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[Backport from v7.1]
Signed-off-by: WangYuli <wangyl5933@chinaunicom.cn>
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Apr 15, 2026

Reviewer's Guide

Adds a dedicated intel_idle C-state table and CPU match entry for Intel Panther Lake mobile CPUs so the driver uses consistent, upstream-defined C-state parameters instead of firmware-provided ones.

Sequence diagram for Panther Lake C-state selection via intel_idle

sequenceDiagram
    actor CPU
    participant x86_cpuid as x86_cpuid_match
    participant intel_idle as intel_idle_driver
    participant idle_cpu_ptl as idle_cpu_ptl
    participant ptl_cstates as ptl_cstates_table
    participant intel_idle_fn as intel_idle

    CPU->>intel_idle: request_idle()
    intel_idle->>x86_cpuid: match_cpu_model()
    x86_cpuid-->>intel_idle: match INTEL_PANTHERLAKE_L with idle_cpu_ptl
    intel_idle->>idle_cpu_ptl: get state_table
    idle_cpu_ptl-->>intel_idle: ptl_cstates_table

    CPU->>intel_idle: select C-state (policy, load)
    intel_idle->>ptl_cstates: choose C1/C1E/C6S/C10
    ptl_cstates-->>intel_idle: cpuidle_state entry

    intel_idle->>intel_idle_fn: enter(state=C1|C1E|C6S|C10)
    intel_idle_fn-->>CPU: CPU enters requested C-state
Loading

Class diagram for new Panther Lake C-states integration

classDiagram
    class cpuidle_state {
        +char* name
        +char* desc
        +unsigned long flags
        +unsigned int exit_latency
        +unsigned int target_residency
        +int (*enter)(struct cpuidle_device* dev, struct cpuidle_driver* drv, int index)
        +int (*enter_s2idle)(struct cpuidle_state* state, struct cpuidle_device* dev)
    }

    class idle_cpu {
        +struct cpuidle_state* state_table
    }

    class x86_cpu_id {
        +unsigned int vendor
        +unsigned int family
        +unsigned int model
        +const void* driver_data
    }

    class ptl_cstates {
        <<array of cpuidle_state>>
        +cpuidle_state[5]
    }

    class idle_cpu_ptl {
        <<const idle_cpu>>
        +state_table = ptl_cstates
    }

    class intel_idle_ids {
        <<array of x86_cpu_id>>
        +x86_cpu_id[]
    }

    cpuidle_state <.. ptl_cstates : elements
    idle_cpu o-- cpuidle_state : uses_state_table
    idle_cpu_ptl --|> idle_cpu : specialization
    idle_cpu_ptl o-- ptl_cstates : state_table
    x86_cpu_id o-- idle_cpu : driver_data
    intel_idle_ids o-- x86_cpu_id : entries

    class INTEL_PANTHERLAKE_L {
        <<VFM macro entry>>
    }

    INTEL_PANTHERLAKE_L ..> x86_cpu_id : X86_MATCH_VFM
    INTEL_PANTHERLAKE_L ..> idle_cpu_ptl : driver_data
Loading

File-Level Changes

Change Details Files
Introduce Panther Lake-specific cpuidle C-state table and hook it into intel_idle CPU matching.
  • Define ptl_cstates cpuidle_state array with C1, C1E, C6S, and C10 entries tailored for Panther Lake, including MWAIT hints, flags, exit latencies, target residencies, and intel_idle entry functions.
  • Add an idle_cpu_ptl descriptor that references the Panther Lake C-state table for initialization.
  • Register INTEL_PANTHERLAKE_L in the intel_idle_ids x86 CPU ID table, associating it with idle_cpu_ptl so Panther Lake systems use the new table.
drivers/idle/intel_idle.c

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

Copy link
Copy Markdown

@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 - I've reviewed your changes and they look great!


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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a Panther Lake (INTEL_PANTHERLAKE_L) native C-state table to intel_idle so the driver uses consistent C-state parameters rather than platform firmware-provided values that may vary across systems.

Changes:

  • Introduce a Panther Lake C-states table (ptl_cstates) covering C1, C1E, C6S, and C10.
  • Add a corresponding idle_cpu descriptor and hook it up in intel_idle_ids for INTEL_PANTHERLAKE_L.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread drivers/idle/intel_idle.c
Comment on lines +1007 to +1008
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

Unnecessary & in function-pointer initializer: throughout this file .enter is set as intel_idle (without &). Please change this to intel_idle to match existing style and avoid checkpatch warnings.

Copilot uses AI. Check for mistakes.
Comment thread drivers/idle/intel_idle.c
Comment on lines +983 to +984
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

Unnecessary & in function-pointer initializer: throughout this file .enter is set as intel_idle (without &). Please change this to intel_idle to match existing style and avoid checkpatch warnings.

Copilot uses AI. Check for mistakes.
Comment thread drivers/idle/intel_idle.c
Comment on lines 1701 to +1703
X86_MATCH_VFM(INTEL_ALDERLAKE_L, &idle_cpu_adl_l),
X86_MATCH_VFM(INTEL_METEORLAKE_L, &idle_cpu_mtl_l),
X86_MATCH_VFM(INTEL_PANTHERLAKE_L, &idle_cpu_ptl),
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

Naming is inconsistent with the existing pattern for *_L model IDs in this file: INTEL_ALDERLAKE_L maps to idle_cpu_adl_l and INTEL_METEORLAKE_L maps to idle_cpu_mtl_l, but INTEL_PANTHERLAKE_L maps to idle_cpu_ptl. Consider renaming the new table/struct to ptl_l_* (or similar) so it’s clear this is specific to the _L variant and stays consistent with nearby entries.

Copilot uses AI. Check for mistakes.
Comment thread drivers/idle/intel_idle.c
Comment on lines +991 to +992
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

Unnecessary & in function-pointer initializer: throughout this file .enter is set as intel_idle (without &). Please change this to intel_idle to match existing style and avoid checkpatch warnings.

Copilot uses AI. Check for mistakes.
Comment thread drivers/idle/intel_idle.c
Comment on lines +999 to +1000
.enter = &intel_idle,
.enter_s2idle = intel_idle_s2idle, },
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

Unnecessary & in function-pointer initializer: throughout this file .enter is set as intel_idle (without &). Please change this to intel_idle to match existing style and avoid checkpatch warnings.

Copilot uses AI. Check for mistakes.
@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: opsiff

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

The pull request process is described here

Details 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

@opsiff opsiff merged commit 06f2f26 into deepin-community:linux-6.18.y Apr 15, 2026
14 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants