Skip to content

Commit 1bc5d81

Browse files
mrhpearsonjwrdegoede
authored andcommitted
platform/x86: thinkpad_acpi: Fix profile modes on Intel platforms
My last commit to fix profile mode displays on AMD platforms caused an issue on Intel platforms - sorry! In it I was reading the current functional mode (MMC, PSC, AMT) from the BIOS but didn't account for the fact that on some of our Intel platforms I use a different API which returns just the profile and not the functional mode. This commit fixes it so that on Intel platforms it knows the functional mode is always MMC. I also fixed a potential problem that a platform may try to set the mode for both MMC and PSC - which was incorrect. Tested on X1 Carbon 9 (Intel) and Z13 (AMD). Link: https://bugzilla.kernel.org/show_bug.cgi?id=216963 Fixes: fde5f74 ("platform/x86: thinkpad_acpi: Fix profile mode display in AMT mode") Cc: [email protected] Reviewed-by: Mario Limonciello <[email protected]> Signed-off-by: Mark Pearson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent b0935f1 commit 1bc5d81

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/platform/x86/thinkpad_acpi.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10496,8 +10496,7 @@ static int dytc_profile_set(struct platform_profile_handler *pprof,
1049610496
if (err)
1049710497
goto unlock;
1049810498
}
10499-
}
10500-
if (dytc_capabilities & BIT(DYTC_FC_PSC)) {
10499+
} else if (dytc_capabilities & BIT(DYTC_FC_PSC)) {
1050110500
err = dytc_command(DYTC_SET_COMMAND(DYTC_FUNCTION_PSC, perfmode, 1), &output);
1050210501
if (err)
1050310502
goto unlock;
@@ -10525,14 +10524,16 @@ static void dytc_profile_refresh(void)
1052510524
err = dytc_command(DYTC_CMD_MMC_GET, &output);
1052610525
else
1052710526
err = dytc_cql_command(DYTC_CMD_GET, &output);
10528-
} else if (dytc_capabilities & BIT(DYTC_FC_PSC))
10527+
funcmode = DYTC_FUNCTION_MMC;
10528+
} else if (dytc_capabilities & BIT(DYTC_FC_PSC)) {
1052910529
err = dytc_command(DYTC_CMD_GET, &output);
10530-
10530+
/* Check if we are PSC mode, or have AMT enabled */
10531+
funcmode = (output >> DYTC_GET_FUNCTION_BIT) & 0xF;
10532+
}
1053110533
mutex_unlock(&dytc_mutex);
1053210534
if (err)
1053310535
return;
1053410536

10535-
funcmode = (output >> DYTC_GET_FUNCTION_BIT) & 0xF;
1053610537
perfmode = (output >> DYTC_GET_MODE_BIT) & 0xF;
1053710538
convert_dytc_to_profile(funcmode, perfmode, &profile);
1053810539
if (profile != dytc_current_profile) {

0 commit comments

Comments
 (0)