Re: [PATCH 3/3] cpufreq: amd-pstate: Add a module device table
From: Huang Rui
Date: Sun Mar 27 2022 - 09:27:57 EST
On Fri, Mar 25, 2022 at 01:42:28PM +0800, Limonciello, Mario wrote:
> `amd-pstate` currently only loads automatically if compiled into the
> kernel. To improve the usability, add a module device table that
> will load when AMD CPUs that support CPPC are detected.
>
There is one AMD semi-custom processor which has the CPPC feature flag, but
the SBIOS doesn't support _CPC objects.
Thanks,
Ray
> Signed-off-by: Mario Limonciello <mario.limonciello@xxxxxxx>
> ---
> drivers/cpufreq/amd-pstate.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index 31a04e818195..44490292fa72 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -644,6 +644,12 @@ static void __exit amd_pstate_exit(void)
> amd_pstate_enable(false);
> }
>
> +static const struct x86_cpu_id __maybe_unused amd_pstate_ids[] = {
> + X86_MATCH_VENDOR_FEATURE(AMD, X86_FEATURE_CPPC, NULL),
> + {}
> +};
> +MODULE_DEVICE_TABLE(x86cpu, amd_pstate_ids);
> +
> module_init(amd_pstate_init);
> module_exit(amd_pstate_exit);
>
> --
> 2.34.1
>