[PATCH] ACPI: RISC-V: CPPC: Add CSR_CYCLE for CPPC FFH

Yunhui Cui
2025-05-15T09:44:11Z

Add the read of CSR_CYCLE to cppc_ffh_csr_read() to fix the
warning message: "CPPC Cpufreq: cppc_scale_freq_wokrfn: failed
to read perf counters".

Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com>
---
drivers/acpi/riscv/cppc.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/riscv/cppc.c b/drivers/acpi/riscv/cppc.c
index 4cdff387deff6..c1acaeb18eac3 100644
--- a/drivers/acpi/riscv/cppc.c
+++ b/drivers/acpi/riscv/cppc.c
@@ -69,11 +69,14 @@ static void cppc_ffh_csr_read(void *read_data)
struct sbi_cppc_data *data = (struct sbi_cppc_data *)read_data;

switch (data->reg) {
- /* Support only TIME CSR for now */
case CSR_TIME:
data->ret.value = csr_read(CSR_TIME);
data->ret.error = 0;
break;
+ case CSR_CYCLE:
+ data->ret.value = csr_read(CSR_CYCLE);
+ data->ret.error = 0;
+ break;
default:
data->ret.error = -EINVAL;
break;
--
2.39.2