include: mailbox: correct RPMI CPPC request field ordering

Per the RPMI specification, CPPC_PROBE_REG, CPPC_READ_REG, and
CPPC_WRITE_REG require REG_ID in word 0 and HART_ID in word 1.

The current request structures have these fields swapped, causing
incompatibility with spec-compliant RPMI servers.

Swap the fields to match the specification and reorder the
corresponding field assignments in lib for consistency.

Fixes: 591a98bdd5 ("lib: utils/cppc: Add RPMI CPPC driver")
Signed-off-by: wuliwen <liwen.wu@spacemit.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20261022020525.1503945-1-liwen.wu@spacemit.com
Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
wuliwen authored and Anup Patel committed 2026-11-04 12:02:53 +05:30
1 parent f6abdaf25d
commit 332798211e
2 files changed
+6 -6

No files matched your search

+3 -3
View File
@@ -116,8 +116,8 @@ static int rpmi_cppc_read(unsigned long reg, u64 *val)
struct rpmi_cppc_read_reg_resp resp;
struct rpmi_cppc *cppc;
req.hart_id = current_hartid();
req.reg_id = reg;
req.hart_id = current_hartid();
cppc = rpmi_cppc_get_pointer(req.hart_id);
if ((reg == SBI_CPPC_DELIVERED_CTR) && cppc->fc_supported) {
@@ -170,8 +170,8 @@ static int rpmi_cppc_write(unsigned long reg, u64 val)
struct rpmi_cppc *cppc = rpmi_cppc_get_pointer(hart_id);
if (reg != SBI_CPPC_DESIRED_PERF || !cppc->fc_supported) {
req.hart_id = hart_id;
req.reg_id = reg;
req.hart_id = hart_id;
req.data_lo = val & 0xFFFFFFFF;
req.data_hi = val >> 32;
@@ -197,8 +197,8 @@ static int rpmi_cppc_probe(unsigned long reg)
struct rpmi_cppc_probe_resp resp;
struct rpmi_cppc_probe_req req;
req.hart_id = current_hartid();
req.reg_id = reg;
req.hart_id = current_hartid();
cppc = rpmi_cppc_get_pointer(req.hart_id);
if (!cppc)