Skip to content

Commit aaf21ac

Browse files
superm1rafaeljw
authored andcommitted
ACPI: CPPC: Add support for setting EPP register in FFH
Some Asus AMD systems are reported to not be able to change EPP values because the BIOS doesn't advertise support for the CPPC MSR and the PCC region is not configured. However the ACPI 6.2 specification allows CPC registers to be declared in FFH: ``` Starting with ACPI Specification 6.2, all _CPC registers can be in PCC, System Memory, System IO, or Functional Fixed Hardware address spaces. OSPM support for this more flexible register space scheme is indicated by the “Flexible Address Space for CPPC Registers” _OSC bit. ``` If this _OSC has been set allow using FFH to configure EPP. Reported-by: [email protected] Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218686 Suggested-by: [email protected] Tested-by: [email protected] Tested-by: [email protected] Signed-off-by: Mario Limonciello <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 60949b7 commit aaf21ac

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/acpi/cppc_acpi.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ static DEFINE_PER_CPU(struct cpc_desc *, cpc_desc_ptr);
103103
(cpc)->cpc_entry.reg.space_id == \
104104
ACPI_ADR_SPACE_PLATFORM_COMM)
105105

106+
/* Check if a CPC register is in FFH */
107+
#define CPC_IN_FFH(cpc) ((cpc)->type == ACPI_TYPE_BUFFER && \
108+
(cpc)->cpc_entry.reg.space_id == \
109+
ACPI_ADR_SPACE_FIXED_HARDWARE)
110+
106111
/* Check if a CPC register is in SystemMemory */
107112
#define CPC_IN_SYSTEM_MEMORY(cpc) ((cpc)->type == ACPI_TYPE_BUFFER && \
108113
(cpc)->cpc_entry.reg.space_id == \
@@ -1521,9 +1526,12 @@ int cppc_set_epp_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls, bool enable)
15211526
/* after writing CPC, transfer the ownership of PCC to platform */
15221527
ret = send_pcc_cmd(pcc_ss_id, CMD_WRITE);
15231528
up_write(&pcc_ss_data->pcc_lock);
1529+
} else if (osc_cpc_flexible_adr_space_confirmed &&
1530+
CPC_SUPPORTED(epp_set_reg) && CPC_IN_FFH(epp_set_reg)) {
1531+
ret = cpc_write(cpu, epp_set_reg, perf_ctrls->energy_perf);
15241532
} else {
15251533
ret = -ENOTSUPP;
1526-
pr_debug("_CPC in PCC is not supported\n");
1534+
pr_debug("_CPC in PCC and _CPC in FFH are not supported\n");
15271535
}
15281536

15291537
return ret;

0 commit comments

Comments
 (0)