-
Notifications
You must be signed in to change notification settings - Fork 118
[Deepin-Kernel-SIG] [linux 6.6-y] [HISI] Backport cpufreq/pcie/ext-gpu/soc_cache/power_meter/perf_iostat/sdei_watchdog/HOTPLUG_SMT/FEAT_PMUv3_TH module for Kunpeng new SOC (Part 1) #1373
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
Changes from all commits
f1d34fe
c144c4b
ad9f9fa
12a30ec
41213aa
88a926a
2ddf94a
41729f9
dbdb317
3e99fd9
32dc4a9
266a317
5547c88
017ad0d
86cd42a
32c40ae
048e4e6
071d413
cdb391b
417baf0
ac244ee
7dca29a
390f140
0c214ca
4c88cba
69e2e6e
f7af86e
bb753e4
42e7f11
be2fd6f
213d513
9ea9629
47f1b7e
cb5fa54
a34374b
fb3a00e
ca89d35
97e99e7
12e2629
073839c
3402288
9c7f66a
f32fe46
fe5fde6
d65fb71
bebb511
725ecf5
a704396
c364203
2f6c580
2d3bdfd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -268,6 +268,45 @@ Description: Discover CPUs in the same CPU frequency coordination domain | |||||
| This file is only present if the acpi-cpufreq or the cppc-cpufreq | ||||||
| drivers are in use. | ||||||
|
|
||||||
| What: /sys/devices/system/cpu/cpuX/cpufreq/auto_act_window | ||||||
| Date: October 2024 | ||||||
| Contact: linux-pm@vger.kernel.org | ||||||
| Description: Autonomous activity window | ||||||
|
|
||||||
| This file indicates a moving utilization sensitivity window to | ||||||
| the platform's autonomous selection policy. | ||||||
|
|
||||||
| Read/write an integer represents autonomous activity window (in | ||||||
| microseconds) from/to this file. The max value to write is | ||||||
| 1270000000 but the max significand is 127. This means that if 128 | ||||||
| is written to this file, 127 will be stored. If the value is | ||||||
| greater than 130, only the first two digits will be saved as | ||||||
| significand. | ||||||
|
|
||||||
| Writing a zero value to this file enable the platform to | ||||||
| determine an appropriate Activity Window depending on the workload. | ||||||
|
|
||||||
| Writing to this file only has meaning when Autonomous Selection is | ||||||
| enabled. | ||||||
|
|
||||||
| This file only presents if the cppc-cpufreq driver is in use. | ||||||
|
||||||
| This file only presents if the cppc-cpufreq driver is in use. | |
| This file is only present if the cppc-cpufreq driver is in use. |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammatical error: should be "This file only presents" → "This file is only present" for correct English grammar and consistency with similar documentation entries (see line 268).
| This file only presents if the cppc-cpufreq driver is in use. | |
| This file is only present if the cppc-cpufreq driver is in use. |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -590,6 +590,48 @@ This governor exposes the following tunables: | |||||||||||||
| It effectively causes the frequency to go down ``sampling_down_factor`` | ||||||||||||||
| times slower than it ramps up. | ||||||||||||||
|
|
||||||||||||||
| ``seep`` | ||||||||||||||
| ------------ | ||||||||||||||
|
|
||||||||||||||
| This governor is specifically designed for platforms with hardware-managed P-states | ||||||||||||||
| through CPPC (Collaborative Processor Performance Control). Unlike other governors | ||||||||||||||
| that implement their own frequency scaling algorithms, the ``seep`` governor | ||||||||||||||
| delegates the P-state selection to the hardware/firmware by enabling CPPC | ||||||||||||||
| autonomous mode. | ||||||||||||||
|
|
||||||||||||||
| The governor requires the ``cppc_cpufreq`` driver and the platform must support | ||||||||||||||
| three key CPPC capabilities: | ||||||||||||||
| * Autonomous selection (auto_sel) | ||||||||||||||
| * Autonomous activity window (auto_act_window) | ||||||||||||||
| * Energy-Performance Preference (EPP) | ||||||||||||||
|
Comment on lines
+604
to
+606
|
||||||||||||||
| * Autonomous selection (auto_sel) | |
| * Autonomous activity window (auto_act_window) | |
| * Energy-Performance Preference (EPP) | |
| - Autonomous selection (auto_sel) | |
| - Autonomous activity window (auto_act_window) | |
| - Energy-Performance Preference (EPP) |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1213,6 +1213,11 @@ static int cppc_get_perf(int cpunum, enum cppc_regs reg_idx, u64 *perf) | |||||||||||||
| return ret; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| if (!CPC_SUPPORTED(reg)) { | ||||||||||||||
| pr_debug("CPC register %d is not supported\n", reg_idx); | ||||||||||||||
| return -EOPNOTSUPP; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| cpc_read(cpunum, reg, perf); | ||||||||||||||
|
|
||||||||||||||
| return 0; | ||||||||||||||
|
|
@@ -1538,6 +1543,139 @@ int cppc_set_epp_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls, bool enable) | |||||||||||||
| } | ||||||||||||||
| EXPORT_SYMBOL_GPL(cppc_set_epp_perf); | ||||||||||||||
|
|
||||||||||||||
| static int cppc_get_reg(int cpunum, enum cppc_regs reg_idx, u64 *val) | ||||||||||||||
| { | ||||||||||||||
| struct cpc_desc *cpc_desc = per_cpu(cpc_desc_ptr, cpunum); | ||||||||||||||
| struct cppc_pcc_data *pcc_ss_data = NULL; | ||||||||||||||
| struct cpc_register_resource *reg; | ||||||||||||||
| int pcc_ss_id; | ||||||||||||||
| int ret = 0; | ||||||||||||||
|
|
||||||||||||||
| if (!cpc_desc) { | ||||||||||||||
| pr_debug("No CPC descriptor for CPU:%d\n", cpunum); | ||||||||||||||
| return -ENODEV; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| reg = &cpc_desc->cpc_regs[reg_idx]; | ||||||||||||||
|
|
||||||||||||||
| if (!CPC_SUPPORTED(reg)) { | ||||||||||||||
| pr_debug("CPC register (reg_idx=%u) is not supported\n", reg_idx); | ||||||||||||||
| return -EOPNOTSUPP; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| if (CPC_IN_PCC(reg)) { | ||||||||||||||
| pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, cpunum); | ||||||||||||||
|
|
||||||||||||||
| if (pcc_ss_id < 0) | ||||||||||||||
| return -ENODEV; | ||||||||||||||
|
|
||||||||||||||
| pcc_ss_data = pcc_data[pcc_ss_id]; | ||||||||||||||
|
|
||||||||||||||
| down_write(&pcc_ss_data->pcc_lock); | ||||||||||||||
|
|
||||||||||||||
| if (send_pcc_cmd(pcc_ss_id, CMD_READ) >= 0) | ||||||||||||||
| cpc_read(cpunum, reg, val); | ||||||||||||||
| else | ||||||||||||||
| ret = -EIO; | ||||||||||||||
|
|
||||||||||||||
| up_write(&pcc_ss_data->pcc_lock); | ||||||||||||||
|
|
||||||||||||||
| return ret; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| cpc_read(cpunum, reg, val); | ||||||||||||||
|
|
||||||||||||||
| return 0; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| static int cppc_set_reg(int cpu, enum cppc_regs reg_idx, u64 val) | ||||||||||||||
| { | ||||||||||||||
| struct cpc_desc *cpc_desc = per_cpu(cpc_desc_ptr, cpu); | ||||||||||||||
| struct cppc_pcc_data *pcc_ss_data = NULL; | ||||||||||||||
| struct cpc_register_resource *reg; | ||||||||||||||
| int pcc_ss_id; | ||||||||||||||
| int ret; | ||||||||||||||
|
|
||||||||||||||
| if (!cpc_desc) { | ||||||||||||||
| pr_debug("No CPC descriptor for CPU:%d\n", cpu); | ||||||||||||||
| return -ENODEV; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| reg = &cpc_desc->cpc_regs[reg_idx]; | ||||||||||||||
|
|
||||||||||||||
| if (!CPC_SUPPORTED(reg)) { | ||||||||||||||
| pr_debug("CPC register (reg_idx=%u) is not supported\n", reg_idx); | ||||||||||||||
| return -EOPNOTSUPP; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| if (CPC_IN_PCC(reg)) { | ||||||||||||||
| pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, cpu); | ||||||||||||||
|
|
||||||||||||||
| if (pcc_ss_id < 0) { | ||||||||||||||
| pr_debug("Invalid pcc_ss_id\n"); | ||||||||||||||
| return -ENODEV; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| ret = cpc_write(cpu, reg, val); | ||||||||||||||
| if (ret) | ||||||||||||||
| return ret; | ||||||||||||||
|
|
||||||||||||||
| pcc_ss_data = pcc_data[pcc_ss_id]; | ||||||||||||||
|
|
||||||||||||||
| down_write(&pcc_ss_data->pcc_lock); | ||||||||||||||
| /* after writing CPC, transfer the ownership of PCC to platform */ | ||||||||||||||
| ret = send_pcc_cmd(pcc_ss_id, CMD_WRITE); | ||||||||||||||
| up_write(&pcc_ss_data->pcc_lock); | ||||||||||||||
| return ret; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| return cpc_write(cpu, reg, val); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| /** | ||||||||||||||
| * cppc_set_epp() - Write the EPP register | ||||||||||||||
| * @cpu:CPU on which to write register. | ||||||||||||||
| * @epp_val:Value to write to the EPP register. | ||||||||||||||
|
||||||||||||||
| * @epp_val:Value to write to the EPP register. | |
| * @epp_val: Value to write to the EPP register. |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after colon in documentation comment. Should be '@cpu: CPU on which to write register.' for consistency with Linux kernel documentation style.
| * @cpu:CPU on which to write register. | |
| * @epp_val:Value to write to the EPP register. | |
| * @cpu: CPU on which to write register. | |
| * @epp_val: Value to write to the EPP register. |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after colon in documentation comment. Should be '@cpunum: CPU from which to read register.' for consistency with Linux kernel documentation style.
| * @cpunum:CPU from which to read register. | |
| * @cpunum: CPU from which to read register. |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after colon in documentation comment. Should be '@auto_act_window: Return address.' for consistency with Linux kernel documentation style.
| * @auto_act_window:Return address. | |
| * @auto_act_window: Return address. |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after colon in documentation comment. Should be '@cpu: CPU on which to write register.' for consistency with Linux kernel documentation style.
| * @cpu:CPU on which to write register. | |
| * @auto_act_window:Value to write to the autonomous activity window register. | |
| * @cpu: CPU on which to write register. | |
| * @auto_act_window: Value to write to the autonomous activity window register. |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after colon in documentation comment. Should be '@auto_act_window: Value to write to the autonomous activity window register.' for consistency with Linux kernel documentation style.
| * @auto_act_window:Value to write to the autonomous activity window register. | |
| * @auto_act_window: Value to write to the autonomous activity window register. |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after colon in documentation comment. Should be '@cpunum: CPU from which to read register.' for consistency with Linux kernel documentation style.
| * @cpunum:CPU from which to read register. | |
| * @cpunum: CPU from which to read register. |
Copilot
AI
Dec 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter name in documentation comment is incorrect. The parameter is named 'auto_act_window' but the documentation says '@auto_act_window:Return address.' when it should describe an output parameter for autonomous selection, not activity window.
| * @auto_act_window:Return address. | |
| * @auto_sel:Return address. |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -19,6 +19,17 @@ config ACPI_CPPC_CPUFREQ | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| If in doubt, say N. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| config CPPC_CPUFREQ_SYSFS_INTERFACE | ||||||||||||||||||||||
| bool "Enable CPPC CPUFreq sysfs tuning interfaces" | ||||||||||||||||||||||
| depends on ACPI_CPPC_CPUFREQ && ARM64 | ||||||||||||||||||||||
| default n | ||||||||||||||||||||||
| help | ||||||||||||||||||||||
| This enables sysfs interfaces for CPPC CPUFreq driver including | ||||||||||||||||||||||
| auto_act_window and energy_perf. These interfaces allow users | ||||||||||||||||||||||
| to tune CPPC parameters at runtime. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| If unsure, say N. | ||||||||||||||||||||||
|
Comment on lines
+27
to
+31
|
||||||||||||||||||||||
| This enables sysfs interfaces for CPPC CPUFreq driver including | |
| auto_act_window and energy_perf. These interfaces allow users | |
| to tune CPPC parameters at runtime. | |
| If unsure, say N. | |
| This enables sysfs interfaces for CPPC CPUFreq driver including | |
| auto_act_window and energy_perf. These interfaces allow users | |
| to tune CPPC parameters at runtime. | |
| If unsure, say N. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammatical error: should be "enable" → "enables" to agree with the singular subject "Writing a zero value".