All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Limonciello, Mario" <mario.limonciello@amd.com>
To: Perry Yuan <Perry.Yuan@amd.com>,
	rafael.j.wysocki@intel.com, ray.huang@amd.com,
	viresh.kumar@linaro.org, wyes.karny@amd.com
Cc: Deepak.Sharma@amd.com, Nathan.Fontenot@amd.com,
	Alexander.Deucher@amd.com, Shimmer.Huang@amd.com,
	Xiaojian.Du@amd.com, Li.Meng@amd.com, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/8] cpufreq: amd-pstate: change driver to be built-in type
Date: Mon, 7 Nov 2022 12:29:50 -0600	[thread overview]
Message-ID: <392fb511-5d16-167d-77ab-dfaa43dca4cb@amd.com> (raw)
In-Reply-To: <20221107175705.2207842-4-Perry.Yuan@amd.com>

+ wyes.karny@amd.com

You should sync with Wyes Karny on this patch, I think he had some 
different ideas that you guys should fold together for v4 of this 
series.  I'll leave some direct comments on your implementation below.

Also, include him in on CC for your v4.

On 11/7/2022 11:57, Perry Yuan wrote:
> Change the `amd-pstate` driver as the built-in type which can help to
> load the driver before the acpi_cpufreq driver as the default pstate
> driver for the AMD processors.
> 
> for the processors do not have the dedicated MSR functions, add
> `amd-pstate=legacy_cppc` to grub which enable shared memmory interface
> to communicate with cppc_acpi module to control pstate hints.

1) s/memmory/memory/
2) Although many users will use GRUB to configure their kernel command 
line you should not assume it in the commit message.

> 
> Signed-off-by: Perry Yuan <Perry.Yuan@amd.com>
> ---
>   drivers/cpufreq/amd-pstate.c | 23 +++++++++++++----------
>   1 file changed, 13 insertions(+), 10 deletions(-)

You need to document the new early parameter support in 
kernel-parameters.txt, and should also put it in amd-pstate.rst.

> 
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index ace7d50cf2ac..14906431dc15 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -59,10 +59,7 @@
>    * we disable it by default to go acpi-cpufreq on these processors and add a
>    * module parameter to be able to enable it manually for debugging.
>    */
> -static bool shared_mem = false;
> -module_param(shared_mem, bool, 0444);
> -MODULE_PARM_DESC(shared_mem,
> -		 "enable amd-pstate on processors with shared memory solution (false = disabled (default), true = enabled)");
> +static bool shared_mem __read_mostly;
>   
>   static struct cpufreq_driver amd_pstate_driver;
>   
> @@ -653,16 +650,22 @@ static int __init amd_pstate_init(void)
>   
>   	return ret;
>   }
> +device_initcall(amd_pstate_init);
>   
> -static void __exit amd_pstate_exit(void)
> +static int __init amd_pstate_param(char *str)
>   {
> -	cpufreq_unregister_driver(&amd_pstate_driver);
> +	if (!str)
> +		return -EINVAL;
>   
> -	amd_pstate_enable(false);
> -}
> +	/* enable shared memory type CPPC ,if you processor has no MSR, you have to add this
> +	 * to your grub to make cppc driver loaded successfully.

Don't reference GRUB here, it should be referenced from the kernel 
command line.

> +	 */
> +	if (!strcmp(str, "legacy_cppc"))
> +		shared_mem = true;
Sync with Wyes about this.  He had some different strings and flow in 
mind which I think would be more preferable.

>   
> -module_init(amd_pstate_init);
> -module_exit(amd_pstate_exit);
> +	return 0;
> +}
> +early_param("amd-pstate", amd_pstate_param);
>   
>   MODULE_AUTHOR("Huang Rui <ray.huang@amd.com>");
>   MODULE_DESCRIPTION("AMD Processor P-state Frequency Driver");


  reply	other threads:[~2022-11-07 18:30 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-07 17:56 [PATCH v3 0/8] Implement AMD Pstate EPP Driver Perry Yuan
2022-11-07 17:56 ` [PATCH v3 1/8] ACPI: CPPC: Add AMD pstate energy performance preference cppc control Perry Yuan
2022-11-07 18:44   ` Limonciello, Mario
2022-11-10 14:49     ` Rafael J. Wysocki
2022-11-10 15:51       ` Yuan, Perry
2022-11-10 15:55         ` Rafael J. Wysocki
2022-11-10 16:23           ` Yuan, Perry
2022-11-13 16:28     ` Yuan, Perry
2022-11-07 17:56 ` [PATCH v3 2/8] Documentation: amd-pstate: add EPP profiles introduction Perry Yuan
2022-11-07 18:33   ` Limonciello, Mario
2022-11-13 16:23     ` Yuan, Perry
2022-11-10 14:57   ` Rafael J. Wysocki
2022-11-10 15:07     ` Yuan, Perry
2022-11-07 17:57 ` [PATCH v3 3/8] cpufreq: amd-pstate: change driver to be built-in type Perry Yuan
2022-11-07 18:29   ` Limonciello, Mario [this message]
2022-11-13 16:21     ` Yuan, Perry
2022-11-07 17:57 ` [PATCH v3 4/8] cpufreq: amd_pstate: add AMD Pstate EPP support for the MSR based processors Perry Yuan
2022-11-07 20:32   ` Limonciello, Mario
2022-11-10 15:59     ` Nathan Fontenot
2022-11-10 16:22       ` Yuan, Perry
2022-11-08  7:21   ` kernel test robot
2022-11-09  5:55   ` kernel test robot
2022-11-07 17:57 ` [PATCH v3 5/8] cpufreq: amd_pstate: implement amd pstate cpu online and offline callback Perry Yuan
2022-11-07 18:22   ` Limonciello, Mario
2022-11-13 16:19     ` Yuan, Perry
2022-11-07 17:57 ` [PATCH v3 6/8] cpufreq: amd-pstate: implement suspend and resume callbacks Perry Yuan
2022-11-07 18:18   ` Limonciello, Mario
2022-11-13 16:19     ` Yuan, Perry
2022-11-10 16:19   ` Nathan Fontenot
2022-11-07 17:57 ` [PATCH v3 7/8] cpufreq: amd-pstate: add frequency dynamic boost sysfs control Perry Yuan
2022-11-07 18:16   ` Limonciello, Mario
2022-11-07 19:09     ` Limonciello, Mario
2022-11-07 17:57 ` [PATCH v3 8/8] cpufreq: amd_pstate: add driver working mode status sysfs entry Perry Yuan
2022-11-07 18:10   ` Limonciello, Mario
2022-11-13 16:18     ` Yuan, Perry
2022-11-10 16:06   ` Nathan Fontenot
2022-11-10 16:49     ` Yuan, Perry

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=392fb511-5d16-167d-77ab-dfaa43dca4cb@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Deepak.Sharma@amd.com \
    --cc=Li.Meng@amd.com \
    --cc=Nathan.Fontenot@amd.com \
    --cc=Perry.Yuan@amd.com \
    --cc=Shimmer.Huang@amd.com \
    --cc=Xiaojian.Du@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=ray.huang@amd.com \
    --cc=viresh.kumar@linaro.org \
    --cc=wyes.karny@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.