Skip to content

Commit b3e127d

Browse files
mrhpearsonij-intel
authored andcommitted
platform/x86: thinkpad_acpi: Fix registration of tpacpi platform driver
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 <mpearson-lenovo@squebb.ca> Reviewed-by: Kurt Borja <kuurtb@gmail.com> Link: https://lore.kernel.org/r/20250211173620.16522-1-mpearson-lenovo@squebb.ca Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
1 parent 569617d commit b3e127d

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
@@ -10668,8 +10668,8 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm)
1066810668
"DYTC version %d: thermal mode available\n", dytc_version);
1066910669

1067010670
/* Create platform_profile structure and register */
10671-
tpacpi_pprof = devm_platform_profile_register(&tpacpi_pdev->dev, "thinkpad-acpi",
10672-
NULL, &dytc_profile_ops);
10671+
tpacpi_pprof = platform_profile_register(&tpacpi_pdev->dev, "thinkpad-acpi-profile",
10672+
NULL, &dytc_profile_ops);
1067310673
/*
1067410674
* If for some reason platform_profiles aren't enabled
1067510675
* don't quit terminally.
@@ -10687,8 +10687,15 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm)
1068710687
return 0;
1068810688
}
1068910689

10690+
static void dytc_profile_exit(void)
10691+
{
10692+
if (!IS_ERR_OR_NULL(tpacpi_pprof))
10693+
platform_profile_remove(tpacpi_pprof);
10694+
}
10695+
1069010696
static struct ibm_struct dytc_profile_driver_data = {
1069110697
.name = "dytc-profile",
10698+
.exit = dytc_profile_exit,
1069210699
};
1069310700

1069410701
/*************************************************************************

0 commit comments

Comments
 (0)