Skip to contentSkip to conversation

Drop scratch register for 0x1a/0x80

PATCH In review Mario Limonciello 2 participants 4 messages Sep 18 – Oct 5

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Drop scratch register for 0x1a/0x80

This platform doesn't support idle mask in scratch register. Drop it and make sure matching debugfs doesn't show up to return an error.

Mario Limonciello (2):
platform/x86/amd: pmc: Only create amd_pmc_idlemask if scratch defined platform/x86/amd: pmc: Drop scratch_reg from amd_1ah_m80_cpu_info

 drivers/platform/x86/amd/pmc/pmc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/2 platform/x86/amd: pmc: Only create amd_pmc_idlemask if scratch defined

If the scratch register isn't defined for a platform, the debugfs file will always fail. Only create it when declared.

---
 drivers/platform/x86/amd/pmc/pmc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/platform/x86/amd/pmc/pmc.c +3 -2
index e384b56d67559..666ecdd8888b5 100644
@@ -517,8 +517,9 @@ static void amd_pmc_dbgfs_register(struct amd_pmc_dev *dev)
 			    &smu_fw_info_fops);
 	debugfs_create_file("s0ix_stats", 0644, dev->dbgfs_dir, dev,
 			    &s0ix_stats_fops);
-	debugfs_create_file("amd_pmc_idlemask", 0644, dev->dbgfs_dir, dev,
-			    &amd_pmc_idlemask_fops);
+	if (dev->cpu_info->scratch_reg)
+		debugfs_create_file("amd_pmc_idlemask", 0644, dev->dbgfs_dir, dev,
+					&amd_pmc_idlemask_fops);
 }
 
 static char *amd_pmc_get_msg_port(struct amd_pmc_dev *dev)
Signature · 1 line
2.43.0
#2 lore raw

PATCH 2/2 platform/x86/amd: pmc: Drop scratch_reg from amd_1ah_m80_cpu_info

In reply to Mario Limonciello

This platform does no longer populate this register.

Fixes 2726b5758f80a ("platform/x86: amd-pmc: Use correct IP block table for AMD 1Ah M80H SoC")
---
 drivers/platform/x86/amd/pmc/pmc.c | 1 -
 1 file changed, 1 deletion(-)
drivers/platform/x86/amd/pmc/pmc.c +0 -1
index 666ecdd8888b5..2bb61a65e1cb5 100644
@@ -182,7 +182,6 @@ static const struct amd_pmc_cpu_info amd_1ah_m80_cpu_info = {
 	.smu_arg	= AMD_PMC_REGISTER_ARG_1AH_80H,
 	.smu_rsp	= AMD_PMC_REGISTER_RSP_1AH_80H,
 	.num_ips	= ARRAY_SIZE(soc15_ip_blk_v3),
-	.scratch_reg	= AMD_PMC_SCRATCH_REG_1AH,
 	.ips_ptr	= soc15_ip_blk_v3,
 	.os_hint	= MSG_OS_HINT_RN,
 };
Signature · 1 line
2.43.0
maintainer
#3 lore raw
In reply to Mario Limonciello
Quoted 8 lines · Mario Limonciello

This platform doesn't support idle mask in scratch register. Drop it and make sure matching debugfs doesn't show up to return an error.

Mario Limonciello (2):
platform/x86/amd: pmc: Only create amd_pmc_idlemask if scratch defined platform/x86/amd: pmc: Drop scratch_reg from amd_1ah_m80_cpu_info

[...]

Thank you for your contribution, it has been applied to my local review-ilpo-next branch. Note it will show up in the public platform-drivers-x86/review-ilpo-next branch only once I've pushed my local branch there, which might take a while.

FYI [if applicable to your patch], as per Linus' policy change, also fixes are mostly routed through for-next unless the fix is for a commit introduced in the most recent cycle or is clearly a regression fix.

The list of commits applied:
[1/2] platform/x86/amd: pmc: Only create amd_pmc_idlemask if scratch defined

      commit: 4f368b44557c0adba84ee4e790f5a85f6e3043c1
[2/2] platform/x86/amd: pmc: Drop scratch_reg from amd_1ah_m80_cpu_info
      commit: 4234b341f1c2e24a38e490d8ac6067cd6ef7f1ca

--
i.