Skip to content

Commit 7952849

Browse files
committed
platform/x86: thinkpad_acpi: Fix registration of tpacpi platform driver
JIRA: https://issues.redhat.com/browse/RHEL-89362 commit b3e127d Author: Mark Pearson <[email protected]> Date: Tue Feb 11 12:36:11 2025 -0500 The recent platform profile changes prevent the tpacpi platform driver from registering. This error is seen in the kernel logs, and the various tpacpi entries are not created: [ 7550.642171] platform thinkpad_acpi: Resources present before probing This happens because devm_platform_profile_register() is called before tpacpi_pdev probes (thanks to Kurt Borja for identifying the root cause). For now revert back to the old platform_profile_register to fix the issue. This is quick fix and will be re-implemented later as more testing is needed for full solution. Tested on X1 Carbon G12. Fixes: 31658c9 ("platform/x86: thinkpad_acpi: Use devm_platform_profile_register()") Signed-off-by: Mark Pearson <[email protected]> Reviewed-by: Kurt Borja <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]> Signed-off-by: Mark Langsdorf <[email protected]>
1 parent e46a10c commit 7952849

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

drivers/platform/x86/thinkpad_acpi.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10644,8 +10644,8 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm)
1064410644
"DYTC version %d: thermal mode available\n", dytc_version);
1064510645

1064610646
/* Create platform_profile structure and register */
10647-
tpacpi_pprof = devm_platform_profile_register(&tpacpi_pdev->dev, "thinkpad-acpi",
10648-
NULL, &dytc_profile_ops);
10647+
tpacpi_pprof = platform_profile_register(&tpacpi_pdev->dev, "thinkpad-acpi-profile",
10648+
NULL, &dytc_profile_ops);
1064910649
/*
1065010650
* If for some reason platform_profiles aren't enabled
1065110651
* don't quit terminally.
@@ -10663,8 +10663,15 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm)
1066310663
return 0;
1066410664
}
1066510665

10666+
static void dytc_profile_exit(void)
10667+
{
10668+
if (!IS_ERR_OR_NULL(tpacpi_pprof))
10669+
platform_profile_remove(tpacpi_pprof);
10670+
}
10671+
1066610672
static struct ibm_struct dytc_profile_driver_data = {
1066710673
.name = "dytc-profile",
10674+
.exit = dytc_profile_exit,
1066810675
};
1066910676

1067010677
/*************************************************************************

0 commit comments

Comments
 (0)