[PATCH 4/6] devfreq: hisi_uncore: Preserve PCC shared memory signature
From: Sudeep Holla
Date: Sat Jun 27 2026 - 12:42:34 EST
ACPI specification defines the generic PCC shared memory signature as
the PCC base signature ORed with the subspace ID.
ACPI 6.6 added clarification that the signature is populated by the
platform and verified by OSPM.
The PCC mailbox controller now validates the signature when the channel
is requested. Stop copying a complete local PCC header into shared
memory and write only the command, status and payload fields, leaving
the platform-populated signature intact.
Cc: MyungJoo Ham <myungjoo.ham@xxxxxxxxxxx>
Cc: Kyungmin Park <kyungmin.park@xxxxxxxxxxx>
Cc: Chanwoo Choi <cw00.choi@xxxxxxxxxxx>
Cc: Huisong Li <lihuisong@xxxxxxxxxx>
Cc: linux-pm@xxxxxxxxxxxxxxx
Signed-off-by: Sudeep Holla <sudeep.holla@xxxxxxxxxx>
---
drivers/devfreq/hisi_uncore_freq.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/devfreq/hisi_uncore_freq.c b/drivers/devfreq/hisi_uncore_freq.c
index 4d00d813c8ac..7976eb359061 100644
--- a/drivers/devfreq/hisi_uncore_freq.c
+++ b/drivers/devfreq/hisi_uncore_freq.c
@@ -187,7 +187,6 @@ static int hisi_uncore_cmd_send(struct hisi_uncore_freq *uncore,
u8 cmd, u32 *data)
{
struct hisi_uncore_pcc_shmem __iomem *addr;
- struct hisi_uncore_pcc_shmem shmem;
struct pcc_mbox_chan *pchan;
unsigned int mrtt;
s64 time_delta;
@@ -210,13 +209,13 @@ static int hisi_uncore_cmd_send(struct hisi_uncore_freq *uncore,
if (mrtt > time_delta)
udelay(mrtt - time_delta);
- /* Copy data */
- shmem.head = (struct acpi_pcct_shared_memory) {
- .signature = PCC_SIGNATURE | uncore->chan_id,
- .command = cmd,
- };
- shmem.pcc_data.data = *data;
- memcpy_toio(addr, &shmem, sizeof(shmem));
+ /*
+ * Copy command and data, leaving the platform-populated signature
+ * intact.
+ */
+ iowrite16(cmd, &addr->head.command);
+ iowrite16(0, &addr->head.status);
+ iowrite32(*data, &addr->pcc_data.data);
/* Ring doorbell */
rc = mbox_send_message(pchan->mchan, &cmd);
--
2.43.0