[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <175196903664.406.14079997026829440530.tip-bot2@tip-bot2>
Date: Tue, 08 Jul 2025 10:03:56 -0000
From: "tip-bot2 for Perry Yuan" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Perry Yuan <Perry.Yuan@....com>,
Mario Limonciello <mario.limonciello@....com>,
"Borislav Petkov (AMD)" <bp@...en8.de>,
"Gautham R. Shenoy" <gautham.shenoy@....com>, ilpo.jarvinen@...ux.intel.com,
x86@...nel.org, linux-kernel@...r.kernel.org
Subject: [tip: x86/platform] platform/x86: hfi: Add power management callback
The following commit has been merged into the x86/platform branch of tip:
Commit-ID: 263e66f9c35922d0cfd961df6d7a492820143792
Gitweb: https://git.kernel.org/tip/263e66f9c35922d0cfd961df6d7a492820143792
Author: Perry Yuan <Perry.Yuan@....com>
AuthorDate: Mon, 09 Jun 2025 15:05:13 -05:00
Committer: Borislav Petkov (AMD) <bp@...en8.de>
CommitterDate: Mon, 07 Jul 2025 22:26:37 +02:00
platform/x86: hfi: Add power management callback
Introduce power management callbacks for the `amd_hfi` driver. Specifically,
add the `suspend` and `resume` callbacks to handle the necessary operations
during system low power states and wake-up.
Signed-off-by: Perry Yuan <Perry.Yuan@....com>
Co-developed-by: Mario Limonciello <mario.limonciello@....com>
Signed-off-by: Mario Limonciello <mario.limonciello@....com>
Signed-off-by: Borislav Petkov (AMD) <bp@...en8.de>
Reviewed-by: Gautham R. Shenoy <gautham.shenoy@....com>
Acked-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Link: https://lore.kernel.org/20250609200518.3616080-9-superm1@kernel.org
---
drivers/platform/x86/amd/hfi/hfi.c | 33 +++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+)
diff --git a/drivers/platform/x86/amd/hfi/hfi.c b/drivers/platform/x86/amd/hfi/hfi.c
index 28ef721..b0a5840 100644
--- a/drivers/platform/x86/amd/hfi/hfi.c
+++ b/drivers/platform/x86/amd/hfi/hfi.c
@@ -385,6 +385,38 @@ static int amd_hfi_metadata_parser(struct platform_device *pdev,
return ret;
}
+static int amd_hfi_pm_resume(struct device *dev)
+{
+ int ret, cpu;
+
+ for_each_online_cpu(cpu) {
+ ret = amd_hfi_set_state(cpu, true);
+ if (ret < 0) {
+ dev_err(dev, "failed to enable workload class config: %d\n", ret);
+ return ret;
+ }
+ }
+
+ return 0;
+}
+
+static int amd_hfi_pm_suspend(struct device *dev)
+{
+ int ret, cpu;
+
+ for_each_online_cpu(cpu) {
+ ret = amd_hfi_set_state(cpu, false);
+ if (ret < 0) {
+ dev_err(dev, "failed to disable workload class config: %d\n", ret);
+ return ret;
+ }
+ }
+
+ return 0;
+}
+
+static DEFINE_SIMPLE_DEV_PM_OPS(amd_hfi_pm_ops, amd_hfi_pm_suspend, amd_hfi_pm_resume);
+
static const struct acpi_device_id amd_hfi_platform_match[] = {
{"AMDI0104", 0},
{ }
@@ -434,6 +466,7 @@ static struct platform_driver amd_hfi_driver = {
.driver = {
.name = AMD_HFI_DRIVER,
.owner = THIS_MODULE,
+ .pm = &amd_hfi_pm_ops,
.acpi_match_table = ACPI_PTR(amd_hfi_platform_match),
},
.probe = amd_hfi_probe,
Powered by blists - more mailing lists