[Deepin-Kernel-SIG] [linux 6.18-y] [Upstream] [Intel] intel_idle: Add Panther Lake C-states table#1628
Conversation
[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>
Reviewer's GuideAdds 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_idlesequenceDiagram
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
Class diagram for new Panther Lake C-states integrationclassDiagram
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
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
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_cpudescriptor and hook it up inintel_idle_idsforINTEL_PANTHERLAKE_L.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| .enter = &intel_idle, | ||
| .enter_s2idle = intel_idle_s2idle, }, |
There was a problem hiding this comment.
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.
| .enter = &intel_idle, | ||
| .enter_s2idle = intel_idle_s2idle, }, |
There was a problem hiding this comment.
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.
| 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), |
There was a problem hiding this comment.
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.
| .enter = &intel_idle, | ||
| .enter_s2idle = intel_idle_s2idle, }, |
There was a problem hiding this comment.
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.
| .enter = &intel_idle, | ||
| .enter_s2idle = intel_idle_s2idle, }, |
There was a problem hiding this comment.
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.
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[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: