From: Mario Limonciello <mario.limonciello@amd.com>
To: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>,
hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com
Cc: platform-driver-x86@vger.kernel.org, Patil.Reddy@amd.com
Subject: Re: [PATCH v2 1/2] platform/x86/amd/pmf: remove smart_pc_status enum
Date: Tue, 13 Feb 2024 08:59:26 -0600 [thread overview]
Message-ID: <87f6c9a7-ec3a-410f-bc2b-04b6c63c01b4@amd.com> (raw)
In-Reply-To: <20240213073651.404220-1-Shyam-sundar.S-k@amd.com>
On 2/13/2024 01:36, Shyam Sundar S K wrote:
> Improve code readability by removing smart_pc_status enum, as the same
> can be done with a simple true/false check; Update the code checks
> accordingly.
>
> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
> v1->v2:
> - remove enum smart_pc_status and adjust the code handling
>
> drivers/platform/x86/amd/pmf/core.c | 2 +-
> drivers/platform/x86/amd/pmf/pmf.h | 5 -----
> drivers/platform/x86/amd/pmf/tee-if.c | 4 ++--
> 3 files changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/platform/x86/amd/pmf/core.c b/drivers/platform/x86/amd/pmf/core.c
> index feaa09f5b35a..ff0d61a56484 100644
> --- a/drivers/platform/x86/amd/pmf/core.c
> +++ b/drivers/platform/x86/amd/pmf/core.c
> @@ -351,7 +351,7 @@ static void amd_pmf_deinit_features(struct amd_pmf_dev *dev)
> amd_pmf_deinit_sps(dev);
> }
>
> - if (!dev->smart_pc_enabled) {
> + if (dev->smart_pc_enabled) {
> amd_pmf_deinit_smart_pc(dev);
> } else if (is_apmf_func_supported(dev, APMF_FUNC_AUTO_MODE)) {
> amd_pmf_deinit_auto_mode(dev);
> diff --git a/drivers/platform/x86/amd/pmf/pmf.h b/drivers/platform/x86/amd/pmf/pmf.h
> index 16999c5b334f..66cae1cca73c 100644
> --- a/drivers/platform/x86/amd/pmf/pmf.h
> +++ b/drivers/platform/x86/amd/pmf/pmf.h
> @@ -441,11 +441,6 @@ struct apmf_dyn_slider_output {
> struct apmf_cnqf_power_set ps[APMF_CNQF_MAX];
> } __packed;
>
> -enum smart_pc_status {
> - PMF_SMART_PC_ENABLED,
> - PMF_SMART_PC_DISABLED,
> -};
> -
> /* Smart PC - TA internals */
> enum system_state {
> SYSTEM_STATE_S0i3,
> diff --git a/drivers/platform/x86/amd/pmf/tee-if.c b/drivers/platform/x86/amd/pmf/tee-if.c
> index f8c0177afb0d..8b7e3f87702e 100644
> --- a/drivers/platform/x86/amd/pmf/tee-if.c
> +++ b/drivers/platform/x86/amd/pmf/tee-if.c
> @@ -260,7 +260,7 @@ static int amd_pmf_start_policy_engine(struct amd_pmf_dev *dev)
> res = amd_pmf_invoke_cmd_init(dev);
> if (res == TA_PMF_TYPE_SUCCESS) {
> /* Now its safe to announce that smart pc is enabled */
> - dev->smart_pc_enabled = PMF_SMART_PC_ENABLED;
> + dev->smart_pc_enabled = true;
> /*
> * Start collecting the data from TA FW after a small delay
> * or else, we might end up getting stale values.
> @@ -268,7 +268,7 @@ static int amd_pmf_start_policy_engine(struct amd_pmf_dev *dev)
> schedule_delayed_work(&dev->pb_work, msecs_to_jiffies(pb_actions_ms * 3));
> } else {
> dev_err(dev->dev, "ta invoke cmd init failed err: %x\n", res);
> - dev->smart_pc_enabled = PMF_SMART_PC_DISABLED;
> + dev->smart_pc_enabled = false;
> return res;
> }
>
next prev parent reply other threads:[~2024-02-13 14:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-13 7:36 [PATCH v2 1/2] platform/x86/amd/pmf: remove smart_pc_status enum Shyam Sundar S K
2024-02-13 7:36 ` [PATCH v2 2/2] platform/x86/amd/pmf: Fix TEE enact command failure after suspend and resume Shyam Sundar S K
2024-02-13 14:59 ` Mario Limonciello
2024-02-13 14:59 ` Mario Limonciello [this message]
2024-02-14 9:28 ` [PATCH v2 1/2] platform/x86/amd/pmf: remove smart_pc_status enum Shyam Sundar S K
2024-02-14 10:30 ` Hans de Goede
2024-02-14 12:48 ` Shyam Sundar S K
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=87f6c9a7-ec3a-410f-bc2b-04b6c63c01b4@amd.com \
--to=mario.limonciello@amd.com \
--cc=Patil.Reddy@amd.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=platform-driver-x86@vger.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