mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: Perry Yuan <perry.yuan@amd.com>,
	hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com,
	Borislav.Petkov@amd.com, kprateek.nayak@amd.com
Cc: Alexander.Deucher@amd.com, Xinmei.Huang@amd.com,
	bharathprabhu.perdoor@amd.com, poonam.aggrwal@amd.com,
	Li.Meng@amd.com, platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, Xiaojian.Du@amd.com
Subject: Re: [PATCH 09/11] platform/x86/: hfi: add power management callback
Date: Tue, 27 Aug 2024 12:23:11 -0500	[thread overview]
Message-ID: <ce42149f-d92a-4f54-bff5-6ee9adbf0c19@amd.com> (raw)
In-Reply-To: <d2a39a68666e2dffa8f0ca9ba32deacc722ea2b1.1724748733.git.perry.yuan@amd.com>

On 8/27/2024 04:36, Perry Yuan 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>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>   drivers/platform/x86/amd/hfi/hfi.c | 34 ++++++++++++++++++++++++++++++
>   1 file changed, 34 insertions(+)
> 
> diff --git a/drivers/platform/x86/amd/hfi/hfi.c b/drivers/platform/x86/amd/hfi/hfi.c
> index 57b642c4c522..c3da2edf8590 100644
> --- a/drivers/platform/x86/amd/hfi/hfi.c
> +++ b/drivers/platform/x86/amd/hfi/hfi.c
> @@ -304,6 +304,39 @@ static void amd_hfi_remove(struct platform_device *pdev)
>   	mutex_destroy(&dev->lock);
>   }
>   
> +static int amd_hfi_pm_resume(struct device *dev)
> +{
> +	int cpu, err;
> +
> +	for_each_present_cpu(cpu) {
> +		err = amd_hfi_set_state(cpu, true);
> +		if (err < 0) {
> +			dev_err(dev, "failed to enable workload class config: %d\n", err);
> +			return err;
> +		}
> +	}
> +
> +	return 0;
> +}
> +
> +static int amd_hfi_pm_suspend(struct device *dev)
> +{
> +	int err, cpu;
> +
> +	for_each_possible_cpu(cpu) {
> +		err = amd_hfi_set_state(cpu, false);
> +		if (err < 0) {
> +			dev_err(dev, "failed to disable workload class config: %d\n", err);
> +			return err;
> +		}
> +	}
> +
> +	return 0;
> +}
> +
> +static DEFINE_SIMPLE_DEV_PM_OPS(amd_hfi_pm_ops,
> +		amd_hfi_pm_suspend, amd_hfi_pm_resume);
> +
>   static int amd_set_hfi_ipcc_score(struct amd_hfi_cpuinfo *hfi_cpuinfo, int cpu)
>   {
>   	int i, *hfi_scores;
> @@ -569,6 +602,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,


  reply	other threads:[~2024-08-27 17:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27  9:36 [PATCH 00/11] Introduce New AMD Heterogeneous Core Driver Perry Yuan
2024-08-27  9:36 ` [PATCH 01/11] Documentation: x86: Add AMD Hardware Feedback Interface documentation Perry Yuan
2024-08-27 17:20   ` Mario Limonciello
2024-08-27  9:36 ` [PATCH 02/11] MAINTAINERS: Add maintainer entry for AMD Hardware Feedback Driver Perry Yuan
2024-08-27 17:21   ` Mario Limonciello
2024-08-27  9:36 ` [PATCH 03/11] x86/cpufeatures: add X86_FEATURE_WORKLOAD_CLASS feature bit Perry Yuan
2024-08-27  9:36 ` [PATCH 04/11] x86/msr-index: define AMD heterogeneous CPU related MSR Perry Yuan
2024-08-27  9:36 ` [PATCH 05/11] platform/x86: hfi: Introduce AMD Hardware Feedback Interface Driver Perry Yuan
2024-08-27 17:32   ` Mario Limonciello
2024-08-27  9:36 ` [PATCH 06/11] platform/x86/: hfi: parse CPU core ranking data from shared memory Perry Yuan
2024-08-27 10:19   ` Ilpo Järvinen
2024-08-27  9:36 ` [PATCH 07/11] platform/x86/: hfi: init per-cpu scores for each class Perry Yuan
2024-08-27 10:32   ` Ilpo Järvinen
2024-08-27  9:36 ` [PATCH 08/11] platform/x86/: hfi: add online and offline callback support Perry Yuan
2024-08-27 10:53   ` Ilpo Järvinen
2024-08-27  9:36 ` [PATCH 09/11] platform/x86/: hfi: add power management callback Perry Yuan
2024-08-27 17:23   ` Mario Limonciello [this message]
2024-08-27  9:36 ` [PATCH 10/11] x86/process: Clear hardware feedback history for AMD processors Perry Yuan
2024-08-27  9:36 ` [PATCH 11/11] x86/cpu: Enable SD_ASYM_PACKING for DIE Domain on AMD Processors Perry Yuan

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=ce42149f-d92a-4f54-bff5-6ee9adbf0c19@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Borislav.Petkov@amd.com \
    --cc=Li.Meng@amd.com \
    --cc=Xiaojian.Du@amd.com \
    --cc=Xinmei.Huang@amd.com \
    --cc=bharathprabhu.perdoor@amd.com \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perry.yuan@amd.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=poonam.aggrwal@amd.com \
    /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

all inboxes | Powered by JetHome®