From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Cc: hdegoede@redhat.com, markgross@kernel.org,
Sanket.Goswami@amd.com, mario.limonciello@amd.com,
platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH v5 3/4] platform/x86/amd: pmc: Add helper function to check the cpu id
Date: Fri, 26 May 2023 12:32:04 +0300 (EEST) [thread overview]
Message-ID: <e2ae3dc1-9142-732c-59ff-5f1d91f12147@linux.intel.com> (raw)
In-Reply-To: <20230525141929.866385-4-Shyam-sundar.S-k@amd.com>
[-- Attachment #1: Type: text/plain, Size: 2039 bytes --]
On Thu, 25 May 2023, Shyam Sundar S K wrote:
> Add a helper routine to check the underlying cpu id, that can be used
> across the PMC driver to remove the duplicate code.
>
> Co-developed-by: Sanket Goswami <Sanket.Goswami@amd.com>
> Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com>
> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
> ---
> drivers/platform/x86/amd/pmc.c | 17 ++++++++++++++---
> 1 file changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/platform/x86/amd/pmc.c b/drivers/platform/x86/amd/pmc.c
> index e2439fda5c02..c2f03cdc9ca9 100644
> --- a/drivers/platform/x86/amd/pmc.c
> +++ b/drivers/platform/x86/amd/pmc.c
> @@ -564,6 +564,18 @@ static void amd_pmc_dbgfs_unregister(struct amd_pmc_dev *dev)
> debugfs_remove_recursive(dev->dbgfs_dir);
> }
>
> +static bool amd_pmc_is_stb_supported(struct amd_pmc_dev *dev)
> +{
> + switch (dev->cpu_id) {
> + case AMD_CPU_ID_YC:
> + case AMD_CPU_ID_CB:
> + case AMD_CPU_ID_PS:
> + return true;
> + default:
> + return false;
> + }
> +}
> +
> static void amd_pmc_dbgfs_register(struct amd_pmc_dev *dev)
> {
> dev->dbgfs_dir = debugfs_create_dir("amd_pmc", NULL);
> @@ -575,8 +587,7 @@ static void amd_pmc_dbgfs_register(struct amd_pmc_dev *dev)
> &amd_pmc_idlemask_fops);
> /* Enable STB only when the module_param is set */
> if (enable_stb) {
> - if (dev->cpu_id == AMD_CPU_ID_YC || dev->cpu_id == AMD_CPU_ID_CB ||
> - dev->cpu_id == AMD_CPU_ID_PS)
> + if (amd_pmc_is_stb_supported(dev))
> debugfs_create_file("stb_read", 0644, dev->dbgfs_dir, dev,
> &amd_pmc_stb_debugfs_fops_v2);
> else
> @@ -1036,7 +1047,7 @@ static int amd_pmc_probe(struct platform_device *pdev)
>
> mutex_init(&dev->lock);
>
> - if (enable_stb && (dev->cpu_id == AMD_CPU_ID_YC || dev->cpu_id == AMD_CPU_ID_CB)) {
> + if (enable_stb && amd_pmc_is_stb_supported(dev)) {
> err = amd_pmc_s2d_init(dev);
> if (err)
> goto err_pci_dev_put;
>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
--
i.
next prev parent reply other threads:[~2023-05-26 9:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-25 14:19 [PATCH v5 0/4] Updates to AMD PMC driver Shyam Sundar S K
2023-05-25 14:19 ` [PATCH v5 1/4] platform/x86/amd: pmc: Pass true/false to bool argument Shyam Sundar S K
2023-05-25 14:19 ` [PATCH v5 2/4] platform/x86/amd: pmc: Get STB DRAM size from PMFW Shyam Sundar S K
2023-05-25 14:19 ` [PATCH v5 3/4] platform/x86/amd: pmc: Add helper function to check the cpu id Shyam Sundar S K
2023-05-26 9:32 ` Ilpo Järvinen [this message]
2023-05-25 14:19 ` [PATCH v5 4/4] platform/x86/amd: pmc: Update metrics table info for Pink Sardine Shyam Sundar S K
2023-05-26 9:38 ` Ilpo Järvinen
2023-05-25 14:24 ` [PATCH v5 0/4] Updates to AMD PMC driver Limonciello, Mario
2023-05-30 9:09 ` Hans de Goede
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=e2ae3dc1-9142-732c-59ff-5f1d91f12147@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=Sanket.Goswami@amd.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=hdegoede@redhat.com \
--cc=mario.limonciello@amd.com \
--cc=markgross@kernel.org \
--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