From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Mario Limonciello <mario.limonciello@amd.com>
Cc: Borislav Petkov <bp@alien8.de>,
Hans de Goede <hdegoede@redhat.com>,
x86@kernel.org, "Gautham R . Shenoy" <gautham.shenoy@amd.com>,
Perry Yuan <perry.yuan@amd.com>,
LKML <linux-kernel@vger.kernel.org>,
linux-doc@vger.kernel.org, linux-pm@vger.kernel.org,
platform-driver-x86@vger.kernel.org,
Shyam Sundar S K <Shyam-sundar.S-k@amd.com>,
Perry Yuan <Perry.Yuan@amd.com>
Subject: Re: [PATCH v2 09/13] platform/x86: hfi: add power management callback
Date: Mon, 14 Oct 2024 13:29:07 +0300 (EEST) [thread overview]
Message-ID: <d83fb93d-322a-180d-1cc6-6b898ad63b92@linux.intel.com> (raw)
In-Reply-To: <20241010193705.10362-10-mario.limonciello@amd.com>
On Thu, 10 Oct 2024, Mario Limonciello wrote:
> From: Perry Yuan <Perry.Yuan@amd.com>
>
> Introduces power management callbacks for the `amd_hfi` driver.
> Specifically, the `suspend` and `resume` callbacks have been added
> to handle the necessary operations during system low power states
> and wake-up.
>
> Signed-off-by: Perry Yuan <Perry.Yuan@amd.com>
> Co-developed-by: Mario Limonciello <mario.limonciello@amd.com>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
> v2:
> * Whitespace changes
> * Use on online CPUs not present ones
> ---
> 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 c969ee7ea5ee..0263993b0a94 100644
> --- a/drivers/platform/x86/amd/hfi/hfi.c
> +++ b/drivers/platform/x86/amd/hfi/hfi.c
> @@ -407,6 +407,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_present_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},
> { }
> @@ -458,6 +490,7 @@ static struct platform_driver amd_hfi_driver = {
> .driver = {
> .name = AMD_HFI_DRIVER,
> .owner = THIS_MODULE,
> + .pm = &amd_hfi_pm_ops,
This is inconsistent.
> .acpi_match_table = ACPI_PTR(amd_hfi_platform_match),
> },
> .probe = amd_hfi_probe,
>
--
i.
next prev parent reply other threads:[~2024-10-14 10:29 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-10 19:36 [PATCH v2 00/13] Add support for AMD hardware feedback interface Mario Limonciello
2024-10-10 19:36 ` [PATCH v2 01/13] Documentation: x86: Add AMD Hardware Feedback Interface documentation Mario Limonciello
2024-10-12 3:53 ` Bagas Sanjaya
2024-10-10 19:36 ` [PATCH v2 02/13] MAINTAINERS: Add maintainer entry for AMD Hardware Feedback Driver Mario Limonciello
2024-10-10 19:36 ` [PATCH v2 03/13] x86/cpufeatures: add X86_FEATURE_WORKLOAD_CLASS feature bit Mario Limonciello
2024-10-10 19:36 ` [PATCH v2 04/13] x86/msr-index: define AMD heterogeneous CPU related MSR Mario Limonciello
2024-10-10 19:36 ` [PATCH v2 05/13] platform/x86: hfi: Introduce AMD Hardware Feedback Interface Driver Mario Limonciello
2024-10-14 9:10 ` Ilpo Järvinen
2024-10-14 19:46 ` Mario Limonciello
2024-10-14 9:20 ` Ilpo Järvinen
2024-10-15 3:52 ` Ricardo Neri
2024-10-15 18:09 ` Mario Limonciello
2024-10-17 23:33 ` Ricardo Neri
2024-10-18 13:46 ` Mario Limonciello
2024-10-16 9:36 ` Uwe Kleine-König
2024-10-16 9:59 ` Hans de Goede
2024-10-16 16:06 ` Mario Limonciello
2024-10-10 19:36 ` [PATCH v2 06/13] platform/x86: hfi: parse CPU core ranking data from shared memory Mario Limonciello
2024-10-14 10:14 ` Ilpo Järvinen
2024-10-14 20:09 ` Mario Limonciello
2024-10-10 19:36 ` [PATCH v2 07/13] platform/x86: hfi: init per-cpu scores for each class Mario Limonciello
2024-10-14 10:15 ` Ilpo Järvinen
2024-10-10 19:37 ` [PATCH v2 08/13] platform/x86: hfi: add online and offline callback support Mario Limonciello
2024-10-14 10:27 ` Ilpo Järvinen
2024-10-10 19:37 ` [PATCH v2 09/13] platform/x86: hfi: add power management callback Mario Limonciello
2024-10-14 10:29 ` Ilpo Järvinen [this message]
2024-10-10 19:37 ` [PATCH v2 10/13] x86/cpu: Enable SD_ASYM_PACKING for DIE Domain on AMD Processors Mario Limonciello
2024-10-10 19:37 ` [PATCH v2 11/13] x86/process: Clear hardware feedback history for AMD processors Mario Limonciello
2024-10-10 19:37 ` [PATCH v2 12/13] cpufreq/amd-pstate: Disable preferred cores on designs with workload classification Mario Limonciello
2024-10-10 19:37 ` [PATCH v2 13/13] platform/x86/amd: hfi: Set ITMT priority from ranking data Mario Limonciello
2024-10-11 0:54 ` [PATCH v2 00/13] Add support for AMD hardware feedback interface Bagas Sanjaya
2024-10-11 1:29 ` Mario Limonciello
2024-10-12 2:21 ` Bagas Sanjaya
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d83fb93d-322a-180d-1cc6-6b898ad63b92@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=bp@alien8.de \
--cc=gautham.shenoy@amd.com \
--cc=hdegoede@redhat.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=perry.yuan@amd.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).