Skip to content

Commit b8fb0d9

Browse files
superm1jwrdegoede
authored andcommitted
platform/x86: amd-pmc: Correct usage of SMU version
Yellow carp has been outputting versions like `1093.24.0`, but this is supposed to be 69.24.0. That is the MSB is being interpreted incorrectly. The MSB is not part of the major version, but has generally been treated that way thus far. It's actually the program, and used to distinguish between two programs from a similar family but different codebase. Link: https://patchwork.freedesktop.org/patch/469993/ Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20220120174439.12770-1-mario.limonciello@amd.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 parent f8c28b9 commit b8fb0d9

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

drivers/platform/x86/amd-pmc.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,10 @@ struct amd_pmc_dev {
124124
u32 cpu_id;
125125
u32 active_ips;
126126
/* SMU version information */
127-
u16 major;
128-
u16 minor;
129-
u16 rev;
127+
u8 smu_program;
128+
u8 major;
129+
u8 minor;
130+
u8 rev;
130131
struct device *dev;
131132
struct pci_dev *rdev;
132133
struct mutex lock; /* generic mutex lock */
@@ -180,11 +181,13 @@ static int amd_pmc_get_smu_version(struct amd_pmc_dev *dev)
180181
if (rc)
181182
return rc;
182183

183-
dev->major = (val >> 16) & GENMASK(15, 0);
184+
dev->smu_program = (val >> 24) & GENMASK(7, 0);
185+
dev->major = (val >> 16) & GENMASK(7, 0);
184186
dev->minor = (val >> 8) & GENMASK(7, 0);
185187
dev->rev = (val >> 0) & GENMASK(7, 0);
186188

187-
dev_dbg(dev->dev, "SMU version is %u.%u.%u\n", dev->major, dev->minor, dev->rev);
189+
dev_dbg(dev->dev, "SMU program %u version is %u.%u.%u\n",
190+
dev->smu_program, dev->major, dev->minor, dev->rev);
188191

189192
return 0;
190193
}

0 commit comments

Comments
 (0)