diff options
-rw-r--r-- | drivers/acpi/cppc_acpi.c | 19 | ||||
-rw-r--r-- | include/acpi/cppc_acpi.h | 1 |
2 files changed, 12 insertions, 8 deletions
diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index 3ca0729f7e0e..ee00a1c94ff6 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c | |||
@@ -972,9 +972,9 @@ static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val) | |||
972 | int cppc_get_perf_caps(int cpunum, struct cppc_perf_caps *perf_caps) | 972 | int cppc_get_perf_caps(int cpunum, struct cppc_perf_caps *perf_caps) |
973 | { | 973 | { |
974 | struct cpc_desc *cpc_desc = per_cpu(cpc_desc_ptr, cpunum); | 974 | struct cpc_desc *cpc_desc = per_cpu(cpc_desc_ptr, cpunum); |
975 | struct cpc_register_resource *highest_reg, *lowest_reg, *ref_perf, | 975 | struct cpc_register_resource *highest_reg, *lowest_reg, |
976 | *nom_perf; | 976 | *lowest_non_linear_reg, *nominal_reg; |
977 | u64 high, low, nom; | 977 | u64 high, low, nom, min_nonlinear; |
978 | int ret = 0, regs_in_pcc = 0; | 978 | int ret = 0, regs_in_pcc = 0; |
979 | 979 | ||
980 | if (!cpc_desc) { | 980 | if (!cpc_desc) { |
@@ -984,12 +984,12 @@ int cppc_get_perf_caps(int cpunum, struct cppc_perf_caps *perf_caps) | |||
984 | 984 | ||
985 | highest_reg = &cpc_desc->cpc_regs[HIGHEST_PERF]; | 985 | highest_reg = &cpc_desc->cpc_regs[HIGHEST_PERF]; |
986 | lowest_reg = &cpc_desc->cpc_regs[LOWEST_PERF]; | 986 | lowest_reg = &cpc_desc->cpc_regs[LOWEST_PERF]; |
987 | ref_perf = &cpc_desc->cpc_regs[REFERENCE_PERF]; | 987 | lowest_non_linear_reg = &cpc_desc->cpc_regs[LOW_NON_LINEAR_PERF]; |
988 | nom_perf = &cpc_desc->cpc_regs[NOMINAL_PERF]; | 988 | nominal_reg = &cpc_desc->cpc_regs[NOMINAL_PERF]; |
989 | 989 | ||
990 | /* Are any of the regs PCC ?*/ | 990 | /* Are any of the regs PCC ?*/ |
991 | if (CPC_IN_PCC(highest_reg) || CPC_IN_PCC(lowest_reg) || | 991 | if (CPC_IN_PCC(highest_reg) || CPC_IN_PCC(lowest_reg) || |
992 | CPC_IN_PCC(ref_perf) || CPC_IN_PCC(nom_perf)) { | 992 | CPC_IN_PCC(lowest_non_linear_reg) || CPC_IN_PCC(nominal_reg)) { |
993 | regs_in_pcc = 1; | 993 | regs_in_pcc = 1; |
994 | down_write(&pcc_data.pcc_lock); | 994 | down_write(&pcc_data.pcc_lock); |
995 | /* Ring doorbell once to update PCC subspace */ | 995 | /* Ring doorbell once to update PCC subspace */ |
@@ -1005,10 +1005,13 @@ int cppc_get_perf_caps(int cpunum, struct cppc_perf_caps *perf_caps) | |||
1005 | cpc_read(cpunum, lowest_reg, &low); | 1005 | cpc_read(cpunum, lowest_reg, &low); |
1006 | perf_caps->lowest_perf = low; | 1006 | perf_caps->lowest_perf = low; |
1007 | 1007 | ||
1008 | cpc_read(cpunum, nom_perf, &nom); | 1008 | cpc_read(cpunum, nominal_reg, &nom); |
1009 | perf_caps->nominal_perf = nom; | 1009 | perf_caps->nominal_perf = nom; |
1010 | 1010 | ||
1011 | if (!high || !low || !nom) | 1011 | cpc_read(cpunum, lowest_non_linear_reg, &min_nonlinear); |
1012 | perf_caps->lowest_nonlinear_perf = min_nonlinear; | ||
1013 | |||
1014 | if (!high || !low || !nom || !min_nonlinear) | ||
1012 | ret = -EFAULT; | 1015 | ret = -EFAULT; |
1013 | 1016 | ||
1014 | out_err: | 1017 | out_err: |
diff --git a/include/acpi/cppc_acpi.h b/include/acpi/cppc_acpi.h index 427a7c3e6c75..34e9680c55db 100644 --- a/include/acpi/cppc_acpi.h +++ b/include/acpi/cppc_acpi.h | |||
@@ -103,6 +103,7 @@ struct cppc_perf_caps { | |||
103 | u32 highest_perf; | 103 | u32 highest_perf; |
104 | u32 nominal_perf; | 104 | u32 nominal_perf; |
105 | u32 lowest_perf; | 105 | u32 lowest_perf; |
106 | u32 lowest_nonlinear_perf; | ||
106 | }; | 107 | }; |
107 | 108 | ||
108 | struct cppc_perf_ctrls { | 109 | struct cppc_perf_ctrls { |