mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wyes Karny <wyes.karny@amd.com>
To: Mario Limonciello <mario.limonciello@amd.com>
Cc: trenn@suse.com, shuah@kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, rafael@kernel.org,
	gautham.shenoy@amd.com, Ray.Huang@amd.com, Perry.Yuan@amd.com
Subject: Re: [PATCH v2 1/5] cpupower: Recognise amd-pstate active mode driver
Date: Mon, 19 Jun 2023 23:01:07 +0530	[thread overview]
Message-ID: <ZJCQ2ypbQgZOOjt3@BLR-5CG13462PL.amd.com> (raw)
In-Reply-To: <348fbe1a-6c2d-68d2-b4fc-278407ede33c@amd.com>

Hi Mario,

On 18 Jun 20:58, Mario Limonciello wrote:
> On 6/16/23 07:06, Wyes Karny wrote:
> > amd-pstate active mode driver name is "amd-pstate-epp".  Add this to the
> > string matching condition to recognise amd-pstate active mode driver.
> > 
> > Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
> > Signed-off-by: Wyes Karny <wyes.karny@amd.com>
> > ---
> >   tools/power/cpupower/utils/helpers/misc.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/power/cpupower/utils/helpers/misc.c b/tools/power/cpupower/utils/helpers/misc.c
> > index 9547b29254a7..21f653cd472c 100644
> > --- a/tools/power/cpupower/utils/helpers/misc.c
> > +++ b/tools/power/cpupower/utils/helpers/misc.c
> > @@ -95,7 +95,7 @@ bool cpupower_amd_pstate_enabled(void)
> >   	if (!driver)
> >   		return ret;
> > -	if (!strcmp(driver, "amd-pstate"))
> > +	if (!strcmp(driver, "amd-pstate") || !strcmp(driver, "amd-pstate-epp"))
> 
> To avoid getting caught in the case that a kernel didn't have the patch
> separated from this series (for example if a distro missed it in a backport
> from separate directories), how about using strncmp() instead and just look
> for the prefix?

Sure, I'll update the patch.
I'm thinking of using strncmp(driver, "amd", 3), because in the above
case the epp driver would be "amd_pstate_epp" therefore common prefix is
only "amd".

Thanks,
Wyes
> 
> This would also let the tool be more future proofed in the case another
> amd-pstate driver was introduced later down the road as long as it stuck to
> "amd-pstate*"
> 
> >   		ret = true;
> >   	cpufreq_put_driver(driver);
> 

  reply	other threads:[~2023-06-19 17:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-16 12:06 [PATCH v2 0/5] cpupower: Add various feature control support for amd_pstate Wyes Karny
2023-06-16 12:06 ` [PATCH v2 1/5] cpupower: Recognise amd-pstate active mode driver Wyes Karny
2023-06-19  1:58   ` Mario Limonciello
2023-06-19 17:31     ` Wyes Karny [this message]
2023-06-19 17:37       ` Limonciello, Mario
2023-06-16 12:06 ` [PATCH v2 2/5] cpupower: Add is_valid_path API Wyes Karny
2023-06-19  1:58   ` Mario Limonciello
2023-06-16 12:09 ` [PATCH v2 3/5] cpupower: Add EPP value change support Wyes Karny
2023-06-19  1:58   ` Mario Limonciello
2023-06-16 12:10 ` [PATCH v2 4/5] cpupower: Add support for amd_pstate mode change Wyes Karny
2023-06-19  1:59   ` Mario Limonciello
2023-06-16 12:11 ` [PATCH v2 5/5] cpupower: Add turbo-boost support in cpupower Wyes Karny
2023-06-19  1:59   ` Mario Limonciello

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=ZJCQ2ypbQgZOOjt3@BLR-5CG13462PL.amd.com \
    --to=wyes.karny@amd.com \
    --cc=Perry.Yuan@amd.com \
    --cc=Ray.Huang@amd.com \
    --cc=gautham.shenoy@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=rafael@kernel.org \
    --cc=shuah@kernel.org \
    --cc=trenn@suse.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®